Class EntityRef

  • EntityRef represents an XML EntityReference node, providing methods to interact with and modify it within a document.

  • It offers methods to get and set the name, public ID, and system ID of the entity reference.

  • You can detach the node from its parent, retrieve its text value, and access its parent element using provided methods.

  • This class facilitates working with external entities referenced within an XML document using Apps Script's XML Service.

EntityRef

A representation of an XML EntityReference node.

Methods

MethodReturn typeBrief description
detach()ContentDetaches the node from its parent Element node.
getName()StringGets the name of the EntityReference node.
getParentElement()ElementGets the node's parent Element node.
getPublicId()StringGets the public ID of the EntityReference node.
getSystemId()StringGets the system ID of the EntityReference node.
getValue()StringGets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document.
setName(name)EntityRefSets the name of the EntityReference node.
setPublicId(id)EntityRefSets the public ID of the EntityReference node.
setSystemId(id)EntityRefSets the system ID of the EntityReference node.

Detailed documentation

detach()

Detaches the node from its parent Element node. If the node does not have a parent, this method has no effect.

Return

Content — the detached node


getName()

Gets the name of the EntityReference node.

Return

String — the name of the EntityReference node


getParentElement()

Gets the node's parent Element node. If the node does not have a parent, this method returns null.

Return

Element — the parent Element node


getPublicId()

Gets the public ID of the EntityReference node. If the node does not have a public ID, this method returns null.

Return

String — the public ID of the EntityReference node, or null if it has none


getSystemId()

Gets the system ID of the EntityReference node. If the node does not have a system ID, this method returns null.

Return

String — the system ID of the EntityReference node, or null if it has none


getValue()

Gets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document.

Return

String — the text value of all nodes that are direct or indirect children of the node


setName(name)

Sets the name of the EntityReference node.

Parameters

NameTypeDescription
nameStringthe name to set

Return

EntityRef — the EntityReference node, for chaining


setPublicId(id)

Sets the public ID of the EntityReference node.

Parameters

NameTypeDescription
idStringthe public ID to set

Return

EntityRef — the EntityReference node, for chaining


setSystemId(id)

Sets the system ID of the EntityReference node.

Parameters

NameTypeDescription
idStringthe system ID to set

Return

EntityRef — the EntityReference node, for chaining