How I can repeat an action X times with XSLT

前端 未结 5 1534
囚心锁ツ
囚心锁ツ 2021-02-04 07:47

I\'ve to populate a total of 20 elements with XSLT. In my XML code I have a

This is a specific, recursive solution.

When applied to the following XML document:


    
    
    
    

the wanted, correct result is produced.

II. XSLT 2.0 solution using the f:repeat() function of FXSL:


 
 

 
   
 

  
    
      
       
      
    
  

 
  
 

Here we use a very generic function that will repeat its first argument N (the value of its second argument) times.

The function f:repeat() itself is very simple:



  
    
    

    
      
    
  

提交回复
热议问题