Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2003, 09:33 PM
Authorized User
 
Join Date: Sep 2003
Location: , , Singapore.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default merge 2 xml documents

Hi

Apart from using dataset to merge 2 xml documents, is there any other way to merge 2 similar xml documents.
Because when i get an error message when I am using dataset to merge the xml documents.

This is the code i am using.

XmlTextReader xmlreader1 = new XmlTextReader("Menu1.xml");
XmlTextReader xmlreader2 = new XmlTextReader("Menu2.xml");

DataSet ds2 = new DataSet();
ds2.ReadXml(xmlreader2);
DataSet ds = new DataSet();
ds.ReadXml(xmlreader1);
ds.Merge(ds2);

The error is
"The table (subMenu) cannot be the child table to itself in nested relations."

this is the sample xml document which i am using..
<Menu>
<menuItem>
<text>Menu_Welcome</text>
<subMenu>
<menuItem>
<text>Equipment Tracking</text>
<url>/IDEALview/default.aspx?_PageIndex=0</url>
</menuItem>
</subMenu>
</menuItem>
</Menu>

When i remove the submenu tag, i dont get this error. But I am forced to use this tag/format because the server control which i am given uses this submenu tag to identify if it is a sub menu.

Kindly help.
Thanks
Beulah




Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge PDF Documents Gyto ASP.NET 2.0 Basics 3 August 19th, 2013 02:33 AM
How to merge two xml documents together? NewToXSL Pro VB.NET 2002/2003 2 August 22nd, 2008 05:28 AM
compare two xml documents bcogney XSLT 1 October 30th, 2006 03:33 PM
merge two xml file and make new xml using xslt ketan XSLT 0 September 21st, 2004 08:48 AM
Merge XML files into a xml file using xslt lxu XML 4 November 6th, 2003 06:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.