Hi,

I'm porting a VB 6 app to .Net, and wanted to use an XMLDataDocument to
store information that had previously been kept in XML Recordsets.

Unfortunately, I'm not too familiar yet with .Net's XML Namespace and
was wondering if someone could help with something....in the VB 6
application, we would append two extra nodes to the XMLRecordset-- an error
message, and error number. Then, when it came time to reconstruct the
recordset we'd remove those nodes and go to it.

I'd like to do the same thing in .Net, but I'm not sure how to append
new nodes to existing XMLDataDocuments, nor how to search for and remove the
two nodes when the time comes. I've been reading over the msdn docs but was
hoping someone could point me in the right direction, or even paste a little
code on how to create and append nodes to an XMLDataDocument, and how to
search for particular nodes and remove them? Thanks very much.

-Jim

Re: XMLDataDocument question-- appending/removing nodes by Alex

Alex
Sun Oct 03 16:50:30 CDT 2004

There are at least a couple of ways. You can use the XML DOM methods, such
as InsertAfter:

objDoc.InsertAfter(objInsertedNode, objExistingNode)

or you can just set the InnerXml property of a node:

objNode.InnerXml = "<LongCode>" & strNewValue & "</LongCode><ShortCode>" _
& strShortCode & "</ShortCode>"

This example demonstrates both techniques:
http://www.daveandal.net/books/8900/08_to_11_Data_Management/data05/edit-xml.aspx