Deprecated. For new scripts, please prefer the
XmlService
instead.
An XML element. This class aids in navigating an XML hierarchy. Elements have a name, a set of attributes, and a sequence of children.
Methods
Method | Return type | Brief description |
---|---|---|
getAttribute(expandedName) |
| Gets the child attribute with the given name. |
getAttribute(namespaceName, localName) |
| Gets the child attribute with the given name. |
getAttributes() |
| Gets all child attributes of this element. |
getElement() |
| Gets the first child element of this element. |
getElement(expandedName) |
| Gets the first child element with the given name. |
getElement(namespaceName, localName) |
| Gets the first child element with the given name. |
getElements() |
| Gets all child elements of this element. |
getElements(expandedName) |
| Gets all child elements of this element. |
getElements(namespaceName, localName) |
| Gets all child elements with the given name. |
getName() |
| Gets the name of this XmlElement. |
toXmlString() | String | Returns this node as an XML string. |
Detailed documentation
getAttribute(expandedName)
Gets the child attribute with the given name.
Parameters
Name | Type | Description |
---|---|---|
expandedName | String | the expanded name to look for |
Return
— the attribute with the provided expanded name (or XmlAttributenull
if
there is no such child)
getAttribute(namespaceName, localName)
Gets the child attribute with the given name.
Parameters
Name | Type | Description |
---|---|---|
namespaceName | String | the name of the namespace to look for |
localName | String | the local name to look for |
Return
— the attribute with the provided namespace name and local name (or
XmlAttributenull
if there is no such child)
getAttributes()
Gets all child attributes of this element.
Return
— the attributes that this element hasXmlAttribute[]
getElement()
Gets the first child element of this element.
Return
— the first child element of this element (or XmlElementnull
if there
is no such element)
getElement(expandedName)
Gets the first child element with the given name.
Parameters
Name | Type | Description |
---|---|---|
expandedName | String | the expanded name to look for |
Return
— this first child element of this element with the provided expanded
name, or XmlElementnull
if there is no such element
getElement(namespaceName, localName)
Gets the first child element with the given name.
Parameters
Name | Type | Description |
---|---|---|
namespaceName | String | the name of the namespace to look for |
localName | String | the local name to look for |
Return
— this first child element of this element with the provided
namespace name and local name, or XmlElementnull
if there is no such
element
getElements()
Gets all child elements of this element.
Return
— all the child elements of this element in document orderXmlElement[]
getElements(expandedName)
Gets all child elements of this element.
Parameters
Name | Type | Description |
---|---|---|
expandedName | String | the expanded name to look for |
Return
— all the child elements of this element, with the provided expanded
name, in document orderXmlElement[]
getElements(namespaceName, localName)
Gets all child elements with the given name.
Parameters
Name | Type | Description |
---|---|---|
namespaceName | String | the name of the namespace to look for |
localName | String | the local name to look for |
Return
— all the child elements of this element, with the provided namespace
name and local name, in document orderXmlElement[]
toXmlString()
Returns this node as an XML string. For an
or XmlElement
, this will
be the fully converted node in XML string form. For minor nodes like XmlDocument
, this
will be in simplified XML fragments like XmlAttributefoo="bar"
.
Return
String
— this node in string form