how to copy the data of variable of one foreach to another for each in xslt

后端 未结 2 1157
不知归路
不知归路 2021-01-17 04:04

XML


 
     
        102
        BKTRU         


        
2条回答
  •  悲哀的现实
    2021-01-17 04:46

    Can you show me your input xml and desired output xml?

    I kind of cringe a little when I see a foreach in xsl - it's a template language, and rarely needs foreach...

    
    ,">
        
    ">
    ]>
    
        
        
            
        
    
        
            
            
            ,
            ,
            ,
            &cr;
        
    
        O
    
        I
    
        
    
    
    

    You need one row for each block4 name. So apply a template for that block4/tag [name='77']

    Then - for every one of those, select the parent elements that you need.

    xsl:number will count the number of times it selected.

    The ENTITY items are there to control whitespace - otherwise the formatting is crap.

    No need for a foreach. Hope this helps

提交回复
热议问题