C# Class Mvp.Xml.Common.XPath.DynamicContext

Provides the evaluation context for fast execution and custom variables resolution.
This class is responsible for resolving variables during dynamic expression execution.

Discussed in http://weblogs.asp.net/cazzu/archive/2003/10/07/30888.aspx

Author: Daniel Cazzulino, blog

Inheritance: System.Xml.Xsl.XsltContext
Afficher le fichier Open project: Monobjc/monobjc-tools Class Usage Examples

Méthodes publiques

Méthode Description
AddVariable ( string name, object value ) : void

Adds the variable to the dynamic evaluation context.

Value type conversion for XPath evaluation is as follows: CLR Type XPath type System.String XPathResultType.String System.Double (or types that can be converted to) XPathResultType.Number System.Boolean XPathResultType.Boolean System.Xml.XPath.XPathNavigator XPathResultType.Navigator System.Xml.XPath.XPathNodeIterator XPathResultType.NodeSet Others XPathResultType.Any See the topic "Compile, Select, Evaluate, and Matches with XPath and XPathExpressions" in MSDN documentation for additional information.

CompareDocument ( string baseUri, string nextbaseUri ) : int

Implementation equal to XsltContext.

Compile ( string xpath ) : XPathExpression

Shortcut method that compiles an expression using an empty navigator.

DynamicContext ( ) : System

Initializes a new instance of the DynamicContext class.

DynamicContext ( NameTable table ) : System

Initializes a new instance of the DynamicContext class with the specified NameTable.

DynamicContext ( XmlNamespaceManager context ) : System

Initializes a new instance of the DynamicContext class.

DynamicContext ( XmlNamespaceManager context, NameTable table ) : System

Initializes a new instance of the DynamicContext class.

LookupNamespace ( string prefix ) : string

Same as XmlNamespaceManager.

LookupPrefix ( string uri ) : string

Same as XmlNamespaceManager.

PreserveWhitespace ( XPathNavigator node ) : bool

Same as XsltContext.

ResolveFunction ( string prefix, string name, XPathResultType ArgTypes ) : IXsltContextFunction

See XsltContext. Not used in our implementation.

ResolveVariable ( string prefix, string name ) : IXsltContextVariable

Resolves the dynamic variables added to the context. See XsltContext.

Method Details

AddVariable() public méthode

Adds the variable to the dynamic evaluation context.
Value type conversion for XPath evaluation is as follows: CLR Type XPath type System.String XPathResultType.String System.Double (or types that can be converted to) XPathResultType.Number System.Boolean XPathResultType.Boolean System.Xml.XPath.XPathNavigator XPathResultType.Navigator System.Xml.XPath.XPathNodeIterator XPathResultType.NodeSet Others XPathResultType.Any See the topic "Compile, Select, Evaluate, and Matches with XPath and XPathExpressions" in MSDN documentation for additional information.
The is null.
public AddVariable ( string name, object value ) : void
name string The name of the variable to add to the context.
value object The value of the variable to add to the context.
Résultat void

CompareDocument() public méthode

Implementation equal to XsltContext.
public CompareDocument ( string baseUri, string nextbaseUri ) : int
baseUri string
nextbaseUri string
Résultat int

Compile() public static méthode

Shortcut method that compiles an expression using an empty navigator.
public static Compile ( string xpath ) : XPathExpression
xpath string The expression to compile
Résultat System.Xml.XPath.XPathExpression

DynamicContext() public méthode

Initializes a new instance of the DynamicContext class.
public DynamicContext ( ) : System
Résultat System

DynamicContext() public méthode

Initializes a new instance of the DynamicContext class with the specified NameTable.
public DynamicContext ( NameTable table ) : System
table System.Xml.NameTable The NameTable to use.
Résultat System

DynamicContext() public méthode

Initializes a new instance of the DynamicContext class.
public DynamicContext ( XmlNamespaceManager context ) : System
context System.Xml.XmlNamespaceManager A previously filled context with the namespaces to use.
Résultat System

DynamicContext() public méthode

Initializes a new instance of the DynamicContext class.
public DynamicContext ( XmlNamespaceManager context, NameTable table ) : System
context System.Xml.XmlNamespaceManager A previously filled context with the namespaces to use.
table System.Xml.NameTable The NameTable to use.
Résultat System

LookupNamespace() public méthode

Same as XmlNamespaceManager.
public LookupNamespace ( string prefix ) : string
prefix string
Résultat string

LookupPrefix() public méthode

Same as XmlNamespaceManager.
public LookupPrefix ( string uri ) : string
uri string
Résultat string

PreserveWhitespace() public méthode

Same as XsltContext.
public PreserveWhitespace ( XPathNavigator node ) : bool
node System.Xml.XPath.XPathNavigator
Résultat bool

ResolveFunction() public méthode

See XsltContext. Not used in our implementation.
public ResolveFunction ( string prefix, string name, XPathResultType ArgTypes ) : IXsltContextFunction
prefix string
name string
ArgTypes XPathResultType
Résultat IXsltContextFunction

ResolveVariable() public méthode

Resolves the dynamic variables added to the context. See XsltContext.
public ResolveVariable ( string prefix, string name ) : IXsltContextVariable
prefix string
name string
Résultat IXsltContextVariable