C# Class MS.Internal.Xml.Cache.XPathDocumentNavigator

This is the default XPath/XQuery data model cache implementation. It will be used whenever the user does not supply his own XPathNavigator implementation.
Inheritance: System.Xml.XPath.XPathNavigator, IXmlLineInfo
Exibir arquivo Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Private Properties

Property Type Description
GetFollowingEnd int
GetPrimaryLocation int
GetSecondaryLocation int

Public Methods

Method Description
Clone ( ) : XPathNavigator

Create a copy of this navigator, positioned to the same node in the tree.

ComparePosition ( XPathNavigator other ) : XmlNodeOrder

Returns: XmlNodeOrder.Unknown -- This navigator and the "other" navigator are not of the same type, or the navigator's are not positioned on nodes in the same document. XmlNodeOrder.Before -- This navigator's current node is before the "other" navigator's current node in document order. XmlNodeOrder.After -- This navigator's current node is after the "other" navigator's current node in document order. XmlNodeOrder.Same -- This navigator is positioned on the same node as the "other" navigator.

GetPositionHashCode ( ) : int

Get hashcode based on current position of the navigator.

HasLineInfo ( ) : bool

Return true if line number information is recorded in the cache.

IsContentKindMatch ( XPathNodeType typ ) : bool

Return true if navigator is positioned to a content node of the specified kind. Whitespace/SignficantWhitespace/Text are all treated the same (i.e. they all match each other).

IsDescendant ( XPathNavigator other ) : bool

Return true if the "other" navigator's current node is a descendant of this navigator's current node.

IsElementMatch ( string localName, string namespaceURI ) : bool

Return true if navigator is positioned to an element having the specified name.

IsKindMatch ( XPathNodeType typ ) : bool

Return true if navigator is positioned to a node of the specified kind. Whitespace/SignficantWhitespace/Text are all treated the same (i.e. they all match each other).

IsSamePosition ( XPathNavigator other ) : bool

Returns true if this navigator is positioned to the same node as the "other" navigator. Returns false if not, or if the "other" navigator is not the same type as this navigator.

MoveTo ( XPathNavigator other ) : bool

Position this navigator to the same position as the "other" navigator. If the "other" navigator is not of the same type as this navigator, then return false.

MoveToAttribute ( string localName, string namespaceURI ) : bool

Position the navigator on the attribute with the specified name and return true. If no matching attribute can be found, return false. Don't assume the name parts are atomized with respect to this document.

MoveToChild ( XPathNodeType type ) : bool

Move to the first content child of the current node with the specified type. Return false if the current node has no matching children.

MoveToChild ( string localName, string namespaceURI ) : bool

Move to the first element child of the current node with the specified name. Return false if the current node has no matching element children.

MoveToFirstAttribute ( ) : bool

Position the navigator on the first attribute of the current node and return true. If no attributes can be found, return false.

MoveToFirstChild ( ) : bool

Move to the first content-typed child of the current node. Return false if the current node has no content children.

MoveToFirstNamespace ( XPathNamespaceScope namespaceScope ) : bool

Position the navigator on the namespace within the specified scope. If no matching namespace can be found, return false.

MoveToFollowing ( XPathNodeType type, XPathNavigator end ) : bool

Move to the next node that: 1. Follows the current node in document order (includes descendants, unlike XPath following axis) 2. Precedes "end" in document order (if end is null, then all following nodes in the document are considered) 3. Has the specified XPathNodeType Return false if the current node has no matching following nodes.

MoveToFollowing ( string localName, string namespaceURI, XPathNavigator end ) : bool

Move to the next element that: 1. Follows the current node in document order (includes descendants, unlike XPath following axis) 2. Precedes "end" in document order (if end is null, then all following nodes in the document are considered) 3. Has the specified QName Return false if the current node has no matching following elements.

MoveToId ( string id ) : bool

Position to the navigator to the element whose id is equal to the specified "id" string.

MoveToNext ( ) : bool

If the current node is an attribute or namespace (not content), return false. Otherwise, move to the next content node. Return false if there are no more content nodes.

MoveToNext ( XPathNodeType type ) : bool

Move to the first content sibling of the current node with the specified type. Return false if the current node has no matching siblings.

MoveToNext ( string localName, string namespaceURI ) : bool

Move to the first element sibling of the current node with the specified name. Return false if the current node has no matching element siblings.

MoveToNextAttribute ( ) : bool

If positioned on an attribute, move to its next sibling attribute. If no attributes can be found, return false.

MoveToNextNamespace ( XPathNamespaceScope scope ) : bool

Position the navigator on the next namespace within the specified scope. If no matching namespace can be found, return false.

MoveToParent ( ) : bool

Position the navigator on the parent of the current node. If the current node has no parent, return false.

MoveToPrevious ( ) : bool

If the current node is an attribute or namespace (not content), return false. Otherwise, move to the previous (sibling) content node. Return false if there are no previous content nodes.

MoveToRoot ( ) : void

Position the navigator on the root node of the current document.

