XSLT transformation to xml, grouping by key

前端 未结 2 518
北海茫月
北海茫月 2021-01-21 11:54

I have problem with write xsl to transform my xml to raport version. It looks like that:


    
        Jo         


        
2条回答
  •  無奈伤痛
    2021-01-21 12:20

    This transformation:

    
     
     
    
     
    
     
      
       
      
     
    
     
      
            
      
     
    
     
      
      
        
          
        
      
     
    
     
      
     
     
    
    

    when applied on the provided XML document:

    
        
            John
            Tom
        
        
            
    1001 Article1
    1002 Article2
    1001 Article3

    produces the wanted, correct result:

    
       
          John
          
             
    Article1
    Article3
    Tom
    Article2

    Notes:

    1. Use/overriding of the identity rule.

    2. All articles with the same authorId are selected using keys. This is significantly more efficient in case of many authors with many articles.

提交回复
热议问题