Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

XMLGetAttributeCount

  • Last UpdatedJul 18, 2023
  • 1 minute read

Gets number of attribute of specified XML node.

Syntax

INT XMLGetAttributeCount(INT hDoc, INT hNode)

hDoc

Handle of the XML document. Returned by or XMLOpen.

hNode

Handle of the node. Returned by XMLGetRoot, XMLGetChild, XMLGetParent or XMLNodeFind.

Return Value

Number of attribute of specified node.

XMLClose, XMLCreate, XMLGetAttribute, XMLGetAttributeName, XMLGetAttributeValue, XMLGetChild, XMLGetChildCount, XMLGetParent, XMLGetRoot, XMLNodeAddChild, XMLNodeFind, XMLNodeGetName, XMLNodeGetValue, XMLNodeRemove, XMLNodeSetValue, XMLOpen, XMLSave, XMLSetAttribute

Example

Following example creates an XML document from local file "H:\Data\books.xml", then selects the first node that matches XPath expression "/bookstore/book/", then gets number of attribute of the node.

INT hDoc, hNode;

INT nCount;

hDoc=XMLOpen("H:\Data\books.xml");

IF hDoc <> -1 THEN

hNode = XMLNodeFind(hDoc,"/bookstore/book/");

IF hDoc <> -1 THEN

nCount=XMLGetAttributeCount(hDoc,hNode);

End

End

See Also

XML Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in