XPath Matches and XPathNavigator
The Matches method takes an XSLT pattern as input, and returns a Boolean that indicates if the current node matches the given XPathExpression or compiled XPathExpression. For example, nav.Matches("b[@c]")
will return true if the current node is the element b
, and has an attribute called c
. Calling Matches does not change the state of the XPathNavigator.
See Also
XPathNavigator in the .NET Framework | XPath Select and XPathNavigator | XPath Evaluate and XPathNavigator