Skip to main content
Version: 2026.0

XMLList

Constructors

Constructor

new XMLList(message?): XMLList

Parameters

message?
string

Returns

XMLList

Methods

attribute

attribute(attributeName): string

Returns the attribute with the requested name

Parameters

attributeName
string

Returns

string

attributes

attributes(): string[]

Returns all attributes of this element

Returns

string[]

child

child(index): XML[]

Returns the child element with the given propertyName, or if propertyName is an integer, returns the child in that position

Parameters

index
string | number

Returns


children

children(): XML[]

Returns the index of this child among its siblings

Returns


comments

comments(): string

Returns all the comments that are children of this XML object

Returns

string

contains

contains(value): boolean

Compares this element with the value, primarily provided to enable an XML element and an XML list to be used interchangeably

Parameters

value
string

Returns

boolean

copy

copy(): XML

Returns a deep copy of this element (children, grandchildren, ...)

Returns


descendants

descendants(name?): XML[]

Returns the descendant elements. If a name is provided, only elements with that name are returned.

Parameters

name?
string

Returns


elements

elements(name?): XML[]

Returns the child elements. If a name is provided, only elements with that name are returned

Parameters

name?
string

Returns


hasComplexContent

hasComplexContent(): boolean

Returns true for elements with child elements, otherwise false

Returns

boolean

hasSimpleContent

hasSimpleContent(): boolean

Returns true for attributes, text nodes, or elements without child elements, otherwise false

Returns

boolean

length

length(): number

Returns the amount of elements containing this xml list

Returns

number

normalize

normalize(): void

Merge adjacent text nodes and eliminate empty ones

Returns

void

parent

parent(): XML

The parent of this object

Returns


processingInstructions

processingInstructions(name?): string[]

A list of all processing instructions that are children of this element. If a name is provided, only processing instructions matching this name will be returned.

Parameters

name?
string

Returns

string[]

text

text(): string

Concatenation of all text node children

Returns

string

toString

toString(): string

For elements without element children, returns the values of the text node children. For elements with children, returns same as toXMLString. For other kinds of objects, the value of the object.

Returns

string

toXMLString

toXMLString(): string

Serializes this XML object as parse-able XML

Returns

string

valueOf

valueOf(): XML

Returns this XML object

Returns

Indexable

[key: string]: any