NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlNavigator.Matches

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;

Parameters

xpathexpr
An XPath expression describing how to navigate. This can be a string or an object returned from the Compile method.

Return Value

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']")

Exceptions

Exception Type Condition
ArgumentException The specified expression cannot be evaluated this way.

Remarks

This has no effect on the state of the tree or the current selection.

See Also

XmlNavigator Class | XmlNavigator Members | System.NewXml Namespace