Altova Mailing List Archives
>microsoft.public.xml Archive Home
>Thread Prev - RE: How to append/replace a node in DOM created from an xml string?
Re: How to append/replace a node in DOM created from an xml string?
Date: 2/24/2004 12:48:00 AM
Look for .createDocumentFragment. Here's a reference to a previous thread where I posted some VB code to achieve this (I'm not a C coder) - I'm sure you can take the VB and convert to C. http://tinyurl.com/2doot Chris. "Noriko" <anonymous@d...> wrote in message news:8C6078F4-C0A7-481A-9B68-6BDD981512B8@m...... I understand that .NET supports what I'm asking. I'm trying to do this using C++ with MSXML4. ----- Noriko wrote: ----- I need to either replace an existing node or append a new node of which information is already in xml format. The format of the string is <Database Key="1234" Name="DB1" Server="MyServer"> This is the actual connection string</Database> I need to add this node to the existing file if no node has the Key "1234". If the node of which key attribute is 1234, I need to replace the entire node with the given xml string. What's the best way to do that? I have seen examples of creating a new node from scratch, but I'd rather not to parse the existing xml string. I would like to add/replace it as is. Thanks,