Script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,…: Removes all the sub-elements of an XML element.
XML_REMOVE_CHILDREN(element)
Syntax part |
Description/format |
---|---|
Element |
Reference to the element whose sub-element will be deleted. |
Return code |
---|
'0' – All sub-elements of the specified element were successfully deleted. |
The scriptA particular Automation Engine object type. element deletes all subordinate elements of a specific element within the XML document that is open (XML_OPEN). The reference to the element needs to be specified. The script element delivers the return codeThe value that represents the result of tasks and script functions. '0' once the sub-element has been successfully deleted.
The script element only copies the XML structure that is stored in the memory. The Documentation tab is not affected by this.
The following example opens a structured Documentation tab as an XML document. The first element is then specified and all of its sub-elements are deleted. If the deletion is successful, a corresponding message is written to the activation log.
:SET &XMLDOCU#=XML_OPEN(DOCU,,"@Details")
:IF &XMLDOCU# <> ""
:SET &FIRST# = XML_GET_FIRST_CHILD(&XMLDOCU#)
:SET &RET# = XML_REMOVE_CHILDREN(&FIRST#)
:IF &RET# = 0
:P 'Sub-element successfully deleted.'
:ENDIF
:ENDIF
:XML_CLOSE &XMLDOCU#
See also:
Script element | Description |
---|---|
XML_OPEN | Opens an XML document for processing. |
:XML_CLOSE | Closes an XML document. |
Script Element – Reading or Modifying Objects
Examples
Determining the Error Message and Number
About the Script
Script Elements – Alphabetical Listing
Script Elements – Ordered by Function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |