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

Implementation of XmlRawWriter that builds nodes in an XPathDocument.
Inheritance: System.Xml.XmlRawWriter
显示文件 Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Signals the end of tree construction.

CreateIdTables ( SchemaInfo schInfo ) : void

Build ID lookup tables from the XSD schema or DTD.

Flush ( ) : void

Since output is not forwarded to another object, this does nothing.

Initialize ( XPathDocument doc, IXmlLineInfo lineInfo, string baseUri, XPathDocument flags ) : void

Start construction of a new document. This must be called before any other methods are called. It may also be called after Close(), in order to build further documents.

WriteCData ( string text ) : void

Map CData text into regular text.

WriteCharEntity ( char ch ) : void

Don't entitize, since the cache cannot represent character entities.

WriteChars ( char buffer, int index, int count ) : void
WriteComment ( string text ) : void

Construct comment node.

WriteDocType ( string name, string pubid, string sysid, string subset ) : void

XPathDocument ignores the DocType information.

WriteEndAttribute ( ) : void

Attach the attribute's text or typed value to the previously constructed attribute node.

WriteEndElement ( ) : void

Must be called when an element node's children have been fully enumerated.

WriteEndElement ( bool allowShortcutTag ) : void

Must be called when an element node's children have been fully enumerated.

WriteEntityRef ( string name ) : void

Cache does not handle entity references.

WriteFullEndElement ( ) : void

Must be called when an element node's children have been fully enumerated.

WriteProcessingInstruction ( string name, string text ) : void

Shortcut for calling WriteProcessingInstruction with baseUri = string.Empty.

WriteProcessingInstruction ( string name, string text, string baseUri ) : void

Construct pi node.

WriteRaw ( char buffer, int index, int count ) : void
WriteRaw ( string data ) : void

Map RawText to Text. This will lose entitization and won't roundtrip.

WriteStartAttribute ( string prefix, string localName, string namespaceName ) : void

Shortcut for calling WriteStartAttribute with attrfType == null.

WriteStartElement ( string prefix, string localName, string ns ) : void

Shortcut for calling WriteStartElement with elemType == null.

WriteStartElement ( string prefix, string localName, string ns, string baseUri ) : void

Build an element node and attach it to its parent, if one exists. Make the element the new parent node.

WriteString ( string text ) : void

Write an attribute or element text block.

WriteString ( string text, TextBlockType textType ) : void

Write an element text block with the specified text type (whitespace, significant whitespace, or text).

WriteSurrogateCharEntity ( char lowChar, char highChar ) : void

Don't entitize, since the cache cannot represent character entities.

WriteWhitespace ( string ws ) : void

Write a whitespace text block.

XPathDocumentBuilder ( XPathDocument doc, IXmlLineInfo lineInfo, string baseUri, XPathDocument flags ) : System

Create a new XPathDocumentBuilder which creates nodes in "doc".

Private Methods

Method Description
AddSibling ( XPathNodeType xptyp, string localName, string namespaceUri, string prefix, string baseUri ) : void

Add a sibling node. If no previous sibling exists, add the node as the first child of the parent. If no parent exists, make this node the root of the document.

CachedTextNode ( ) : void

Creates a text node from cached text parts.

ComputeLineInfo ( bool isTextNode, int &lineNumOffset, int &linePosOffset ) : void

Compute current node's line number information.

LinkSimilarElements ( XPathNode pagePrev, int idxPrev, XPathNode pageNext, int idxNext ) : XPathNodeRef

Link "prev" element with "next" element, which has a "similar" name. This increases the performance of searches by element name.

NewNamespaceNode ( XPathNode &page, string prefix, string namespaceUri, XPathNode pageElem, int idxElem ) : int

Helper method that constructs a new Namespace XPathNode.

NewNode ( XPathNode &page, XPathNodeType xptyp, string localName, string namespaceUri, string prefix, string baseUri ) : int

Helper method that constructs a new XPathNode.

StartElementContent ( ) : void

Called as element node's children are about to be enumerated.

WriteEndElement ( string prefix, string localName, string namespaceName ) : void

Must be called when an element node's children have been fully enumerated.

WriteFullEndElement ( string prefix, string localName, string namespaceName ) : void

Must be called when an element node's children have been fully enumerated.

WriteNamespaceDeclaration ( string prefix, string namespaceName ) : void

Build a namespace declaration node. Attach it to an element parent, if one was previously constructed. All namespace declarations are linked together in an in-scope namespace tree.

WriteXmlDeclaration ( XmlStandalone standalone ) : void

Write the xml declaration. This must be the first call after Open.

