aspose file tools*
The moose likes Product and Other Certifications and the fly likes ADDING TWO XML FILES Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "ADDING TWO XML FILES" Watch "ADDING TWO XML FILES" New topic
Author

ADDING TWO XML FILES

michael byrd
Greenhorn

Joined: Jan 21, 2006
Posts: 23
Hi
How can I add the contents of XML DOC 1 into XML DOC 2 to produce something like XML DOC 3?

XML DOC 1

<Fruits>
<Apple>apples</Apple>
<Banana>bananas</Banana>
<Orange>oranges</Orange>
</Fruits>


XML DOC 2

<Fruits>
<Mango>mangos</Mango>
<Pears>pears</Pears>
<Litchi>litchi</Litchi>
<Grapes>grapes</Grapes>
</Fruits>


XML DOC 3

<Fruits>
<Apple>apples</Apple>
<Banana>bananas</Banana>
<Orange>oranges</Orange>
<Mango>mangos</Mango>
<Pears>pears</Pears>
<Litchi>litchi</Litchi>
<Grapes>grapes</Grapes>
</Fruits>
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
You may use SAX(parse them both, creating a 3rd xml) or DOM(load them into dom objects and combine them).
 
wood burning stoves
 
subject: ADDING TWO XML FILES