# XMLList

## Overview

E4X (Ecma-357) XMLList object.\
This is based on a deprecated/withdrawn standard.

## Methods Summarized

| Type                                                                           | Name                                                                     | Summary                                                                                                                               |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [attribute(attributeName)](#attribute-attributename)                     | It calls the method attribute of each object in this XMLList and returns the results in order in an XMLList.                          |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [attributes()](#attributes)                                              | Calls the method attributes of each object in this XMLList and returns an XMLList with the results in order.                          |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [child(propertyName)](#child-propertyname)                               | Calls the method child of each XML object in this XMLList object to return an XMLList with the matching children in order.            |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [children()](#children)                                                  | Returns an XMLList with the children of all XML objects in this XMLList.                                                              |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [comments()](#comments)                                                  | Returns an XMLList with all the comment child nodes of XML objects in this XMLList in order.                                          |
| [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) | [contains(value)](#contains-value)                                       | Returns true if there is (at least) one XML object in the list that compares equal to the value                                       |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [copy()](#copy)                                                          | Returns a deep copy of the XMLList it is called on.                                                                                   |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [descendants()](#descendants)                                            | Returns an XMLList with all of the matching descendants of all XML objects.                                                           |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [descendants(name)](#descendants-name)                                   | Returns an XMLList with all of the matching descendants of all XML objects.                                                           |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [elements(name)](#elements-name)                                         | Returns an XMLList with the matching element children of all XML objects in this XMLList.                                             |
| [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) | [hasComplexContent()](#hascomplexcontent)                                | Returns true if the XMLList contains exactly one XML object which has complex content or if the XMLList contains several XML objects. |
| [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) | [hasOwnProperty(propertyName)](#hasownproperty-propertyname)             | Returns true if the XMLList object has a property of that name and false otherwise.                                                   |
| [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) | [hasSimpleContent()](#hassimplecontent)                                  | Returns true if the XMLList is empty or contains exactly one XML object which has simple content or contains no elements at all.      |
| [Number](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/number)   | [length()](#length)                                                      | Returns the number of XML objects this XMLList contains.                                                                              |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [normalize()](#normalize)                                                | Returns the XMLList object it is called on after joining adjacent text nodes and removing empty text nodes.                           |
| [XML](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xml)         | [parent()](#parent)                                                      | Returns the common parent of all XML objects in this XMLList if all those objects have the same parent.                               |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [processingInstructions()](#processinginstructions)                      | Returns an XMLList with all the matching processing instruction child nodes of all XML objects in this XMLList.                       |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [processingInstructions(name)](#processinginstructions-name)             | Returns an XMLList with all the matching processing instruction child nodes of all XML objects in this XMLList.                       |
| [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean) | [propertyIsEnumerable(propertyName)](#propertyisenumerable-propertyname) | Returns true if the property name converted to a number is greater than or equal to 0 and less than the length of this XMLList.       |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [text()](#text)                                                          | Returns an XMLList containing all the text child nodes of all the XML objects contained in this XMLList.                              |
| [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string)   | [toString()](#tostring)                                                  | Returns a string representation of the XMLList                                                                                        |
| [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string)   | [toXMLString()](#toxmlstring)                                            | Returns the concatenation of toXMLString called on each XML object.                                                                   |
| [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist) | [valueOf()](#valueof)                                                    | Simply returns the XMLList object it is called on.                                                                                    |

## Methods Detailed

### attribute(attributeName)

It calls the method attribute of each object in this XMLList and returns the results in order in an XMLList.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **attributeName** ;

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.attribute(attributeName)
```

### attributes()

Calls the method attributes of each object in this XMLList and returns an XMLList with the results in order.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.attributes()
```

### child(propertyName)

Calls the method child of each XML object in this XMLList object to return an XMLList with the matching children in order.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **propertyName** ;

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.child(propertyName)
```

### children()

Returns an XMLList with the children of all XML objects in this XMLList.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.children()
```

### comments()

Returns an XMLList with all the comment child nodes of XML objects in this XMLList in order.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.comments()
```

### contains(value)

Returns true if there is (at least) one XML object in the list that compares equal to the value

**Parameters**

* [Object](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/object) **value** ;

**Returns:** [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean)

**Sample**

```js
xmlList.contains(value)
```

### copy()

Returns a deep copy of the XMLList it is called on.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.copy()
```

### descendants()

Returns an XMLList with all of the matching descendants of all XML objects.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.descendants([name])
```

### descendants(name)

Returns an XMLList with all of the matching descendants of all XML objects.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **name** ;

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.descendants([name])
```

### elements(name)

Returns an XMLList with the matching element children of all XML objects in this XMLList.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **name** ;

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.elements([name])
```

### hasComplexContent()

Returns true if the XMLList contains exactly one XML object which has complex content or if the XMLList contains several XML objects.

**Returns:** [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean)

**Sample**

```js
xmlList.hasComplexContent()
```

### hasOwnProperty(propertyName)

Returns true if the XMLList object has a property of that name and false otherwise.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **propertyName** ;

**Returns:** [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean)

**Sample**

```js
xmlList.hasOwnProperty(propertyName)
```

### hasSimpleContent()

Returns true if the XMLList is empty or contains exactly one XML object which has simple content or contains no elements at all.

**Returns:** [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean)

**Sample**

```js
xmlList.hasSimpleContent()
```

### length()

Returns the number of XML objects this XMLList contains.

**Returns:** [Number](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/number)

**Sample**

```js
xmlList.length()
```

### normalize()

Returns the XMLList object it is called on after joining adjacent text nodes and removing empty text nodes.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.normalize()
```

### parent()

Returns the common parent of all XML objects in this XMLList if all those objects have the same parent.

**Returns:** [XML](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xml)

**Sample**

```js
xmlList.parent()
```

### processingInstructions()

Returns an XMLList with all the matching processing instruction child nodes of all XML objects in this XMLList.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.processingInstructions([name])
```

### processingInstructions(name)

Returns an XMLList with all the matching processing instruction child nodes of all XML objects in this XMLList.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **name** ;

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.processingInstructions([name])
```

### propertyIsEnumerable(propertyName)

Returns true if the property name converted to a number is greater than or equal to 0 and less than the length of this XMLList.

**Parameters**

* [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string) **propertyName** ;

**Returns:** [Boolean](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/boolean)

**Sample**

```js
xmlList.propertyIsEnumerable(propertyName)
```

### text()

Returns an XMLList containing all the text child nodes of all the XML objects contained in this XMLList.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.text()
```

### toString()

Returns a string representation of the XMLList

**Returns:** [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string)

**Sample**

```js
xmlList.toString()
```

### toXMLString()

Returns the concatenation of toXMLString called on each XML object. The result for each XML object is put on a separate line if XML.prettyPrinting is true.

**Returns:** [String](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/string)

**Sample**

```js
xmlList.toXMLString()
```

### valueOf()

Simply returns the XMLList object it is called on.

**Returns:** [XMLList](https://docs.servoy.com/reference/servoycore/dev-api/js-lib/xmllist)

**Sample**

```js
xmlList.valueOf()
```

***
