How to list complete XML document using XSLT

前端 未结 2 864
暖寄归人
暖寄归人 2020-12-21 10:35

What i\'m looking for might seem pretty easy to understand, but i\'m having a hard time making it possible.

I want to be able to put the content of an XML file on an

2条回答
  •  借酒劲吻你
    2020-12-21 11:03

    This transformation:

    
     
     
    
     
      
      
     
    
    

    when applied on any XML document (such as this):

    
        
        
        
            1532
        
        
            16115
        
        
            16115
        
        
            1532
        
        
            16131
        
        
            16131
        
        
            16131
        
        
            16131
        
        
            16131
        
    
    

    produces the wanted output (a list of the names of all elements in the XML document):

    Catalog
    Category
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    Category
    ParentCategory
    

    In case only the distinct element names are wanted, then this transformation:

    
     
     
    
     
    
     
      
      
     
     
    
    

    produces the wanted result:

    Catalog
    Category
    ParentCategory
    

提交回复
热议问题