XmlSetNodeValue Function

Action

Sets the text value of the passed node. Use XmlGetNodeValue to retrieve the current text value of a node.

Include file

XmlAPI.bdh

Syntax

XmlSetNodeValue (in hNode     : number,
                 in sNewValue : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hNode Handle to an XML node
sNewValue New node value

Example

dcltrans
  transaction TMain
  var 
    hDocument, hResult : number;
  begin
    hDocument := XmlCreateDocumentFromXml( "<root><child1 attr1='avalue1'>childvalue1</child1>"
                "<child2 attr1= 'avalue2'>childvalue2</child2></root>");
    hResult := XmlSelectSingleNode(hDocument, "/root/child2"); 
    XmlSetNodeValue(hResult, "newchildvalue2");
  end TMain;