Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Combine multiple XmlDocument(s) [Thread Next] Re: Combine multiple XmlDocument(s)To: NULL Date: 5/5/2007 9:09:00 AM "Craig Buchanan" <someone@m...> wrote in message news:OlAx1EqjHHA.3656@T...... >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? You might consider using an XmlWriter. -- John Saunders [MVP] | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
