Export (0) Print
Expand All

Extensions Class

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

System.Object
  System.Xml.XPath.Extensions

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

public static class Extensions

  NameDescription
Public methodStatic memberCreateNavigator(XNode)Creates an XPathNavigator for an XNode.
Public methodStatic memberCreateNavigator(XNode, XmlNameTable)Creates an XPathNavigator for an XNode. The XmlNameTable enables more efficient XPath expression processing.
Public methodStatic memberXPathEvaluate(XNode, String)Evaluates an XPath expression.
Public methodStatic memberXPathEvaluate(XNode, String, IXmlNamespaceResolver)Evaluates an XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.
Public methodStatic memberXPathSelectElement(XNode, String)Selects an XElement using a XPath expression.
Public methodStatic memberXPathSelectElement(XNode, String, IXmlNamespaceResolver)Selects an XElement using a XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.
Public methodStatic memberXPathSelectElements(XNode, String)Selects a collection of elements using an XPath expression.
Public methodStatic memberXPathSelectElements(XNode, String, IXmlNamespaceResolver)Selects a collection of elements using an XPath expression, resolving namespace prefixes using the specified IXmlNamespaceResolver.
Top

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

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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