Recursive Loop XSLT

后端 未结 3 1508
不思量自难忘°
不思量自难忘° 2021-01-05 10:50

All,

I have the below XSLT


    
              


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 11:29

    Use:

    
     
    
        
          
            
          
        
    
        
            
            
    
            
                 
                
                
                    
                    
                
            
        
    
    

    when this transformation is performed on any XML document (not used), the wanted result: 1 to 100 is produced.

    Do note: This solution is tail-recursive and with many XSLT processors will be optimized so that recursion is eliminated. This means you can use it with $count set to millions without stack overflow or slow execution.

    A non-tail recursive solution, like the one of @0xA3 crashes with stack-overflow (with Saxon 6.5.4) even with count = 1000

提交回复
热议问题