C# Класс MS.Internal.Xml.Cache.XPathNode

Implementation of a Node in the XPath/XQuery data model. 1. All nodes are stored in variable-size pages (max 65536 nodes/page) of XPathNode structuSR. 2. Pages are sequentially numbered. Nodes are allocated in strict document order. 3. Node references take the form of a (page, index) pair. 4. Each node explicitly stores a parent and a sibling reference. 5. If a node has one or more attributes and/or non-collapsed content children, then its first child is stored in the next slot. If the node is in the last slot of a page, then its first child is stored in the first slot of the next page. 6. Attributes are linked together at the start of the child list. 7. Namespaces are allocated in totally separate pages. Elements are associated with declared namespaces via a hashtable map in the document. 8. Name parts are always non-null (string.Empty for nodes without names) 9. XPathNodeInfoAtom contains all information that is common to many nodes in a document, and therefore is atomized to save space. This includes the document, the name, the child, sibling, parent, and value pages, and the schema type. 10. The node structure is 20 bytes in length. Out-of-line overhead is typically 2-4 bytes per node.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Create ( XPathNodeInfoAtom info, XPathNodeType xptyp, int idxParent ) : void

Constructs a XPathNode. Later, the idxSibling and value fields may be fixed up.

Create ( XPathNodePageInfo pageInfo ) : void

Constructs the 0th XPathNode in each page, which contains only page information.

ElementMatch ( string localName, string namespaceName ) : bool

Returns true if this is an Element node with a name that matches the specified localName and namespaceName. Assume that localName has been atomized, but namespaceName has not.

GetParent ( XPathNode &pageNode ) : int

Returns the parent of this node. If this node has no parent, then 0 is returned.

GetRoot ( XPathNode &pageNode ) : int

Returns the root node of the current document. This always succeeds.

GetSibling ( XPathNode &pageNode ) : int

Returns the next sibling of this node. If this node has no next sibling, then 0 is returned.

GetSimilarElement ( XPathNode &pageNode ) : int

Returns the next element in document order that has the same local name hashcode as this element. If there are no similar elements, then 0 is returned.

NameMatch ( string localName, string namespaceName ) : bool

Returns true if this node's name matches the specified localName and namespaceName. Assume that localName has been atomized, but namespaceName has not.

SetCollapsedLineInfoOffset ( int posOffset ) : void

Set the position offset of this element's collapsed text.

SetCollapsedValue ( string value ) : void

Create a collapsed text node on this element having the specified value.

SetEmptyValue ( bool allowShortcutTag ) : void

Create an empty element value.

SetLineInfoOffsets ( int lineNumOffset, int linePosOffset ) : void

Set this node's line number information.

SetParentProperties ( XPathNodeType xptyp ) : void

This method is called when a new child is appended to this node's list of attributes and children. The type of the new child is used to determine how various parent properties should be set.

SetSibling ( XPathNodeInfoTable infoTable, XPathNode pageSibling, int idxSibling ) : void

Link this node to its next sibling. If "pageSibling" is different than the one stored in the InfoAtom, re-atomize.

SetSimilarElement ( XPathNodeInfoTable infoTable, XPathNode pageSimilar, int idxSimilar ) : void

Link this element to the next element in document order that shares a local name having the same hash code. If "pageSimilar" is different than the one stored in the InfoAtom, re-atomize.

SetValue ( string value ) : void

Set this node's value.

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

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

Constructs a XPathNode. Later, the idxSibling and value fields may be fixed up.
public Create ( XPathNodeInfoAtom info, XPathNodeType xptyp, int idxParent ) : void
info XPathNodeInfoAtom
xptyp XPathNodeType
idxParent int
Результат void

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

Constructs the 0th XPathNode in each page, which contains only page information.
public Create ( XPathNodePageInfo pageInfo ) : void
pageInfo XPathNodePageInfo
Результат void

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

Returns true if this is an Element node with a name that matches the specified localName and namespaceName. Assume that localName has been atomized, but namespaceName has not.
public ElementMatch ( string localName, string namespaceName ) : bool
localName string
namespaceName string
Результат bool

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

Returns the parent of this node. If this node has no parent, then 0 is returned.
public GetParent ( XPathNode &pageNode ) : int
pageNode XPathNode
Результат int

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

Returns the root node of the current document. This always succeeds.
public GetRoot ( XPathNode &pageNode ) : int
pageNode XPathNode
Результат int

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

Returns the next sibling of this node. If this node has no next sibling, then 0 is returned.
public GetSibling ( XPathNode &pageNode ) : int
pageNode XPathNode
Результат int

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

Returns the next element in document order that has the same local name hashcode as this element. If there are no similar elements, then 0 is returned.
public GetSimilarElement ( XPathNode &pageNode ) : int
pageNode XPathNode
Результат int

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

Returns true if this node's name matches the specified localName and namespaceName. Assume that localName has been atomized, but namespaceName has not.
public NameMatch ( string localName, string namespaceName ) : bool
localName string
namespaceName string
Результат bool

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

Set the position offset of this element's collapsed text.
public SetCollapsedLineInfoOffset ( int posOffset ) : void
posOffset int
Результат void

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

Create a collapsed text node on this element having the specified value.
public SetCollapsedValue ( string value ) : void
value string
Результат void

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

Create an empty element value.
public SetEmptyValue ( bool allowShortcutTag ) : void
allowShortcutTag bool
Результат void

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

Set this node's line number information.
public SetLineInfoOffsets ( int lineNumOffset, int linePosOffset ) : void
lineNumOffset int
linePosOffset int
Результат void

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

This method is called when a new child is appended to this node's list of attributes and children. The type of the new child is used to determine how various parent properties should be set.
public SetParentProperties ( XPathNodeType xptyp ) : void
xptyp XPathNodeType
Результат void

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

Link this node to its next sibling. If "pageSibling" is different than the one stored in the InfoAtom, re-atomize.
public SetSibling ( XPathNodeInfoTable infoTable, XPathNode pageSibling, int idxSibling ) : void
infoTable XPathNodeInfoTable
pageSibling XPathNode
idxSibling int
Результат void

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

Link this element to the next element in document order that shares a local name having the same hash code. If "pageSimilar" is different than the one stored in the InfoAtom, re-atomize.
public SetSimilarElement ( XPathNodeInfoTable infoTable, XPathNode pageSimilar, int idxSimilar ) : void
infoTable XPathNodeInfoTable
pageSimilar XPathNode
idxSimilar int
Результат void

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

Set this node's value.
public SetValue ( string value ) : void
value string
Результат void