Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XmlDecl

Represents an XML declaration.

An XML declaration is structured as follows, where {version} is the XML version, {encoding} is the encoding of the document, and {standalone} is either "yes" or "no", depending on whether the document may contain external markup declarations:

<?xml version="{version}" encoding="{encoding}" standalone="{standalone}"?>

The {version}, {encoding}, and {standalone} values are properties of this node.

XmlDecl nodes cannot have any children.

Hierarchy

Index

Constructors

constructor

Properties

Protected _children

_children: XmlNode[]

Private _encoding

_encoding: string

Private _standalone

_standalone: string

Private _version

_version: string

Accessors

encoding

  • get encoding(): string
  • set encoding(encoding: string): void
  • Gets the XML encoding to be included in the declaration.

    Returns string

    The XML encoding to be included in the declaration. This value may be undefined.

  • Sets the XML encoding to be included in the declaration.

    Parameters

    • encoding: string

      The XML encoding to be included in the declaration. This value must be a valid encoding. If left undefined, no encoding is included.

    Returns void

    The XML encoding to be included in the declaration. This value may be undefined.

parent

  • Gets the parent of this node.

    Returns XmlNode

    The parent of this node.

standalone

  • get standalone(): string
  • set standalone(standalone: string): void
  • Gets the XML standalone attribute to be included in the declaration.

    Returns string

    The XML standalone attribute to be included in the declaration. This value may be undefined.

  • Sets the XML standalone attribute to be included in the declaration.

    Parameters

    • standalone: string

      The XML standalone attribute to be included. This value must be "yes" or "no". If left undefined, no standalone attribute is included.

    Returns void

    The XML standalone attribute to be included in the declaration. This value may be undefined.

version

  • get version(): string
  • set version(version: string): void
  • Gets the XML version to be included in the declaration.

    Returns string

    The XML version to tbe included in the declaration.

  • Sets the XML version to be included in the declaration.

    Parameters

    • version: string

      The XML version to be included in the declaration. This value must be a valid XML version number. If left undefined, the default version is "1.0".

    Returns void

    The XML version to tbe included in the declaration.

Methods

children

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

    Returns XmlNode[]

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 XmlDecl 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