Merging set of elements based on a common attribute in XSLT 1.0

前端 未结 1 1867
长情又很酷
长情又很酷 2020-12-22 10:47

I m working with XSLT1.0 . My requirement is to merge set of elements based on a common attribute. I ve an xml which looks like this:



        
1条回答
  •  臣服心动
    2020-12-22 11:13

    As shown in the other topic halfbit linked to, you need to use a key in order to (1) select distinct products (aka the Muenchian method) and (2) collect the values from the related group.

    Here's a little more readable (IMHO) version:

    
    
    
    
    
    
    
    
    
    
    
    
        
        
        
            
            
                
                
                    ,
                
            
        
    
    
    
    
    
    

    If your processor is EXSLT capable, you can use the set:distinct() function instead of the Muenchian grouping.

    0 讨论(0)
提交回复
热议问题