How to organize entries of XML

后端 未结 2 1391
遇见更好的自我
遇见更好的自我 2021-01-26 00:58

XML:



    

        
2条回答
  •  执念已碎
    2021-01-26 01:37

    Given the following input:

    XML

    
        Link #2
        2
        
        false
        
        
        
        
        
        
    
        Link #1
        1
        
        false
        
        
        
        
        
        
    
        Link #3
        3
        
        false
        
        
        
        
        
        
    
    

    the following stylehseet:

    XSLT 1.0

    
    
    
    
        

    will return:

    • Link #1
    • Link #2
    • Link #3

    Note:

    You can capture the ordinal number in a variable, for example:

    
    

    and use it to address additional nodes by their name, instead of by their position in the "block".


    Added:

    For an input where the mOrder nodes are also numbered, i.e.:

    XML

    
        Link #2
        2
        
        false
        
        
        
        
        
        
    
        Link #1
        1
        
        false
        
        
        
        
        
        
    
        Link #3
        3
        
        false
        
        
        
        
        
        
    
    

    you can use:

    
        

提交回复
热议问题