WriteXmlDeclaration ( string xmldecl ) : void

Method Details

Close() public method

Signals the end of tree construction.
public Close ( ) : void
return void

CreateIdTables() public method

Build ID lookup tables from the XSD schema or DTD.
public CreateIdTables ( SchemaInfo schInfo ) : void
schInfo System.Xml.Schema.SchemaInfo
return void

Flush() public method

Since output is not forwarded to another object, this does nothing.
public Flush ( ) : void
return void

Initialize() public method

Start construction of a new document. This must be called before any other methods are called. It may also be called after Close(), in order to build further documents.
public Initialize ( XPathDocument doc, IXmlLineInfo lineInfo, string baseUri, XPathDocument flags ) : void
doc System.Xml.XPath.XPathDocument
lineInfo IXmlLineInfo
baseUri string
flags System.Xml.XPath.XPathDocument
return void

WriteCData() public method

Map CData text into regular text.
public WriteCData ( string text ) : void
text string
return void

WriteCharEntity() public method

Don't entitize, since the cache cannot represent character entities.
public WriteCharEntity ( char ch ) : void
ch char
return void

WriteChars() public method

public WriteChars ( char buffer, int index, int count ) : void
buffer char
index int
count int
return void

WriteComment() public method

Construct comment node.
public WriteComment ( string text ) : void
text string
return void

WriteDocType() public method

XPathDocument ignores the DocType information.
public WriteDocType ( string name, string pubid, string sysid, string subset ) : void
name string
pubid string
sysid string
subset string
return void

WriteEndAttribute() public method

Attach the attribute's text or typed value to the previously constructed attribute node.
public WriteEndAttribute ( ) : void
return void

WriteEndElement() public method

Must be called when an element node's children have been fully enumerated.
public WriteEndElement ( ) : void
return void

WriteEndElement() public method

Must be called when an element node's children have been fully enumerated.
public WriteEndElement ( bool allowShortcutTag ) : void
allowShortcutTag bool
return void

WriteEntityRef() public method

Cache does not handle entity references.
public WriteEntityRef ( string name ) : void
name string
return void

WriteFullEndElement() public method

Must be called when an element node's children have been fully enumerated.
public WriteFullEndElement ( ) : void
return void

WriteProcessingInstruction() public method

Shortcut for calling WriteProcessingInstruction with baseUri = string.Empty.
public WriteProcessingInstruction ( string name, string text ) : void
name string
text string
return void

WriteProcessingInstruction() public method

Construct pi node.
public WriteProcessingInstruction ( string name, string text, string baseUri ) : void
name string
text string
baseUri string
return void

WriteRaw() public method

public WriteRaw ( char buffer, int index, int count ) : void
buffer char
index int
count int
return void

WriteRaw() public method

Map RawText to Text. This will lose entitization and won't roundtrip.
public WriteRaw ( string data ) : void
data string
return void

WriteStartAttribute() public method

Shortcut for calling WriteStartAttribute with attrfType == null.
public WriteStartAttribute ( string prefix, string localName, string namespaceName ) : void
prefix string
localName string
namespaceName string
return void

WriteStartElement() public method

Shortcut for calling WriteStartElement with elemType == null.
public WriteStartElement ( string prefix, string localName, string ns ) : void
prefix string
localName string
ns string
return void

WriteStartElement() public method

Build an element node and attach it to its parent, if one exists. Make the element the new parent node.
public WriteStartElement ( string prefix, string localName, string ns, string baseUri ) : void
prefix string
localName string
ns string
baseUri string
return void

WriteString() public method

Write an attribute or element text block.
public WriteString ( string text ) : void
text string
return void

WriteString() public method

Write an element text block with the specified text type (whitespace, significant whitespace, or text).
public WriteString ( string text, TextBlockType textType ) : void
text string
textType TextBlockType
return void

WriteSurrogateCharEntity() public method

Don't entitize, since the cache cannot represent character entities.
public WriteSurrogateCharEntity ( char lowChar, char highChar ) : void
lowChar char
highChar char
return void

WriteWhitespace() public method

Write a whitespace text block.
public WriteWhitespace ( string ws ) : void
ws string
return void

XPathDocumentBuilder() public method

Create a new XPathDocumentBuilder which creates nodes in "doc".
public XPathDocumentBuilder ( XPathDocument doc, IXmlLineInfo lineInfo, string baseUri, XPathDocument flags ) : System
doc System.Xml.XPath.XPathDocument
lineInfo IXmlLineInfo
baseUri string
flags System.Xml.XPath.XPathDocument
return System