C# Класс 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

Наследование: System.Xml.Xsl.XsltContext
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

AddVariable() публичный Метод

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.
Результат void

CompareDocument() публичный Метод

Implementation equal to XsltContext.
public CompareDocument ( string baseUri, string nextbaseUri ) : int
baseUri string
nextbaseUri string
Результат int

Compile() публичный статический Метод

Shortcut method that compiles an expression using an empty navigator.
public static Compile ( string xpath ) : XPathExpression
xpath string The expression to compile
Результат System.Xml.XPath.XPathExpression

DynamicContext() публичный Метод

Initializes a new instance of the DynamicContext class.
public DynamicContext ( ) : System
Результат System

DynamicContext() публичный Метод

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.
Результат System

DynamicContext() публичный Метод

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.
Результат System

DynamicContext() публичный Метод

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.
Результат System

LookupNamespace() публичный Метод

Same as XmlNamespaceManager.
public LookupNamespace ( string prefix ) : string
prefix string
Результат string

LookupPrefix() публичный Метод

Same as XmlNamespaceManager.
public LookupPrefix ( string uri ) : string
uri string
Результат string

PreserveWhitespace() публичный Метод

Same as XsltContext.
public PreserveWhitespace ( XPathNavigator node ) : bool
node System.Xml.XPath.XPathNavigator
Результат bool

ResolveFunction() публичный Метод

See XsltContext. Not used in our implementation.
public ResolveFunction ( string prefix, string name, XPathResultType ArgTypes ) : IXsltContextFunction
prefix string
name string
ArgTypes XPathResultType
Результат IXsltContextFunction

ResolveVariable() публичный Метод

Resolves the dynamic variables added to the context. See XsltContext.
public ResolveVariable ( string prefix, string name ) : IXsltContextVariable
prefix string
name string
Результат IXsltContextVariable