Script Function: Supplies the name of an element
XML_GET_NODE_NAME (Reference)
Syntax |
Description/Format |
---|---|
Reference |
Reference to the element whose name is to be identified |
Return code |
---|
Name of the element |
This scriptA particular Automation Engine object type. functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… may be used to read the name of an element in an XML document.
This script function requires a reference to be able to access the element. This reference is provided by script elements which can position within the XML document (e.g. XML_GET_FIRST_CHILD, XML_GET_NEXTSIBLING, or XML_SELECT_NODE).
XML_OPEN supplies a reference of the first element.
This script function can only process 1024 characters. Exceeding this limit has the effect that no return codeThe value that represents the result of tasks and script functions. is supplied. Keep this in mind when assigning element names.
This example shown below retrieves all elements of one leve. Their names "Description" and "Contacts" are output in the activation log.
:SET &XMLDOCU# = XML_OPEN(DOCU,"ON_CALL","@Details")
:SET &HND# = XML_GET_FIRST_CHILD(&XMLDOCU#)
: WHILE &HND# <> ""
: SET &NAME#
= XML_GET_NODE_NAME(&HND#)
: PRINT "element: &NAME#"
: SET
&HND# = XML_GET_NEXTSIBLING(&HND#)
: ENDWHILE
:XML_CLOSE
See also:
Script element | Description |
---|---|
Supplies the text of an element |
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 |