XmlGetAttributeCount Function

Action

Returns the number of attributes that are defined for the passed node. You can afterwards access the attribute values with XmlGetAttributeByIndex.

Include file

XmlAPI.bdh

Syntax

XmlGetAttributeCount( in hNode : number ): number;

Return value

  • number of attributes

Parameter Description
hNode Handle to an XML node

Example

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