Script function: Identifies the last sub-element of an element
XML_GET_LAST_CHILD (Reference)
Syntax |
Description/Format |
---|---|
Reference |
Reference to the element whose sub-element is to be identified Format: script literal or script variable |
Return code |
---|
Reference to the last sub-element |
The script function identifies the last sub-element of an element in an XML document.
A handle must be given to the script function so that it can access the appropriate last sub-element. This reference specifies the position in the XML document. The very first handle is the one which is returned by XML_OPEN. It refers e.g. to the root element Content of the structured documentation.
XML_GET_LAST_CHILD switches a level deeper into the structure starting at the specified element. XML_GET_NEXTSIBLING retrieves the subsequent element on the same level.
The following example determines the name of the last sub-element Info with the main element "Content" being the starting point.
:SET &XMLDOCU# = XML_OPEN(DOCU,"ON_CALL","@Details")
:SET &HND# = XML_GET_LAST_CHILD(&XMLDOCU#)
: IF &HND# <> ""
: SET &NAME# = XML_GET_NODE_NAME(&HND#)
: PRINT "Last sub-element: &NAME#"
: ELSE
: PRINT "No sub-element"
: ENDIF
:XML_CLOSE
See also:
Script element | Description |
---|---|
XML_GET_FIRST_CHILD | Identifies the first sub-element of an element |
Identifies the subsequent element |
Script Elements - Read or Modify Objects
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function