XmlGetCount takes a nodelist handle and returns the number of nodes that are stored in this list. A nodelist will be returned by XmlGetChildNodes and XmlSelectNodes. To access a node in the nodelist call XmlGetItem.
XmlAPI.bdh
XmlGetCount( in hNodeList : number ): number;
number of nodes
Parameter | Description |
---|---|
hNodeList | A valid node list handle |
dcltrans transaction TMain var hDocument, hResult : number; hOrderItems, hItem : number; hCount, itemIx : number; sAttrValue : string; begin hDocument := XmlCreateDocumentFromFile("C:\\MyXMLDocuments\\Order.xml"); hOrderItems := XmlSelectNodes(hDocument, "//OrderItem"); hCount := XmlGetCount(hOrderItems); for itemIx := 0 to hCount - 1 do hItem := XmlGetItem(hOrderItems, itemIx); XmlGetAttributeByName(hItem, "price", sAttrValue); end; end TMain;