SelectChildren ( XPathNodeType type ) : XPathNodeIterator

Return an iterator that ranges over all children of the current node that match the specified XPathNodeType.

SelectChildren ( string name, string namespaceURI ) : XPathNodeIterator

Return an iterator that ranges over all children of the current node that match the specified QName.

SelectDescendants ( XPathNodeType type, bool matchSelf ) : XPathNodeIterator

Return an iterator that ranges over all descendants of the current node that match the specified XPathNodeType. If matchSelf is true, then also perform the match on the current node.

SelectDescendants ( string name, string namespaceURI, bool matchSelf ) : XPathNodeIterator

Return an iterator that ranges over all descendants of the current node that match the specified QName. If matchSelf is true, then also perform the match on the current node.

XPathDocumentNavigator ( XPathDocumentNavigator nav ) : System

Copy constructor.

XPathDocumentNavigator ( XPathNode pageCurrent, int idxCurrent, XPathNode pageParent, int idxParent ) : System

Create a new navigator positioned on the specified current node. If the current node is a namespace or a collapsed text node, then the parent is a virtualized parent (may be different than .Parent on the current node).

Private Methods

Method Description
GetFollowingEnd ( XPathDocumentNavigator end, bool useParentOfVirtual, XPathNode &pageEnd ) : int

"end" is positioned on a node which terminates a following scan. Return the page and index of "end" if it is positioned to a non-virtual node. If "end" is positioned to a virtual node: 1. If useParentOfVirtual is true, then return the page and index of the virtual node's parent 2. If useParentOfVirtual is false, then return the page and index of the virtual node's parent + 1.

GetPrimaryLocation ( ) : int

Construct a primary location for this navigator. The location is an integer that can be easily compared with other locations in the same document in order to determine the relative document order of two nodes. If two locations compare equal, then secondary locations should be compared.

GetSecondaryLocation ( ) : int

Construct a secondary location for this navigator. This location should only be used if primary locations previously compared equal.

Method Details

Clone() public method

Create a copy of this navigator, positioned to the same node in the tree.
public Clone ( ) : XPathNavigator
return System.Xml.XPath.XPathNavigator

ComparePosition() public method

Returns: XmlNodeOrder.Unknown -- This navigator and the "other" navigator are not of the same type, or the navigator's are not positioned on nodes in the same document. XmlNodeOrder.Before -- This navigator's current node is before the "other" navigator's current node in document order. XmlNodeOrder.After -- This navigator's current node is after the "other" navigator's current node in document order. XmlNodeOrder.Same -- This navigator is positioned on the same node as the "other" navigator.
public ComparePosition ( XPathNavigator other ) : XmlNodeOrder
other System.Xml.XPath.XPathNavigator
return XmlNodeOrder

GetPositionHashCode() public method

Get hashcode based on current position of the navigator.
public GetPositionHashCode ( ) : int
return int

HasLineInfo() public method

Return true if line number information is recorded in the cache.
public HasLineInfo ( ) : bool
return bool

IsContentKindMatch() public method

Return true if navigator is positioned to a content node of the specified kind. Whitespace/SignficantWhitespace/Text are all treated the same (i.e. they all match each other).
public IsContentKindMatch ( XPathNodeType typ ) : bool
typ XPathNodeType
return bool

IsDescendant() public method

Return true if the "other" navigator's current node is a descendant of this navigator's current node.
public IsDescendant ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator
return bool

IsElementMatch() public method

Return true if navigator is positioned to an element having the specified name.
public IsElementMatch ( string localName, string namespaceURI ) : bool
localName string
namespaceURI string
return bool

IsKindMatch() public method

Return true if navigator is positioned to a node of the specified kind. Whitespace/SignficantWhitespace/Text are all treated the same (i.e. they all match each other).
public IsKindMatch ( XPathNodeType typ ) : bool
typ XPathNodeType
return bool

IsSamePosition() public method

Returns true if this navigator is positioned to the same node as the "other" navigator. Returns false if not, or if the "other" navigator is not the same type as this navigator.
public IsSamePosition ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator
return bool

MoveTo() public method

Position this navigator to the same position as the "other" navigator. If the "other" navigator is not of the same type as this navigator, then return false.
public MoveTo ( XPathNavigator other ) : bool
other System.Xml.XPath.XPathNavigator
return bool

MoveToAttribute() public method

Position the navigator on the attribute with the specified name and return true. If no matching attribute can be found, return false. Don't assume the name parts are atomized with respect to this document.
public MoveToAttribute ( string localName, string namespaceURI ) : bool
localName string
namespaceURI string
return bool

MoveToChild() public method

Move to the first content child of the current node with the specified type. Return false if the current node has no matching children.
public MoveToChild ( XPathNodeType type ) : bool
type XPathNodeType
return bool

MoveToChild() public method

Move to the first element child of the current node with the specified name. Return false if the current node has no matching element children.
public MoveToChild ( string localName, string namespaceURI ) : bool
localName string
namespaceURI string
return bool

