XmlNode

Description

abstract class Tinman.Core.Xml.XmlNode

Derived from

PsiNode abstract
IEquatable<XmlNode>
ICopyable<XmlNode>
ICodeOutput

Extended by

XmlChar sealed
XmlData sealed
XmlDocument sealed
XmlNodeWithParent abstract
XmlSpace sealed
XmlText sealed

Abstract base class for XML document model nodes.

All XmlNode classes output parsable XML source code via the ICodeOutput interface, where object.ToString delegates to ICodeOutput.ToSourceCode1, using default parameters values.

Public / Methods

As­Element


[Pure]
public virtual method AsElement → (1)

name opt : string = null

The XML element name (see XmlElement.Name) or null for any element.

returns → XmlElement

this if it is an XmlElement of the given name opt, otherwise null.

Casts this XML node to an XML element, if possible.

To­Attribute


[Pure]
public virtual method ToAttribute → (1)

name in : XmlName

See XmlAttribute.Name.

returns → XmlAttribute

The wrapping XmlAttribute or null if this node cannot be wrapped.

Wraps this node in a XmlAttribute.

To­Document


[Pure]
public virtual method ToDocument → (2)

name opt : XmlName = default(XmlName)

See XmlDocument.Name.

preamble opt : bool = false

true to warp in XmlDocument.Preamble,
false to warp in XmlDocument.Content.

returns → XmlDocument

The wrapping XmlDocument or null if this node cannot be wrapped.

Wraps this node in a XmlDocument.

To­Element


[Pure]
public virtual method ToElement → (1)

name in : XmlName

See XmlElement.Name.

returns → XmlElement

The wrapping XmlElement or null if this node cannot be wrapped.

Wraps this node in a XmlElement.

To­Literal


[Pure]
public virtual method ToLiteral → ()

returns → XmlLiteral

The XmlLiteral or null if none.

Wraps this node in a XmlLiteral or extracts the contained one.

To­Stream


public abstract method ToStream → (1)

stream in : IXmlStream

[not-null]
The output stream.

Writes the content of this XML node to the given stream in.

IOException

If an I/O error has occurred.

To­Text

2 overloads


public method ToText1 → ()

returns → string

The text content.

Returns the text content of this XML node.


[EmptyBody]
public virtual method ToText2 → (1)

sb in : StringBuilder

[not-null]
The output to use.

Returns the text content of this XML node.

Public / Attributes

Is­Document­Content


[Constant]
public virtual attribute IsDocumentContent → (get)

value : bool

true if this XML node (and all items of the same type) may appear in the document content,
false if it may not.

Can this XML node appear in the top-level document content?

The following XML nodes are document content:

Is­Document­Preamble


[Constant]
public virtual attribute IsDocumentPreamble → (get)

value : bool

true if this XML node (and all items of the same type) may appear in the document preamble,
false if it may not.

Can this XML node appear in the top-level document preamble?

The following XML nodes are document preamble:

Is­Element­Content


[Constant]
public virtual attribute IsElementContent → (get)

value : bool

true if this XML node (and all items of the same type) may appear in element content,
false if it may not.

Can this XML node appear in element content?

The following XML nodes are element content:

Is­Literal­Content


[Constant]
public virtual attribute IsLiteralContent → (get)

value : bool

true if this XML node (and all items of the same type) may appear in literal content,
false if it may not.

Can this XML node appear in literal content?

The following XML nodes are literal content:

Is­Text­Content


[Constant]
public virtual attribute IsTextContent → (get)

value : bool

true if this node represents plain text content,
false if it does not.

Does this XML node represent plain text content, without structural markup?

The following XML nodes are text content: