Determines whether the current node matches the specified XPath expression
[Visual Basic] Overridable Public Function Matches( _ ByVal xpathexpr As Object _ ) As Boolean [C#] public virtual bool Matches( object xpathexpr ); [C++] public: virtual bool Matches( Object* xpathexpr ); [JScript] public function Matches( xpathexpr : Object ) : Boolean;
true if the current node matches the specified XPath expression; otherwise, false.
The following example will return true if the parent of the current node has an attribute called "color" with the value "red".
[C#]
nav.Matches("..[attribute::color = 'red']")
Exception Type | Condition |
---|---|
ArgumentException | The specified expression cannot be evaluated this way. |
This has no effect on the state of the tree or the current selection.
XmlNavigator Class | XmlNavigator Members | System.NewXml Namespace