MoveToFirstAttribute() public method

Position the navigator on the first attribute of the current node and return true. If no attributes can be found, return false.
public MoveToFirstAttribute ( ) : bool
return bool

MoveToFirstChild() public method

Move to the first content-typed child of the current node. Return false if the current node has no content children.
public MoveToFirstChild ( ) : bool
return bool

MoveToFirstNamespace() public method

Position the navigator on the namespace within the specified scope. If no matching namespace can be found, return false.
public MoveToFirstNamespace ( XPathNamespaceScope namespaceScope ) : bool
namespaceScope XPathNamespaceScope
return bool

MoveToFollowing() public method

Move to the next node that: 1. Follows the current node in document order (includes descendants, unlike XPath following axis) 2. Precedes "end" in document order (if end is null, then all following nodes in the document are considered) 3. Has the specified XPathNodeType Return false if the current node has no matching following nodes.
public MoveToFollowing ( XPathNodeType type, XPathNavigator end ) : bool
type XPathNodeType
end System.Xml.XPath.XPathNavigator
return bool

MoveToFollowing() public method

Move to the next element that: 1. Follows the current node in document order (includes descendants, unlike XPath following axis) 2. Precedes "end" in document order (if end is null, then all following nodes in the document are considered) 3. Has the specified QName Return false if the current node has no matching following elements.
public MoveToFollowing ( string localName, string namespaceURI, XPathNavigator end ) : bool
localName string
namespaceURI string
end System.Xml.XPath.XPathNavigator
return bool

MoveToId() public method

Position to the navigator to the element whose id is equal to the specified "id" string.
public MoveToId ( string id ) : bool
id string
return bool

MoveToNext() public method

If the current node is an attribute or namespace (not content), return false. Otherwise, move to the next content node. Return false if there are no more content nodes.
public MoveToNext ( ) : bool
return bool

MoveToNext() public method

Move to the first content sibling of the current node with the specified type. Return false if the current node has no matching siblings.
public MoveToNext ( XPathNodeType type ) : bool
type XPathNodeType
return bool

MoveToNext() public method

Move to the first element sibling of the current node with the specified name. Return false if the current node has no matching element siblings.
public MoveToNext ( string localName, string namespaceURI ) : bool
localName string
namespaceURI string
return bool

MoveToNextAttribute() public method

If positioned on an attribute, move to its next sibling attribute. If no attributes can be found, return false.
public MoveToNextAttribute ( ) : bool
return bool

MoveToNextNamespace() public method

Position the navigator on the next namespace within the specified scope. If no matching namespace can be found, return false.
public MoveToNextNamespace ( XPathNamespaceScope scope ) : bool
scope XPathNamespaceScope
return bool

MoveToParent() public method

Position the navigator on the parent of the current node. If the current node has no parent, return false.
public MoveToParent ( ) : bool
return bool

MoveToPrevious() public method

If the current node is an attribute or namespace (not content), return false. Otherwise, move to the previous (sibling) content node. Return false if there are no previous content nodes.
public MoveToPrevious ( ) : bool
return bool

MoveToRoot() public method

Position the navigator on the root node of the current document.
public MoveToRoot ( ) : void
return void

SelectChildren() public method

Return an iterator that ranges over all children of the current node that match the specified XPathNodeType.
public SelectChildren ( XPathNodeType type ) : XPathNodeIterator
type XPathNodeType
return System.Xml.XPath.XPathNodeIterator

SelectChildren() public method

Return an iterator that ranges over all children of the current node that match the specified QName.
public SelectChildren ( string name, string namespaceURI ) : XPathNodeIterator
name string
namespaceURI string
return System.Xml.XPath.XPathNodeIterator

SelectDescendants() public method

Return an iterator that ranges over all descendants of the current node that match the specified XPathNodeType. If matchSelf is true, then also perform the match on the current node.
public SelectDescendants ( XPathNodeType type, bool matchSelf ) : XPathNodeIterator
type XPathNodeType
matchSelf bool
return System.Xml.XPath.XPathNodeIterator

SelectDescendants() public method

Return an iterator that ranges over all descendants of the current node that match the specified QName. If matchSelf is true, then also perform the match on the current node.
public SelectDescendants ( string name, string namespaceURI, bool matchSelf ) : XPathNodeIterator
name string
namespaceURI string
matchSelf bool
return System.Xml.XPath.XPathNodeIterator

XPathDocumentNavigator() public method

Copy constructor.
public XPathDocumentNavigator ( XPathDocumentNavigator nav ) : System
nav XPathDocumentNavigator
return System

XPathDocumentNavigator() public method

Create a new navigator positioned on the specified current node. If the current node is a namespace or a collapsed text node, then the parent is a virtualized parent (may be different than .Parent on the current node).
public XPathDocumentNavigator ( XPathNode pageCurrent, int idxCurrent, XPathNode pageParent, int idxParent ) : System
pageCurrent XPathNode
idxCurrent int
pageParent XPathNode
idxParent int
return System