Google Apps Script
Feedback on this document

Class XmlAttribute

Deprecated. For new scripts, please prefer the XmlService instead.

An attribute in an XML element.

Methods

MethodReturn typeBrief description
getName()XmlNameGets the name of this attribute.
getValue()StringGets the value of the XmlAttribute.
setValue(value)voidSets the value of this attribute.
toXmlString()StringReturns this node as an XML string.

Detailed documentation

getName()

Gets the name of this attribute.

Return

XmlName — the name of this attribute


getValue()

Gets the value of the XmlAttribute.

Return

String — the value of this attribute. The value is always stored as a String even if it is provided as some other type.


setValue(value)

Sets the value of this attribute. The value will be set to the equivalent of String.valueOf(value).

Parameters

NameTypeDescription
valueObjectthe value of this attribute

toXmlString()

Returns this node as an XML string. For an XmlElement or XmlDocument, this will be the fully converted node in XML string form. For minor nodes like XmlAttribute, this will be in simplified XML fragments like foo="bar".

Return

String — this node in string form

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.