Compare/Diff the nodes between 2 XML Files

Questions about XML that are not covered by the other forums should go here.
steemer473
Posts: 2
Joined: Thu Sep 28, 2017 9:57 pm

Compare/Diff the nodes between 2 XML Files

Post by steemer473 »

Hello Tech Support,

How do you compare/diff the nodes (tags) of two xml files and then merge the tags into the second xml file? I would like to isolate the nodes of both files and then do a diff/merge. Thank you.
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Compare/Diff the nodes between 2 XML Files

Post by tavy »

Hello,

We do not have such a feature. You need to compare the entire documents.
You can use the "Ignore nodes by XPath" feature, to ignore the changes from the document that are made in other nodes. For this you need to create an XPath expression that matches all the nodes from the document other than the one you are interested in.
In this way you will see just the changes from the nodes you are interested in, and you can merge them using the merge actions.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
steemer473
Posts: 2
Joined: Thu Sep 28, 2017 9:57 pm

Re: Compare/Diff the nodes between 2 XML Files

Post by steemer473 »

Okay, thank you Octavian for your reply. Is there a way to just export out the nodes only?
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: Compare/Diff the nodes between 2 XML Files

Post by tavy »

Hello,

There is no action to do this automatically. You can create a stylesheet that copies the nodes that you need and apply it on the XML files.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply