Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Merging XML documents using DOM

843834Jan 25 2005 — edited Jan 27 2005
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2005
Added on Jan 25 2005
7 comments
383 views