Group/merge childs of same nodes in xml/xslt

前端 未结 2 756
悲哀的现实
悲哀的现实 2020-12-11 08:24

I am new to XSLT and changing it manually will take a lot of time.


 

        
2条回答
  •  萌比男神i
    2020-12-11 09:03

    If it is XSLT 2.0 then you can use a nested

    
      
        
          
            
              
                
                
                
                
              
            
          
        
      
    
    

    (I'm assuming your input file has a root element and uses no namespaces).

    If it's XSLT 1.0 then you need to use Muenchian Grouping:

    
      
      
        
          
          
            
              
              
              
              
            
          
        
      
    
    

    Here I'm doing a single grouping pass based on both the ID and Key attributes by creating a synthetic key value of {ID}___{Key}.

提交回复
热议问题