Merging XML documents using DOM
843834Jan 25 2005 — edited Jan 27 2005I have 300 XML documents to merge. They contain structures such as:
1.xml=
<MIM>
<MIM-ENTRY>
<MIM-NUMBER>123456
</MIM-NUMBER>
</MIM-ENTRY>
</MIM>
2.xml =
<Mim>
-<Mim-entry>
<Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
</Mim-entry>
</Mim>
3.xml=
<Mim>
<Mim-entry>
<Mim-alternative_titles_and_symbols>
<Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
</Mim-alternative_titles_and_symbols>
</Mim-entry>
</Mim>
all the XML files have this sort of structure.
Essentailly, I need to merge them (using the above as an example) to get:
<MIM>
<MIM-ENTRY>
<MIM-NUMBER>123456</MIM-NUMBER>
<Mim-title>*604176 SUPPRESSOR OF CYTOKINE SIGNALING 3</Mim-title>
<Mim-alternative_titles_and_symbols>
<Mim-alternative_titles_and_symbols-alt>SOCS3</Mim-alternative_titles_and_symbols-alt>
</Mim-alternative_titles_and_symbols>
</Mim-entry>
</MIM>
I have all the trees stored in a Vector as DOM objects.
Anyone have any ideas how to merge these documents as stated?
Any help would be most appriciated