Extensions Class

 

This class contains the LINQ to XML extension methods that enable you to evaluate XPath expressions.

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

System::Object
  System.Xml.XPath::Extensions

[ExtensionAttribute]
public ref class Extensions abstract sealed 

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCreateNavigator(XNode^)

Creates an XPathNavigator for an XNode.

System_CAPS_pubmethodSystem_CAPS_staticCreateNavigator(XNode^, XmlNameTable^)

Creates an XPathNavigator for an XNode. The XmlNameTable enables more efficient XPath expression processing.

System_CAPS_pubmethodSystem_CAPS_staticXPathEvaluate(XNode^, String^)

Evaluates an XPath expression.

System_CAPS_pubmethodSystem_CAPS_staticXPathEvaluate(XNode^, String^, IXmlNamespaceResolver^)

Evaluates an XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.

System_CAPS_pubmethodSystem_CAPS_staticXPathSelectElement(XNode^, String^)

Selects an XElement using a XPath expression.

System_CAPS_pubmethodSystem_CAPS_staticXPathSelectElement(XNode^, String^, IXmlNamespaceResolver^)

Selects an XElement using a XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.

System_CAPS_pubmethodSystem_CAPS_staticXPathSelectElements(XNode^, String^)

Selects a collection of elements using an XPath expression.

System_CAPS_pubmethodSystem_CAPS_staticXPathSelectElements(XNode^, String^, IXmlNamespaceResolver^)

Selects a collection of elements using an XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.

There is some performance penalty for using these methods. Using LINQ to XML queries yields better performance.

Although the ordering of returned collections is not specified in the XML XPath Language 1.0 Recommendation, this extension method returns nodes in document order.

Note that nodes are returned in document order even when you use a reverse axis, such as preceding-sibling or ancestor-or-self.

.NET Framework
Available since 3.5
Silverlight
Available since 4.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: