Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XmlCharData

Represents character data in an XML document.

Restricted characters, such as the ampersand (&), the opening angle bracket (<), and the closing angle bracket (>) when it appears in the string ]]>, are all automatically escaped.

To create an character reference or entity reference, you should use XmlCharRef or XmlEntityRef respectively instead.

XmlCharData nodes cannot have any children.

Hierarchy

Index

Constructors

constructor

Properties

Private _charData

_charData: string

Protected _children

_children: XmlNode[]

Accessors

charData

  • get charData(): string
  • set charData(charData: string): void
  • Gets the character data associated with this node.

    Returns string

    The character data associated with this node.

  • Sets the character data associated with this node.

    Parameters

    • charData: string

      Character data.

    Returns void

    The character data associated with this node.

parent

  • get parent(): XmlNode | undefined
  • Gets the parent of this node.

    Returns XmlNode | undefined

    The parent of this node.

Methods

children

  • Throws an exception since XmlCharData nodes cannot have any children.

    Returns XmlNode[]

    This method does not return.

insertChild

  • Throws an exception since XmlCharData nodes cannot have any children.

    Parameters

    • node: XmlNode

      This parameter is unused.

    • Optional index: number

      This parameter is unused.

    Returns XmlNode | undefined

    This method does not return.

next

  • Gets the node that follows this one, or undefined if no such node exists or if this node has no parent.

    Returns XmlNode | undefined

    The node that follows this one, or undefined if no such node exists or if this node has no parent.

prev

  • Gets the node that is previous to this one, or undefined if no such node exists or if this node has no parent.

    Returns XmlNode | undefined

    The node that is previous to this one, or undefined if no such node exists or if this node has no parent.

remove

  • Removes this node from its parent if this node has a parent.

    Returns XmlNode | undefined

    This node's parent, or undefined if it has no parent.

removeChild

  • removeChild(node: XmlNode): boolean
  • Throws an exception since XmlCharData nodes cannot have any children.

    Parameters

    • node: XmlNode

      This parameter is unused.

    Returns boolean

    This method does not return.

removeChildAtIndex

  • removeChildAtIndex(index: number): XmlNode
  • Throws an exception since XmlCharData nodes cannot have any children.

    Parameters

    • index: number

      This parameter is unused.

    Returns XmlNode

    This method does not return.

toString

  • Returns an XML string representation of this node.

    Parameters

    • Default value options: IStringOptions = {}

      Formatting options for the string representation.

    Returns string

    An XML string representation of this node.

top

  • Returns the root node of the current hierarchy. If this node has no parent, this node itself is returned.

    Returns XmlNode

    The root node of the current hierarchy.

up

  • Gets the parent of this node.

    Returns XmlNode | undefined

Generated using TypeDoc