XPath (property)
Provides a way to point to a specific element in the document.
Syntax
@property (nonatomic,readwrite,assign,getter=XPath,setter=setXPath:) NSString* XPath; - (NSString*)XPath; - (void)setXPath:(NSString*)newXPath;
public var XPath: String { get {...}
set {...} }
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, starting at index 1. |
.. | the parent of the current element. |
Example (Setting XPath)
Document root QBObjectControl.XPath = "/" Specific Element QBObjectControl.XPath = "/root/SubElement1/SubElement2/" i-th Child QBObjectControl.XPath = "/root/[i]"
You may use the HasXPath method to determine if an xpath exists before setting the XPath property.