Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

XMLNodeSetValue

  • Last UpdatedJul 18, 2023
  • 1 minute read

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.

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

XML Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in