Script Function: Identifies any element
XML_SELECT_NODE(Reference, Element)
Syntax |
Description/Format |
---|---|
Reference |
Reference to the element that serves as starting point |
Element |
Name of the element with path from the starting point |
Return codes |
---|
Reference to the searched element |
The script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… identifies any element in the XML document.
A handle must be given to the script function to position to an element. This element is the starting point for searching the structure. From here, the element whose specified path was registeredThis is the status of a task that runs within a group and is waiting for its start. is searched for.
Specific script elements use handles to position themselves within the XML document, and to edit it. The very first handle is the one that is returned by XML_OPEN. It refers to the root element. It may be used by XML_SELECT_NODE to directly identify an element. The script function can also receive its handle from XML_GET_FIRST_CHILD or XML_GET_NEXTSIBLING. This shows that there are several ways of accessing elements in ramified structures.
Keep in mind that only elements that are sub-elements of the starting point may be found.
The example identifies an element directly from the root element "Content" of the structured documentation. The text of the element "Objects" is output in the activation log.
:SET &XMLDOCU# = XML_OPEN(DOCU,"ON_CALL","@Details")
:SET
&HND# = XML_SELECT_NODE(&XMLDOCU#, "Description/Objects")
:SET &TEXT# = XML_GET_NODE_TEXT(&HND#)
:PRINT "Text of the element: &TEXT#"
:XML_CLOSE
See also:
Script Elements - Read or Modify Objects
About Scripts
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 |