Multiply 2 numbers and then sum

后端 未结 2 1017
悲&欢浪女
悲&欢浪女 2020-11-28 14:31

I am having a difficult time trying to do something that seems like it should be really easy to do. I basically want to multiply 2 numbers in a node and then sum the total o

2条回答
  •  再見小時候
    2020-11-28 15:10

    All of Dimitre's solutions work and he's right that you don't need to use extension functions but sometimes it makes life easier. It's not too harmful, especially when you use exslt extensions which are supported across multiple XSLT processors. Also, the reason you're getting the sequence errors is probably because you're using an XSLT 1 processor.

    If you want to persist with your chosen solution, you'll need to use Saxon or some other XSLT processor that supports XSLT 2.

    Otherwise, here's an alternative method of doing it in XSLT 1. This will work in most XSLT processors and some peope might find it easier to grok than the recursive version. Personally, I prefer the recursive version (Dimitre's 3rd proposal) because it is more portable.

    
      
    
      
        
        
    
        
          
            
          
        
      
    
      
        
          
            
            
          
        
    
        
      
    
    

提交回复
热议问题