How do I prevent duplicates, in XSL?

后端 未结 6 629
长发绾君心
长发绾君心 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

    Try the following code:

    
    
      
    
    
      
        
      
    
    
      
        
          
            
              
              
                
                
                
                
    
                  
                  
                  
                  
                    
                    , 
                    
                  
                
                
              
            
          
    
          
          
            
          
        
      
    
    
    

    It looks pretty much as the output you want:

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

    The trick is to use and distinct-values() together. See the (IMHO) great book from Michael Key "XSLT 2.0 and XPATH 2.0"

提交回复
热议问题