C# Class Sgml.SgmlReader

SgmlReader is an XmlReader API over any SGML document (including built in support for HTML).
Inheritance: XmlReader
Show file Open project: Synergex/Baconography Class Usage Examples

Private Properties

Property Type Description
ExpandEntity void
GetEncoding System.Text.Encoding
Init void
LazyLoadDtd void
Log void
Log void
OpenInput void
ParseAspNet bool
ParseCData bool
ParseComment bool
ParseConditionalBlock bool
ParseDocType void
ParseEndTag bool
ParseMarkup bool
ParsePI bool
ParseStartTag bool
ParseTag bool
ParseText bool
Pop void
Push Node
Push Node
ScanLiteral string
ScanName string
SwapTopNodes void
Top Node
ValidAttributeName bool
Validate void
ValidateAttribute void
ValidateContent void
VerifyName bool
this string

Public Methods

Method Description
GetAttribute ( int i ) : string

Gets the value of the attribute with the specified index.

GetAttribute ( string name ) : string

Gets the value of an attribute with the specified Name.

GetAttribute ( string name, string namespaceURI ) : string

Gets the value of the attribute with the specified LocalName and NamespaceURI.

LookupNamespace ( string prefix ) : string

Resolves a namespace prefix in the current element's scope.

MoveToAttribute ( string name ) : bool

Moves to the atttribute with the specified Name.

MoveToAttribute ( string name, string ns ) : bool

Moves to the attribute with the specified LocalName and NamespaceURI.

MoveToAttribute ( int i ) : void

Moves to the attribute with the specified index.

MoveToElement ( ) : bool

Moves to the element that contains the current attribute node.

MoveToFirstAttribute ( ) : bool

Moves to the first attribute.

MoveToNextAttribute ( ) : bool

Moves to the next attribute.

If the current node is an element node, this method is equivalent to MoveToFirstAttribute. If MoveToNextAttribute returns true, the reader moves to the next attribute; otherwise, the position of the reader does not change.

Read ( ) : bool

Reads the next node from the stream.

ReadAttributeValue ( ) : bool

Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.

ReadInnerXml ( ) : string

Reads all the content, including markup, as a string.

ReadOuterXml ( ) : string

Reads the content, including markup, representing this node and all its children.

ReadString ( ) : string

Reads the contents of an element or text node as a string.

ResolveEntity ( ) : void

Resolves the entity reference for EntityReference nodes.

SetBaseUri ( string uri ) : void

The base Uri is used to resolve relative Uri's like the SystemLiteral and Href properties. This is a method because BaseURI is a read-only property on the base XmlReader class.

SgmlReader ( ) : System

Initialises a new instance of the SgmlReader class.

SgmlReader ( XmlNameTable nt ) : System

Initialises a new instance of the SgmlReader class with an existing XmlNameTable, which is NOT used.

this ( int i ) : string

Gets the value of the attribute with the specified index.

this ( string name ) : string

Gets the value of an attribute with the specified Name.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Changes the ReadState to Closed.

Private Methods

Method Description
ExpandEntity ( StringBuilder sb, char terminator ) : void
GetEncoding ( ) : Encoding
Init ( ) : void
LazyLoadDtd ( Uri baseUri ) : void
Log ( string msg ) : void
Log ( string msg, char ch ) : void
OpenInput ( ) : void
ParseAspNet ( ) : bool
ParseCData ( ) : bool
ParseComment ( ) : bool
ParseConditionalBlock ( ) : bool
ParseDocType ( ) : void
ParseEndTag ( ) : bool
ParseMarkup ( ) : bool
ParsePI ( ) : bool
ParseStartTag ( char ch ) : bool
ParseTag ( char ch ) : bool
ParseText ( char ch, bool newtext ) : bool
Pop ( ) : void
Push ( Node n ) : Node
Push ( string name, System.Xml.XmlNodeType nt, string value ) : Node
ScanLiteral ( StringBuilder sb, char quote ) : string

