XPathNavigator.Matches Method (String)

Determines whether the current node matches the specified XPath expression.

Namespace:  System.Xml.XPath
Assembly:  System.Xml (in System.Xml.dll)

public virtual bool Matches(
	string xpath
)

Parameters

xpath
Type: System.String

The XPath expression.

Return Value

Type: System.Boolean
true if the current node matches the specified XPath expression; otherwise, false.

ExceptionCondition
ArgumentException

The XPath expression cannot be evaluated.

XPathException

The XPath expression is not valid.

This method has no affect on the state of the XPathNavigator.

For an example of the Matches method, see the XPathNavigator.Matches method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft