Aggregate-function for sum and product in XPath

前端 未结 3 1217
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-21 05:03

Similar to this question (http://stackoverflow.com/q/1333558/948404) I want to use XPath to calculate a sum over products in a structure like this:

         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 05:25

    Based on this suggestion https://stackoverflow.com/a/1334165/948404 I came up with a solution compliant with XSLT 1.0 and XPath 1.0, which are implemented by libxml/libxslt, used by PHPs implementation of XSLTProcessor (thanks to @Dimitre Novatchev for confirmation).

    
    
    
        
            
                
            
        
    
        
            
            
            
            
            
            
                
                    
                
                
                    
                        
                        
                    
                
            
        
    
    
    

提交回复
热议问题