How do I prevent duplicates, in XSL?

后端 未结 6 643
长发绾君心
长发绾君心 2021-01-02 12:32

How do I prevent duplicate entries into a list, and then ideally, sort that list? What I\'m doing, is when information at one level is missing, taking the information from

6条回答
  •  太阳男子
    2021-01-02 13:07

    The following XSLT 1.0 transformation does what you are looking for

     
      
    
      
      
    
      
      
        
          
        
      
    
      
      
        
          
          
            
            
              
              
            
          
          
        
      
    
      
      
        
        
          , 
        
      
    
    
    

    Returns

    
      
        154, 156
        Clinic Building
        1947
      
      
        
          156
          3
        
      
      
        
          156
          Contact prints
        
      
      
        
          154
          Negatives
        
      
    
    

    The generate-id() = generate-id(key(...)[1]) part is what's called Muenchian grouping. Unless you can use XSLT 2.0, this is the way to go.

提交回复
热议问题