Skip to main content
This class represents an XML DOM structure.

Constructors

XMLNode(XMLNode)

Pass an object to copy.

XMLNode(String)

Pass a string to parse and create a new object.

Methods

toString(Integer)

Creates a string containing the XMLNode as a formatted string. Child nodes are also included.
Returns: CRMScript.Global.String

toJSON(Integer)

Creates a string containing XML nodes formatted as a JSON document. Child nodes are also included.
Returns: CRMScript.Global.String - XMLNodes converted to JSON.
Valid types: object, array, string, number, bool, and null.
Example:

addChild(XMLNode)

Add one node as a child node of the current node.
Returns: CRMScript.Global.Void Example:

getChildren()

Returns an array of the current node’s children.
Returns: CRMScript.Native.XMLNode[] - Returns an array of the current node’s children.

setChildren(XMLNode[])

Sets an array of XMLNodes as the children of the current node.
Returns: CRMScript.Global.Void Example:

getName()

Gets the name of the XML tag.
Returns: CRMScript.Global.String - The name of the XML tag. Example:

setName(String)

Sets the tag name of the node.
Returns: CRMScript.Global.Void Example:

getParameter(String)

Gets a parameter (attribute) from the node with a given name.
Returns: CRMScript.Global.String Example:

setParameter(String, String)

Sets a parameter with name and value. A node can have any number of parameters but all names must be unique.
Returns: CRMScript.Global.Void Example:

getText()

Gets the text between two tags. For example, >TAG>Returns this text>/TAG>
Returns: CRMScript.Global.String Example:

setText(String)

Sets the text between 2 tags.
Returns: CRMScript.Global.Void Example:

getValueFromPath(String)

This function will return the value for the given path. The path should be a dot-separated string containing either names of nodes or indices.
Returns: CRMScript.Global.String - The value for the given path.
If your path does not lead to a node, you will get a String with a null value back (can be checked with isNull()).
Example:

getNodeFromPath(String)

This function will return the XMLNode for the given path. The path should be a dot-separated string containing either names of nodes or indices.
Returns: CRMScript.Global.XMLNode - The Node for the given path.
If your path does not lead to a node, you will get an empty XMLnode back.
Example: