Sets the value of the specified node.
Syntax
INT XMLNodeSetValue(INT hDoc, INT hNode, STRING sValue)
hDoc
Handle of the XML document the parent node belongs to. Returned by XMLCreate or XMLOpen.
hNode
Handle of the node. Returned by XMLGetRoot, XMLGetChild, XMLGetParent, XMLNodeFind.
sValue
Value of the element node.
Return Value
0 (zero) if successful, otherwise an error code is returned.
Related Functions
XMLClose, XMLCreate, XMLGetAttribute, XMLGetAttributeCount, XMLGetAttributeName, XMLGetAttributeValue, XMLGetChild, XMLGetChildCount, XMLGetParent, XMLGetRoot, XMLNodeAddChild, XMLNodeFind, XMLNodeGetName, XMLNodeGetValue, XMLNodeRemove, XMLOpen, XMLSave, XMLSetAttribute
Example
The following example creates an XML document from local file "H:\Data\books.xml", then selects the first node that matches XPath expression "/bookstore/book/title" and sets the node’s value to "Harry Potter".
INT hDoc, hNode; hDoc = XMLOpen("H:\Data\books.xml"); IF hDoc <> -1 THEN hNode=XMLNodeFind(hDoc,"/bookstore/book/title"); IF hNode <>-1 THEN XMLNodeSetValue(hDoc,hNode,"Harry Potter"); End End
See Also
Published June 2018