XmlCreateNodeFromXml Function

Action

Creates an XML node from a string that contains a valid XML representation of an XML node.

The string can also contain complex nodes with child nodes, e.g.: <cars><car>BMW</car><car>Volvo</car></cars>

Include file

XmlAPI.bdh

Syntax

XmlCreateNodeFromXml( in sXmlString : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sXmlString Valid XML string

Example

dcltrans
  transaction TMain
  var 
  hDocument, hResult, hNewNode : number;
  begin
    hDocument := XmlCreateDocumentFromXml( "<root><child1 attr1='avalue1'>childvalue1</child1>"
                 "<child2 attr1= 'avalue2'>childvalue2</child2></root>");
    hNewNode := XmlCreateNodeFromXml("<child3 attr1='avalue3'>childvalue3</child3>");
    hResult := XmlSelectSingleNode(hDocument, "/root");
    XmlAppendChild (hResult, hNewNode);
  end TMain;