Executes an X-Path query on the passed handle (either document or node) and returns the first resulting node handle. If the query returns no handles, XmlSelectSingleNode returns 0. For a detailed description of X-Path, check the specification at http://www.w3c.org. The root node for the query is the passed node/document handle.
XmlAPI.bdh
XmlSelectSingleNode( in hDocNode : number, in sQuery : string ): number;
node handle if successful
0 otherwise
Parameter | Description |
---|---|
hDocNode | A valid document or node handle |
sQuery | X-Path query that will be executed on the handle that is passed. |
dcltrans transaction TMain var hDocument, hResult, hItem : number; sAttrValue : string; begin hDocument := XmlCreateDocumentFromFile("C:\\MyXMLDocuments\\Order.xml"); hItem := XmlSelectSingleNode(hDocument, "//OrderItem[1]"); XmlGetAttributeByName(hItem, "price", sAttrValue); end TMain;