XMLList

Moduleejs
Definitionfinal class XMLList
InheritanceXMLList inherit Object
Specifiedecma-357

The XMLList class is a helper class for the XML class.


Properties

QualifiersPropertyTypeDescription
No properties defined

XMLList Methods

QualifiersMethod
public attribute(name: String): XMLList
 Get an XMLList containing all of the attributes of this object with the given name.
public attributes(): XMLList
 Get an XMLList containing all of the attributes of this object.
public elements(name: String = *): XMLList
 Get all the children of this XML node that are elements having the given name.
iterator override get(): Iterator
 Get an iterator for this node to be used by "for (v in node)".
iterator override getValues(): Iterator
 Get an iterator for this node to be used by "for each (v in node)".
public override length(): Number
 Return the length of an XML object in elements.
public name(): String
 Get the qualified name of this XML object.
public parent(): XML
 Get the parent of this XML object.
public override toJSON(): String
 Convert to a JSON encoding.
public override toString(): String
 Provides a string representation of the XML object.
XMLList()
 XML Constructor.

Method Detail

public attribute(name: String): XMLList

Get an XMLList containing all of the attributes of this object with the given name.

Parameters
name: String The name to search on.
Returns
An XMLList with all the attributes (zero or more).

public attributes(): XMLList

Get an XMLList containing all of the attributes of this object.

Returns
An XMLList with all the attributes (zero or more).

public elements(name: String = *): XMLList

Get all the children of this XML node that are elements having the given name.

Description
The optional argument defaults to getting all elements.
Parameters
name: String The (optional) name to search on. [default: *]
Returns
The list of elements.

override iterator get(): Iterator

Get an iterator for this node to be used by "for (v in node)".

Returns
An iterator object.

override iterator getValues(): Iterator

Get an iterator for this node to be used by "for each (v in node)".

Returns
An iterator object.

override public length(): Number

Return the length of an XML object in elements.

Description
NOTE: This is a method and must be invoked with ().
Returns
A number indicating the number of child elements.

public name(): String

Get the qualified name of this XML object.

Returns
The qualified name.

public parent(): XML

Get the parent of this XML object.

Returns
The parent.

override public toJSON(): String

Convert to a JSON encoding.

Returns
A JSON string.

override public toString(): String

Provides a string representation of the XML object.

Returns
A string with the encoding.

public XMLList()

XML Constructor.

Description
Create an empty XML object.