compare two xml files with xslt?

前端 未结 3 904
萌比男神i
萌比男神i 2021-02-10 13:12

I have 2 xml files. How can I compare both files are equal or not by using xslt? If not equal means where the changes havebeen occur in the second xml?

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-10 14:02

    This is the stylesheet I wrote to compare two XML files with different order in nodes and attributes. It will generate two text files, containing the ordered list of all the leaf nodes path. Use any text compare tool to spot out the differences or enhance the XSLT to do what you want.

    
    
    
    
    xml_file_to_diff.xml
    ORIGINAL.txt
    OTHER.txt
    
    
        
            
            
        
        
            
            
        
    
    
    
        
        
    
        
            
        
    
        
            
                
                
                
    
            
        
    
    
    
        
            
                
                    
                        
                        
                            
                            [
                            
                            :
                            
                            ]
                        
                        /
                    
                    
                
            
        
        
    
    
    
    

提交回复
热议问题