  | |  | mege two separate xml nodes into one | mege two separate xml nodes into one 2007-05-23 - By Alan Andrade
How do I mege the 2 nodes?
INPUT:
<AllBooks>
<BookList1>
<Book id="1" upc= "1" someotherID= "booklist1" salePrice= "1"/>
<Book id="3" upc= "3" someotherID= "booklist1" salePrice= "3"/>
<Book id="4" upc= "4" someotherID= "booklist1" salePrice= "4"/>
</BookList1>
<BookList2>
<Book id="2" upc= "2" someotherID= "booklist2" salePrice= "2"/>
<Book id= "3" upc= "3" someotherID= "booklist2" salePrice= "3"/>
<Book id= "4" upc= "4" someotherID= "booklist2" salePrice= "4"/>
<Book id= "5" upc= "5" someotherID= "booklist2" salePrice= "5"/>
</BookList2>
</AllBooks>
OUTPUT:
<AllBooks>
<BookList>
<Book id="1" upc= "1" someotherID= "booklist1" salePrice= "1"/>
<Book id="2" upc= "3" someotherID= "booklist1" salePrice= "3"/>
<Book id="3" upc= "4" someotherID= "booklist1" salePrice= "4"/>
<Book id="4" upc= "2" someotherID= "booklist2" salePrice= "2"/>
<Book id= "5" upc= "3" someotherID= "booklist2" salePrice= "3"/>
<Book id= "6" upc= "4" someotherID= "booklist2" salePrice= "4"/>
<Book id= "7" upc= "5" someotherID= "booklist2" salePrice= "5"/>
</BookList>
</AllBooks>
Thanks
Alan
----------------------------------------- The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas -microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @(protected) Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>How do I mege the 2 nodes?<o:p></o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial;font-weight:bold'>INPUT:<o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><AllBooks><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <BookList1><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="1" upc= "1" someotherID= "booklist1" salePrice= "1"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="3" upc= "3" someotherID= "booklist1" salePrice= "3"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="4" upc= "4" someotherID= "booklist1" salePrice= "4"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> </BookList1><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <BookList2><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="2" upc= "2" someotherID= "booklist2" salePrice= "2"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "3" upc= "3" someotherID= "booklist2" salePrice= "3"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "4" upc= "4" someotherID= "booklist2" salePrice= "4"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "5" upc= "5" someotherID= "booklist2" salePrice= "5"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> </BookList2><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'></AllBooks><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial;font-weight:bold'>OUTPUT:<o:p></o:p></span></font></b></p>
<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><AllBooks><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <BookList><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="1" upc= "1" someotherID= "booklist1" salePrice= "1"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="2" upc= "3" someotherID= "booklist1" salePrice= "3"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="3" upc= "4" someotherID= "booklist1" salePrice= "4"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id="4" upc= "2" someotherID= "booklist2" salePrice= "2"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "5" upc= "3" someotherID= "booklist2" salePrice= "3"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "6" upc= "4" someotherID= "booklist2" salePrice= "4"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> <Book id= "7" upc= "5" someotherID= "booklist2" salePrice= "5"/><o:p></o:p>< /span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'> </BookList><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'></AllBooks><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Thanks<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Alan<o:p></o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoNormal><b><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
<HTML><BODY><P><hr size=1></P> <P><STRONG> The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. This message may be an attorney-client communication and/or work product and as such is privileged and confidential. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. </STRONG></P></BODY></HTML>
|
|
 |