In XSLT how do I increment a global variable from a different scope?

后端 未结 8 1102
礼貌的吻别
礼貌的吻别 2020-11-29 04:41

I am processing an XML file where I want to keep count of the number of nodes, so that I can use it as an ID as I write new nodes.

At the moment I have a global vari

8条回答
  •  [愿得一人]
    2020-11-29 05:16

    Variables in XSLT are immutable so you have to approact the problem with that in mind. You could either use position() directly:

     
       
          
       
    
    
    
       
    
    

    Or in a more template orientated way:

     
       
    
    
    
       
    
    

提交回复
热议问题