Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XmlComment

Represents an XML comment.

An XML character reference is structured as follows, where {content} is the text of the comment.

<!--{content}-->

The {content} value is a property of this node.

XmlComment nodes cannot have any children.

Hierarchy

Index

Constructors

constructor

  • Initializes a new instance of the XmlComment class.

    Parameters

    • content: string

      The content of the comment.

    Returns XmlComment

Properties

Protected _children

_children: XmlNode[]

Private _content

_content: string

Accessors

content

  • get content(): string
  • set content(content: string): void
  • Gets the content of the comment.

    Returns string

    The content of the comment.

  • Sets the content of the comment.

    Parameters

    • content: string

      The content of the comment.

    Returns void

    The content of the comment.

parent

  • Gets the parent of this node.

    Returns XmlNode

    The parent of this node.

Methods

children

insertChild

next

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

    Returns XmlNode

    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

    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

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

removeChild

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

    Parameters

    Returns boolean

removeChildAtIndex

  • removeChildAtIndex(index: number): XmlNode

toString

  • Returns an XML string representation of this node.

    Parameters

    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

    The parent of this node.

Generated using TypeDoc