Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Combine multiple XmlDocument(s) Combine multiple XmlDocument(s)To: NULL Date: 5/4/2007 6:09:00 PM
I have one or more Xml.XmlDocuments that result from Xslt processing. Each
document will resemble:
<Entities>
<Entity/>
...
</Entities>
This is my current approach:
...
Dim XmlDocuments As New ArrayList
For Each uri As Uri In UriArray
'retrieve websites as Xhtml; returns a XmlDocument
XmlDocuments.Add(getXhtml(uri))
Next
'process the 2nd thru the Nth XmlDocument
For i As Integer = 1 To XmlDocuments.Count - 1
'process the <Entity/> nodes
For Each child As XmlNode In XmlDocuments(i).DocumentElement.ChildNodes
'add node to 1st XmlDocument
XmlDocuments(0).DocumentElement.AppendChild(XmlDocuments(0).ImportNode(child,
True))
Next
Next
'return 1st XmlDocument
Return XmlDocuments(0)
...
Is there a more-efficient way to do this? For bonus points, is there a way
to sort the <Entity/> elements based on an attribute's value?
Thanks,
Craig Buchanan
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
