changing value of a tag through XML parser
I am new to XML. I want to change the value of a tag in an xml 开发者_开发百科file. I am using Xerces c++ library for this purpose. Can anyone tell me how to do it ?
load the XML document: xmlDoc=loadXMLDoc("temp.xml");
get the tag "tag1" you want to write (first one):DOMNode x=xmlDoc.getElementsByTagName("tag1")[0];
get the value node: DOMNode y=x.childNodes[0];
change the value of this node: y.nodeValue="New Value";
精彩评论