Where each small XmlDocument is..
Using the following .NET approach to copy and merge many small XmlDocuments into one new big XmlDocument..
Results in a big XmlDocument that looks like this..
Every element was appended and every tag closed, but the heirachy is a disaster.
What is a better way of copying small documents into a big document?
--Glen
Memoria mihi benigna erit qui eam perscribam
Code:
<root>
<memberA></memberA>
<memberB></memberB>
</root>
Using the following .NET approach to copy and merge many small XmlDocuments into one new big XmlDocument..
Code:
XmlDocument big = new XmlDocument();
big.LoadXml("<example></example>");
List<XmlDocument> myXmlDocumentList = new List<XmlDocument>();
// lets assume we populated this list with lots of small XmlDocuments
foreach(XmlDocument small in myXmlDocumentList){
big.DocumentElement.AppendChild(big.ImportNode(small.DocumentElement, true));
}
Results in a big XmlDocument that looks like this..
Code:
<example>
<root>
<memberA></memberA>
<memberB></memberB>
<root>
<memberA></memberA>
<memberB><root>
<memberA></memberA>
<memberB></memberB>
</root></memberB>
</root>
</root>
</example>
Every element was appended and every tag closed, but the heirachy is a disaster.
What is a better way of copying small documents into a big document?
--Glen
Memoria mihi benigna erit qui eam perscribam