XPath Property
Provides a way to point to a specific element in the document.
Syntax
char* GetXPath();
int SetXPath(char* lpszXPath);
Default Value
""
Remarks
XPath implements a subset of the XML XPath specification, allowing you to point to specific elements in the XML response.
The path is a series of one or more element accessors separated by '/'. The path can be absolute (starting with '/') or relative to the current XPath location.
The following are possible values for an element accessor:
'name' | A particular element name. |
[i] | The i-th subelement of the current element. |
.. | the parent of the current element. |
When XPath is set to a valid path, XElement points to the name of the element, with XChildren and XText providing other properties of the element.
Example (Setting XPath)
<p></p><center><table
class
=
"table"
><tbody><tr style=
"display: none;"
><td></td><td></td></tr><tr><td style=
"white-space:nowrap"
> Document root </td><td>QBObjectControl.XPath =
"/"
</td></tr><tr><td style=
"white-space:nowrap"
> Specific Element </td><td>QBObjectControl.XPath =
"/root/SubElement1/SubElement2/"
</td></tr><tr><td style=
"white-space:nowrap"
> i-th Child </td><td>QBObjectControl.XPath =
"/root/[i]"
</td></tr></tbody></table></center><p></p>
You may use the HasXPath method to determine if an xpath exists before setting the XPath property.
This property is not available at design time.
Data Type
String