mscorlib(4.0.0.0) API with additions
XPathExpression.cs
1 using MS.Internal.Xml.XPath;
2 using System.Collections;
3 
4 namespace System.Xml.XPath
5 {
7  public abstract class XPathExpression
8  {
11  public abstract string Expression
12  {
13  get;
14  }
15 
18  public abstract XPathResultType ReturnType
19  {
20  get;
21  }
22 
23  internal XPathExpression()
24  {
25  }
26 
31  public abstract void AddSort(object expr, IComparer comparer);
32 
40  public abstract void AddSort(object expr, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType);
41 
44  public abstract XPathExpression Clone();
45 
49  public abstract void SetContext(XmlNamespaceManager nsManager);
50 
54  public abstract void SetContext(IXmlNamespaceResolver nsResolver);
55 
61  public static XPathExpression Compile(string xpath)
62  {
63  return Compile(xpath, null);
64  }
65 
72  public static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver)
73  {
74  bool needContext;
75  Query query = new QueryBuilder().Build(xpath, out needContext);
76  CompiledXpathExpr compiledXpathExpr = new CompiledXpathExpr(query, xpath, needContext);
77  if (nsResolver != null)
78  {
79  compiledXpathExpr.SetContext(nsResolver);
80  }
81  return compiledXpathExpr;
82  }
83 
84  private void PrintQuery(XmlWriter w)
85  {
86  ((CompiledXpathExpr)this).QueryTree.PrintQuery(w);
87  }
88  }
89 }
XmlSortOrder
Specifies the sort order.
Definition: XmlSortOrder.cs:4
abstract XPathResultType ReturnType
When overridden in a derived class, gets the result type of the XPath expression.
Definition: __Canon.cs:3
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Definition: XmlWriter.cs:12
abstract string Expression
When overridden in a derived class, gets a string representation of the T:System.Xml....
abstract void SetContext(XmlNamespaceManager nsManager)
When overridden in a derived class, specifies the T:System.Xml.XmlNamespaceManager object to use for ...
Provides a typed class that represents a compiled XPath expression.
Resolves, adds, and removes namespaces to a collection and provides scope management for these namesp...
Exposes a method that compares two objects.
Definition: IComparer.cs:8
abstract XPathExpression Clone()
When overridden in a derived class, returns a clone of this T:System.Xml.XPath.XPathExpression.
static XPathExpression Compile(string xpath)
Compiles the XPath expression specified and returns an T:System.Xml.XPath.XPathExpression object repr...
static XPathExpression Compile(string xpath, IXmlNamespaceResolver nsResolver)
Compiles the specified XPath expression, with the T:System.Xml.IXmlNamespaceResolver object specified...
XmlDataType
Specifies the data type used to determine sort order.
Definition: XmlDataType.cs:4
abstract void AddSort(object expr, IComparer comparer)
When overridden in a derived class, sorts the nodes selected by the XPath expression according to the...
XmlCaseOrder
Specifies the sort order for uppercase and lowercase letters.
Definition: XmlCaseOrder.cs:4
XPathResultType
Specifies the return type of the XPath expression.
Provides read-only access to a set of prefix and namespace mappings.
The P:System.Uri.Query data.