So that explains why it works if there is only one element, as it would be the root element.
I’m trying to graft in some elements into another xml document.
In my last version I was only trying to graft in one element now I’m trying to graft in two at a time.
So each must be a root element.
Can I create nodes from strings, and append them to an xml document?
something like:
[quote]
dim xnode1 as new XMLNode("
dim xnode2 as new XMLNode("
dim xdoc as new XMLDocument(" ")
xdoc.FirstChild.AppendChild(xnode1)
xdoc.FirstChild.AppendChild(xnode2)[/quote]
No. AFAIK, you cannot use a “normal” style (“NEW”) constructor to create elements. You must instead us one of the “.Create…” functions on the XMLDocument object itself. You could, of course, create a text representation of your XML document, and then use the “LoadXML” method of the XMLDocument, but that wouldn’t be very wise, I would think.
I have nodes within my config file that I’m trying to update…
Nodes come in groups of two. (now, before they were just single xml nodes, but I thought I could put the two nodes into one xml document and then append the elements in groups of two.)