XSLT node value comparision

后端 未结 1 1866
渐次进展
渐次进展 2021-01-29 06:17

How Can I compare ip address with reference of family and name. using XSLT file. In Details, I have one xml file which has list of operatorstation nodes with each operator stati

1条回答
  •  别那么骄傲
    2021-01-29 06:47

    I think I have finally understood this question.

    The following stylesheet will group the OperatorStation elements by the Family and Name elements located inside Nodes/DataNodeBase. Note that there is another Name element that is a direct child of OperatorStation - this is potentially confusing.

    For each group, the first IPAddress element is listed and the others are compared to it. The names of these result elements are taken from the values of the (top) Name element (just to add some more confusion...).

    Pay special attention to the handling of the namespace declared in the source XML document.

    Styleheet:

    
     
    
    
    
    
    
    
        
        
            
            
    
            
    
              
                    
                        
                            
                                
                            
                            
                                Equal
                            
                            
                                UnEqual
                            
                        
                    
            
         
        
    
    
    
    

    Source XML:

    
    
        
            OS01
            
                
                        NetworkSettings
                        Internet
                        111.22.22.3  
                
            
          
        
            OS02
            
                
                    NetworkSettings
                    Internet
                    111.22.22.3  
                
            
                  
            
            OS03
            
                
                    NetworkSettings
                    Internet
                    111.22.22.4  
                
            
              
        
            OS04
            
                
                    NetworkSettings
                    Internet
                    111.22.22.4  
                
            
        
    
    

    Result:

    
    
      
        NetworkSettings
        Internet
        111.22.22.3
        Equal
        UnEqual
        UnEqual
      
    
    

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