Script Functions for XML Elements
XML (Extensible Markup Language) contains information wrapped in tags to store and transport data. For example, in Automic Automation, you can create XML documents by exporting object data. The following script functions can handle, read or modify values stored in XML documents. The source of an XML document in Automic Automation can be Structured Documentation, the report of an SAP job, or an XML string.
Note: The XML parser used for the XML script functions supports XML values with UTF-8 characters. It supports UTF-8 for tag names, attribute names, and their values.
Example:
<xml_tag1>
<xml_tag2 xml_attribute1="attribute-value">any xml value</xml_tag2>
</xml_tag1>
-
XML_APPEND_BEFORE
Moves an XML element before another element -
XML_APPEND_CHILD
Adds a new sub-element to an XML element -
XML_APPEND_CLONE
Duplicates an XML element and attaches it to another element -
XML_APPEND_ELEMENT
Attaches an existing XML element to another element -
XML_BEAUTIFY
Structures and formats an XML document -
XML_CLONE_AND_RENAME
Duplicates and renames an XML element -
:XML_CLOSE
Closes an XML document -
XML_DELETE_NODE
Removes a specific XML element -
XML_GET_ATTRIBUTE
Retrieves the value of an element's attribute -
XML_GET_CHILD_COUNT
Counts the sub-elements of an element -
XML_GET_FIRST_CHILD
Identifies the first sub-element of an element -
XML_GET_LAST_CHILD
Identifies the last sub-element of an element -
XML_GET_NEXTSIBLING
Identifies the succeeding element -
XML_GET_NODE_NAME
Retrieves the name of an element -
XML_GET_NODE_TEXT
Retrieves the text of an element -
XML_INSERT_BEFORE
Creates a new XML element and inserts the new element before another element -
XML_OPEN
Opens an XML document for processing -
XML_PRINTINTOFILE
Writes the XML document in a file -
XML_REMOVE_CHILDREN
Removes all the sub-elements of an XML element -
XML_SELECT_NODE
Identifies an element -
XML_SET_ATTRIBUTE
Adds a new attribute to an XML element or changes an existing attribute -
XML_SET_NODE_TEXT
Changes or sets the value of an XML element -
XML_TO_STRING
Returns the XML of a specific element as text