Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Xml.​XPath.​XPathExpression

Assembly: System.Xml.ReaderWriter

Inheritance: object → XPathExpression

Provides a typed class that represents a compiled XPath expression.

Properties

public string
Expression
When overridden in a derived class, gets a <see langword="string" /> representation of the <see cref="T:System.Xml.XPath.XPathExpression" /> .
ReturnType
When overridden in a derived class, gets the result type of the XPath expression.

Methods

public void
AddSort​(object expr, Collections.​IComparer comparer)
When overridden in a derived class, sorts the nodes selected by the XPath expression according to the specified <see cref="T:System.Collections.IComparer" /> object.
expr An object representing the sort key. This can be the <see langword="string" /> value of the node or an <see cref="T:System.Xml.XPath.XPathExpression" /> object with a compiled XPath expression.
comparer An <see cref="T:System.Collections.IComparer" /> object that provides the specific data type comparisons for comparing two objects for equivalence.
public void
AddSort​(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType)
When overridden in a derived class, sorts the nodes selected by the XPath expression according to the supplied parameters.
expr An object representing the sort key. This can be the <see langword="string" /> value of the node or an <see cref="T:System.Xml.XPath.XPathExpression" /> object with a compiled XPath expression.
order An <see cref="T:System.Xml.XPath.XmlSortOrder" /> value indicating the sort order.
caseOrder An <see cref="T:System.Xml.XPath.XmlCaseOrder" /> value indicating how to sort uppercase and lowercase letters.
lang The language to use for comparison. Uses the <see cref="T:System.Globalization.CultureInfo" /> class that can be passed to the <see cref="Overload:System.String.Compare" /> method for the language types, for example, "us-en" for U.S. English. If an empty string is specified, the system environment is used to determine the <see cref="T:System.Globalization.CultureInfo" /> .
dataType An <see cref="T:System.Xml.XPath.XmlDataType" /> value indicating the sort order for the data type.
Clone​()
When overridden in a derived class, returns a clone of this <see cref="T:System.Xml.XPath.XPathExpression" /> .
Returns A new <see cref="T:System.Xml.XPath.XPathExpression" /> object.
public static XPathExpression
Compile​(string xpath)
Compiles the XPath expression specified and returns an <see cref="T:System.Xml.XPath.XPathExpression" /> object representing the XPath expression.
Returns An <see cref="T:System.Xml.XPath.XPathExpression" /> object.
xpath An XPath expression.
public static XPathExpression
Compile​(string xpath, IXmlNamespaceResolver? nsResolver)
Compiles the specified XPath expression, with the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object specified for namespace resolution, and returns an <see cref="T:System.Xml.XPath.XPathExpression" /> object that represents the XPath expression.
Returns An <see cref="T:System.Xml.XPath.XPathExpression" /> object.
xpath An XPath expression.
nsResolver An object that implements the <see cref="T:System.Xml.IXmlNamespaceResolver" /> interface for namespace resolution.
public void
SetContext​(IXmlNamespaceResolver nsResolver)
When overridden in a derived class, specifies the <see cref="T:System.Xml.IXmlNamespaceResolver" /> object to use for namespace resolution.
nsResolver An object that implements the <see cref="T:System.Xml.IXmlNamespaceResolver" /> interface to use for namespace resolution.
public void
SetContext​(XmlNamespaceManager nsManager)
When overridden in a derived class, specifies the <see cref="T:System.Xml.XmlNamespaceManager" /> object to use for namespace resolution.
nsManager An <see cref="T:System.Xml.XmlNamespaceManager" /> object to use for namespace resolution.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object