XmlGetXml Function

Action

Returns the XML representation of the passed node/document handle. Ensure that the string buffer is large enough to hold the XML. If you pass a document handle you get the XML representation of the whole document. If you pass a node handle, you will get the representation of the whole node (with all child nodes).

Include file

XmlAPI.bdh

Syntax

XmlGetXml( in    hDocNode   : number,
           inout sXmlString : string,
           in    nMaxXmlLen : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hDocNode A valid node/document handle.
sXmlString String variable that receives the XML representation.
nMaxXmlLen Maximum length of the string to return (optional). If this parameter is omitted or set to STRING_COMPLETE all available data is stored in sXmlString.

Example

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