[This is preliminary documentation and is subject to change.]
Find an SifElement given an XPath-like query string.
| C# | Visual Basic | Visual C++ |
public Element LookupByXPath( SifDataObject relativeTo, string query )
Public Function LookupByXPath ( _ relativeTo As SifDataObject, _ query As String _ ) As Element
public: Element^ LookupByXPath ( SifDataObject^ relativeTo, String^ query )
- relativeTo (SifDataObject)
- A SifDataObject to which the query is relative to.
- query (String)
- An XPath-like query string as described above
The Element satisfying the query, or null if no
match was found. If the query resolves to an attribute, a SimpleField
object is returned. If the query resolves to an element, a SifElement
object is returned. In both cases the caller can obtain the text
value of the attribute or element by calling its TextValue
property.
Query strings can only take one of these forms:
- @Attr
- Element
- Element/@Attr
- Element/Element/.../@Attr
- Element[@Attr='value1']
- Element[@Attr1='value1',@Attr2='value2',...]/Element/...