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
|