|
-
September 27th, 2004, 01:41 AM
#1
Generating XML Document using VC++
Hi everyone,
I have already posted many questions on XMLDOM using VC++.But i didnot get any answers to read a particular node or text in a XML Document.And also I need to read some of the items in the XML Document which i have alreay loaded with the LOAD Function and i Need to generate a new XML Document.In that Document i need to insert the items which i have readed from the old XML Document.Please anyone send me the sample codings for the above application.I kindly request you to send the reply.Thanks in advance.
-
May 18th, 2006, 09:30 AM
#2
Re: Generating XML Document using VC++
i hope this helps
MSXML2::IXMLDOMDocumentPtr iXMLDoc;
... read the xml file into iXMLDoc ....
iXMLDoc->save("newName.xml");
to modify the text value of the nodes:
MSXML2::IXMLDOMNodeListPtr plistanodos;
MSXML2::IXMLDOMNodePtr pNodo;
....
plistanodos=iXMLDoc->selectNodes("/NameOfXMLroot/NameOfLevel1\NaveOfLevel2"); // list of the child nodes at level /NameOfXMLroot/NameOf.... in the XML file
for(i=0;i<plistanodos->length;i++)
{
plistanodos->get_item(i,&pNodo); // pNode has the i-th node of the list
pNodo->put_text("modifyed value"); // modifying i-th node text <NameOfLevel2>text to be modified </NameOfLevel2>
}
-
May 19th, 2006, 12:51 AM
#3
Re: Generating XML Document using VC++
Take a look at XML. You'll find some solutions there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|