I have a requirement, where I should be able to merge any 2 XML files (having similar content though). Basically, my project has quite a few of XML files, which contain a lot of configuration information for different parts of the project. Also, it is possible that the clients for this project might have added some more information into the XMLs as part of their customization. The problem now is that when i need to deliver a bug fix, or an enhancement, I might accidentally overwrite the customization done by the clients, which is definitely not acceptable. So, now, i need to create a utility which can help me with merging the XML files, while retaining the client customizations, and adding only the portion which has been added from the factory. I am not able to figure out how to achieve this. Any help in this regards would be appreciated.
Asked
Active
Viewed 602 times
-3
-
you should provide an example with certain schema. Generic method for your question - identify if node was changed by client, if your bugfix changes the node - merge. otherwise skip. – Tala Jun 25 '13 at 10:51
1 Answers
0
If you have the original XML delivered to Client, run diff against it and save the diff file. Once your factory has generated XML with your fix, apply the diff.
I have used Oracle XMLDiff for this kind of stuff when our docs were stored in 11G XMLDB. This should be usable even when the Docs are outside DB, I think. http://docs.oracle.com/cd/B13789_01/appdev.101/b12024/oracle/xml/differ/XMLDiff.html

R Kaja Mohideen
- 909
- 1
- 8
- 24