Get tag name/attribute name in XML using XSLT

后端 未结 3 1479
没有蜡笔的小新
没有蜡笔的小新 2021-01-05 02:20

What\'s the way to get a tag name and attribute name in XML?

If I have a XML file like this:





        
3条回答
  •  温柔的废话
    2021-01-05 02:49

    This is probably one of the shortest solutions:

    
     
     
    
     
      
       
      
       
     
    
    

    when this transformation is applied on the following XML document (your fragment wrapped into a top element):

    
        
        
        
        
    
    

    the wanted, correct result is produced:

    apple
    color
    banana
    color
    sugar
    taste
    cat
    size
    

提交回复
热议问题