Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
License

Second names tutorial



This tutorial presents two XML files and the results of the comparison with a Rules configuration with more than one rule.

Files to compare

The left file[1] :
   <theRoot>
      <parent id="Paul">
         <child name="Rick" />
         <child name="John" age="18"/>      
      </parent> 
   </theRoot>
The right file[2] :
   <theRoot>
      <parent id="Paul">
         <child name="Seena" />
         <child name="John" age="22"/>      
      </parent> 
   </theRoot>

Default comparison

Main Article: Default comparison

The default comparison between the XML files will present the following result:
tutorial3_1

Comparison with nodes identification

Main Article: nodes identification

The following Rules configuration specify that[3] :
  • The node identification is the id attribute for nodes which name is parent
  • The node identification is the name attribute for nodes which name is child
   <nodeRules>
      <rule>
         <appliesOn>
            <nodeName name="parent" />
         </appliesOn>
         <identification>
            <attribute name="id" />
         </identification>      
      </rule>
      <rule>
         <appliesOn>
            <nodeName name="child" />
         </appliesOn>
         <identification>
            <attribute name="name" />
         </identification>      
      </rule>   
   </nodeRules>
The comparison will present the following result:
tutorial3_2

Notes

See also


Categories: tutorials

xmldiff Copyright (c) 2024 Herve Girod. All rights reserved.