Consumes and returns a literal block of text, expanding entities as it does so.

This version is slightly different from Entity.ScanLiteral in that it also expands entities.

ScanName ( string terminators ) : string
SwapTopNodes ( ) : void
Top ( ) : Node
ValidAttributeName ( string name ) : bool
Validate ( Node node ) : void
ValidateAttribute ( Node node, Attribute a ) : void
ValidateContent ( Node node ) : void
VerifyName ( string name ) : bool
this ( string name, string namespaceURI ) : string

Method Details

Dispose() protected method

Changes the ReadState to Closed.
protected Dispose ( bool disposing ) : void
disposing bool
return void

GetAttribute() public method

Gets the value of the attribute with the specified index.
public GetAttribute ( int i ) : string
i int The index of the attribute.
return string

GetAttribute() public method

Gets the value of an attribute with the specified Name.
public GetAttribute ( string name ) : string
name string The name of the attribute to retrieve.
return string

GetAttribute() public method

Gets the value of the attribute with the specified LocalName and NamespaceURI.
public GetAttribute ( string name, string namespaceURI ) : string
name string The local name of the attribute.
namespaceURI string The namespace URI of the attribute.
return string

LookupNamespace() public method

Resolves a namespace prefix in the current element's scope.
public LookupNamespace ( string prefix ) : string
prefix string The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string.
return string

MoveToAttribute() public method

Moves to the atttribute with the specified Name.
public MoveToAttribute ( string name ) : bool
name string The qualified name of the attribute.
return bool

MoveToAttribute() public method

Moves to the attribute with the specified LocalName and NamespaceURI.
public MoveToAttribute ( string name, string ns ) : bool
name string The local name of the attribute.
ns string The namespace URI of the attribute.
return bool

MoveToAttribute() public method

Moves to the attribute with the specified index.
public MoveToAttribute ( int i ) : void
i int The index of the attribute to move to.
return void

MoveToElement() public method

Moves to the element that contains the current attribute node.
public MoveToElement ( ) : bool
return bool

MoveToFirstAttribute() public method

Moves to the first attribute.
public MoveToFirstAttribute ( ) : bool
return bool

MoveToNextAttribute() public method

Moves to the next attribute.
If the current node is an element node, this method is equivalent to MoveToFirstAttribute. If MoveToNextAttribute returns true, the reader moves to the next attribute; otherwise, the position of the reader does not change.
public MoveToNextAttribute ( ) : bool
return bool

Read() public method

Reads the next node from the stream.
public Read ( ) : bool
return bool

ReadAttributeValue() public method

Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes.
public ReadAttributeValue ( ) : bool
return bool

ReadInnerXml() public method

Reads all the content, including markup, as a string.
public ReadInnerXml ( ) : string
return string

ReadOuterXml() public method

Reads the content, including markup, representing this node and all its children.
public ReadOuterXml ( ) : string
return string

ReadString() public method

Reads the contents of an element or text node as a string.
public ReadString ( ) : string
return string

ResolveEntity() public method

Resolves the entity reference for EntityReference nodes.
SgmlReader does not resolve or return entities.
public ResolveEntity ( ) : void
return void

SetBaseUri() public method

The base Uri is used to resolve relative Uri's like the SystemLiteral and Href properties. This is a method because BaseURI is a read-only property on the base XmlReader class.
public SetBaseUri ( string uri ) : void
uri string
return void

SgmlReader() public method

Initialises a new instance of the SgmlReader class.
public SgmlReader ( ) : System
return System

SgmlReader() public method

Initialises a new instance of the SgmlReader class with an existing XmlNameTable, which is NOT used.
public SgmlReader ( XmlNameTable nt ) : System
nt System.Xml.XmlNameTable The nametable to use.
return System

this() public method

Gets the value of the attribute with the specified index.
public this ( int i ) : string
i int The index of the attribute.
return string

this() public method

Gets the value of an attribute with the specified Name.
public this ( string name ) : string
name string The name of the attribute to retrieve.
return string