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

Implements a cache of XPath queries, for faster execution.
Discussed at http://weblogs.asp.net/cazzu/archive/2004/04/02/106667.aspx

Author: Daniel Cazzulino, blog

Mostrar archivo Open project: Monobjc/monobjc-tools

Private Properties

Property Type Description
GetCompiledExpression System.Xml.XPath.XPathExpression
PrepareContext System.Xml.XmlNamespaceManager
PrepareSort void
PrepareSort void
PrepareSort void
PrepareSort void

Public Methods

Method Description
Evaluate ( string expression, XPathNavigator source ) : object

Evaluates the given expression and returns the typed result.

Evaluate ( string expression, XPathNavigator source, XmlNamespaceManager context ) : object

Evaluates the given expression and returns the typed result.

Evaluate ( string expression, XPathNavigator source, XmlPrefix prefixes ) : object

Evaluates the given expression and returns the typed result.

Select ( string expression, XPathNavigator source ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

Select ( string expression, XPathNavigator source, XmlNamespaceManager context ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

Select ( string expression, XPathNavigator source, XmlPrefix prefixes ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

SelectNodes ( string expression, XmlNode source ) : XmlNodeList

Selects a list of nodes matching the XPath expression.

SelectNodes ( string expression, XmlNode source, XmlNamespaceManager context ) : XmlNodeList

Selects a list of nodes matching the XPath expression.

SelectNodes ( string expression, XmlNode source, XmlPrefix prefixes ) : XmlNodeList

Selects a list of nodes matching the XPath expression.

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer ) : XmlNodeList

Selects a node set using the specified XPath expression and sort.

See XPathExpression.AddSort(object, IComparer).

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer, XmlNamespaceManager context ) : XmlNodeList

Selects a node set using the specified XPath expression.

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer, XmlPrefix prefixes ) : XmlNodeList

Selects a node set using the specified XPath expression.

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) : XmlNodeList

Selects a node set using the specified XPath expression and sort.

(object, IComparer) See XPathExpression.AddSort(object, IComparer).

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlNamespaceManager context ) : XmlNodeList

Selects a node set using the specified XPath expression.

SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlPrefix prefixes ) : XmlNodeList

Selects a node set using the specified XPath expression.

SelectSingleNode ( string expression, XmlNode source ) : XmlNode

Selects the first XmlNode that matches the XPath expression.

SelectSingleNode ( string expression, XmlNode source, XmlNamespaceManager context ) : XmlNode

Selects the first XmlNode that matches the XPath expression.

SelectSingleNode ( string expression, XmlNode source, XmlPrefix prefixes ) : XmlNode

Selects the first XmlNode that matches the XPath expression.

SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer ) : XPathNodeIterator

Selects a node set using the specified XPath expression and sort.

See XPathExpression.AddSort(object, IComparer).

SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer, XmlNamespaceManager context ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer, XmlPrefix prefixes ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) : XPathNodeIterator

Selects a node set using the specified XPath expression and sort.

See XPathExpression.AddSort(object, IComparer).

SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlNamespaceManager context ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlPrefix prefixes ) : XPathNodeIterator

Selects a node set using the specified XPath expression.

Private Methods

Method Description
GetCompiledExpression ( string expression, XPathNavigator source ) : XPathExpression

Retrieves a cached compiled expression, or a newly compiled one.

PrepareContext ( XPathNavigator source, XmlNamespaceManager context, XmlPrefix prefixes, XPathVariable variables ) : XmlNamespaceManager

Sets up the context for expression execution.

PrepareSort ( XPathExpression expression, XPathNavigator source, object sortExpression, IComparer comparer ) : void
PrepareSort ( XPathExpression expression, XPathNavigator source, object sortExpression, IComparer comparer, XmlNamespaceManager context ) : void
PrepareSort ( XPathExpression expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) : void
PrepareSort ( XPathExpression expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlNamespaceManager context ) : void

Method Details

Evaluate() public static method

Evaluates the given expression and returns the typed result.
public static Evaluate ( string expression, XPathNavigator source ) : object
expression string
source System.Xml.XPath.XPathNavigator
return object

Evaluate() public static method

Evaluates the given expression and returns the typed result.
public static Evaluate ( string expression, XPathNavigator source, XmlNamespaceManager context ) : object
expression string
source System.Xml.XPath.XPathNavigator
context System.Xml.XmlNamespaceManager
return object

Evaluate() public static method

Evaluates the given expression and returns the typed result.
public static Evaluate ( string expression, XPathNavigator source, XmlPrefix prefixes ) : object
expression string
source System.Xml.XPath.XPathNavigator
prefixes XmlPrefix
return object

