开发者

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";

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