Text content within an XML document.

Hierarchy (view full)

Constructors

Properties

end: number = -1

Ending byte offset of this node in the original XML string, or -1 if the offset is unknown.

parent: null | XmlElement | XmlDocument = null

Parent node of this node, or null if this node has no parent.

start: number = -1

Starting byte offset of this node in the original XML string, or -1 if the offset is unknown.

text: string

Text content of this node.

TYPE_CDATA: "cdata" = 'cdata'

Type value for an XmlCdata node.

TYPE_COMMENT: "comment" = 'comment'

Type value for an XmlComment node.

TYPE_DOCUMENT: "document" = 'document'

Type value for an XmlDocument node.

TYPE_DOCUMENT_TYPE: "doctype" = 'doctype'

Type value for an XmlDocumentType node.

TYPE_ELEMENT: "element" = 'element'

Type value for an XmlElement node.

TYPE_PROCESSING_INSTRUCTION: "pi" = 'pi'

Type value for an XmlProcessingInstruction node.

TYPE_TEXT: "text" = 'text'

Type value for an XmlText node.

TYPE_XML_DECLARATION: "xmldecl" = 'xmldecl'

Type value for an XmlDeclaration node.

Accessors

  • get isRootNode(): boolean
  • Whether this node is the root node of the document (also known as the document element).

    Returns boolean

  • get preserveWhitespace(): boolean
  • Whether whitespace should be preserved in the content of this element and its children.

    This is influenced by the value of the special xml:space attribute, and will be true for any node whose xml:space attribute is set to "preserve". If a node has no such attribute, it will inherit the value of the nearest ancestor that does (if any).

    Returns boolean

  • get type(): string
  • Type of this node.

    The value of this property is a string that matches one of the static TYPE_* properties on the XmlNode class (e.g. TYPE_ELEMENT, TYPE_TEXT, etc.).

    The XmlNode class itself is a base class and doesn't have its own type name.

    Returns string

Methods