Select() public static method

Selects a node set using the specified XPath expression.
public static Select ( string expression, XPathNavigator source ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
return System.Xml.XPath.XPathNodeIterator

Select() public static method

Selects a node set using the specified XPath expression.
public static Select ( string expression, XPathNavigator source, XmlNamespaceManager context ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
context System.Xml.XmlNamespaceManager
return System.Xml.XPath.XPathNodeIterator

Select() public static method

Selects a node set using the specified XPath expression.
public static Select ( string expression, XPathNavigator source, XmlPrefix prefixes ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
prefixes XmlPrefix
return System.Xml.XPath.XPathNodeIterator

SelectNodes() public static method

Selects a list of nodes matching the XPath expression.
public static SelectNodes ( string expression, XmlNode source ) : XmlNodeList
expression string
source System.Xml.XmlNode
return System.Xml.XmlNodeList

SelectNodes() public static method

Selects a list of nodes matching the XPath expression.
public static SelectNodes ( string expression, XmlNode source, XmlNamespaceManager context ) : XmlNodeList
expression string
source System.Xml.XmlNode
context System.Xml.XmlNamespaceManager
return System.Xml.XmlNodeList

SelectNodes() public static method

Selects a list of nodes matching the XPath expression.
public static SelectNodes ( string expression, XmlNode source, XmlPrefix prefixes ) : XmlNodeList
expression string
source System.Xml.XmlNode
prefixes XmlPrefix
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression and sort.
See XPathExpression.AddSort(object, IComparer).
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
comparer IComparer
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer, XmlNamespaceManager context ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
comparer IComparer
context System.Xml.XmlNamespaceManager
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, IComparer comparer, XmlPrefix prefixes ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
comparer IComparer
prefixes XmlPrefix
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression and sort.
(object, IComparer) See XPathExpression.AddSort(object, IComparer).
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlNamespaceManager context ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
context System.Xml.XmlNamespaceManager
return System.Xml.XmlNodeList

SelectNodesSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectNodesSorted ( string expression, XmlNode source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlPrefix prefixes ) : XmlNodeList
expression string
source System.Xml.XmlNode
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
prefixes XmlPrefix
return System.Xml.XmlNodeList

SelectSingleNode() public static method

Selects the first XmlNode that matches the XPath expression.
public static SelectSingleNode ( string expression, XmlNode source ) : XmlNode
expression string
source System.Xml.XmlNode
return System.Xml.XmlNode

SelectSingleNode() public static method

Selects the first XmlNode that matches the XPath expression.
public static SelectSingleNode ( string expression, XmlNode source, XmlNamespaceManager context ) : XmlNode
expression string
source System.Xml.XmlNode
context System.Xml.XmlNamespaceManager
return System.Xml.XmlNode

SelectSingleNode() public static method

Selects the first XmlNode that matches the XPath expression.
public static SelectSingleNode ( string expression, XmlNode source, XmlPrefix prefixes ) : XmlNode
expression string
source System.Xml.XmlNode
prefixes XmlPrefix
return System.Xml.XmlNode

SelectSorted() public static method

Selects a node set using the specified XPath expression and sort.
See XPathExpression.AddSort(object, IComparer).
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
comparer IComparer
return System.Xml.XPath.XPathNodeIterator

SelectSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer, XmlNamespaceManager context ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
comparer IComparer
context System.Xml.XmlNamespaceManager
return System.Xml.XPath.XPathNodeIterator

SelectSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, IComparer comparer, XmlPrefix prefixes ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
comparer IComparer
prefixes XmlPrefix
return System.Xml.XPath.XPathNodeIterator

SelectSorted() public static method

Selects a node set using the specified XPath expression and sort.
See XPathExpression.AddSort(object, IComparer).
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
return System.Xml.XPath.XPathNodeIterator

SelectSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlNamespaceManager context ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
context System.Xml.XmlNamespaceManager
return System.Xml.XPath.XPathNodeIterator

SelectSorted() public static method

Selects a node set using the specified XPath expression.
public static SelectSorted ( string expression, XPathNavigator source, object sortExpression, XmlSortOrder order, XmlCaseOrder caseOrder, string lang, XmlDataType dataType, XmlPrefix prefixes ) : XPathNodeIterator
expression string
source System.Xml.XPath.XPathNavigator
sortExpression object
order XmlSortOrder
caseOrder XmlCaseOrder
lang string
dataType XmlDataType
prefixes XmlPrefix
return System.Xml.XPath.XPathNodeIterator