Results 1 to 2 of 2
- 07-06-2012, 01:05 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 1
- Rep Power
- 0
xml file merging, based on the node.
HI all,
this is my first post on this forum, please help me in below regard:
I have three xml files, I want to merge them but based on the node.
This is the example:
file1
---------------------
<?xml version="1.0" ?>
- <catalog>
- <book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
</book>
- <book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
</book>
- <book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
</book>
- <book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
</book>
</catalog>
file2
--------------------------------------
<?xml version="1.0" ?>
- <catalog>
- <book id="bk101">
<genre>Computer</genre>
<price>44.95</price>
</book>
- <book id="bk102">
<genre>Fantasy</genre>
<price>5.95</price>
</book>
- <book id="bk103">
<genre>Fantasy</genre>
<price>5.95</price>
</book>
- <book id="bk104">
<genre>Fantasy</genre>
<price>5.95</price>
</book>
</catalog>
file3
------------------------------------------------
<?xml version="1.0" ?>
- <catalog>
- <book id="bk101">
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications with XML.</description>
</book>
- <book id="bk102">
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.</description>
</book>
- <book id="bk103">
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.</description>
</book>
- <book id="bk104">
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant.</description>
</book>
</catalog>
================================================== =============
now the final file should be like:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
<book id="bk104">
<author>Corets, Eva</author>
<title>Oberon's Legacy</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-03-10</publish_date>
<description>In post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant.</description>
</book>
Please help.
- 07-07-2012, 07:21 AM #2
Re: xml file merging, based on the node.
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
How to split a file by based on size
By kewlkeny in forum New To JavaReplies: 3Last Post: 01-05-2012, 11:07 AM -
How to change the individual node Icon of a JTree based on the user action?
By Anandababu in forum AWT / SwingReplies: 1Last Post: 07-10-2010, 04:21 AM -
save file based on file extension
By masa in forum AWT / SwingReplies: 4Last Post: 05-11-2010, 11:17 AM -
random node from an xml file
By matthew.parse in forum New To JavaReplies: 1Last Post: 04-13-2010, 08:45 PM -
How to download a file from FTP in struts based web app.
By Malathi in forum Web FrameworksReplies: 1Last Post: 07-14-2009, 05:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks