XmlDeclaration

XmlDeclaration

XML Declaration, like <?xml version="1.0"?>

Constructor

new XmlDeclaration(versionopt, encodingopt, standaloneopt)

Description:
  • Creates an instance of XmlDeclaration.
Source:
See:
Parameters:
Name Type Attributes Default Description
version string <optional>
'1.0' The XML version of the document
encoding string <optional>
standalone boolean <optional>
false

Extends

Classes

XmlDeclaration

Members

(readonly) document

Description:
  • Find the Document that this node is in, if it is in a Document.
Source:
Overrides:
Find the Document that this node is in, if it is in a Document.

(nullable) parent :Node

Source:
Overrides:
Type:

Methods

first(pattern, contextopt) → {string|Node|number|null}

Description:
  • Get the first matching node for a given pattern, or null if none exist.
Source:
Overrides:
Parameters:
Name Type Attributes Default Description
pattern string | XPath The pattern to match
context Node <optional>
this The context node. Uses this node as context if none is provided.
Returns:
The first match if one exists
Type
string | Node | number | null

get(pattern, contextopt) → {XPathResult}

Description:
  • Get all of the nodes that match the given XPath pattern, with the given context for XPath execution.
Source:
Overrides:
Parameters:
Name Type Attributes Default Description
pattern string | XPath The pattern to match
context Node <optional>
this The context node. Uses this node as context if none is provided.
Returns:
The matching nodes
Type
XPathResult

(abstract) text(newTextopt) → {string|Node}

Description:
  • Default implementation of text returns empty string.
Source:
Overrides:
Parameters:
Name Type Attributes Description
newText string <optional>
New text to insert
Returns:
The concatenated text
Type
string | Node

toString(optionsopt) → {string}

Description:
  • Convert to string.
Source:
Overrides:
Parameters:
Name Type Attributes Description
options MaybeStylizedSeparated <optional>
How to convert to string
Returns:
The node, converted to a string
Type
string