XmlGetNodeType Function

Action

Returns the type of the node passed as paramter. For a description of all possible node types please see the constant definitions in the XmlAPI.bdh file.

Include file

XmlAPI.bdh

Syntax

XmlGetNodeType( in hNode: number ): number;

Return value

  • type of node

Parameter Description
hNode Handle to an XML node

Example

dcltrans
  transaction TMain
  var 
    hDocument, hResult, nType: number;
  begin
    hDocument := XmlCreateDocumentFromXml("<root><child1 attr1='avalue1'>childvalue1</child1>"
                                        "<child2 attr1=  'avalue2'>childvalue2</child2></root>");
    hResult := XmlSelectSingleNode(hDocument, "/root");
    nType := XmlGetNodeType(hResult);
    
    if(nType = XMLNODE_ELEMENT) then
      writeln("Root node is of type ELEMENT");
    end;

    if(nType = XMLNODE_TEXT) then
      writeln("Root node is of type TEXT");
    end;
  end TMain;