Automation Engine Script Guide > Ordered by Function > Read or Modify Objects > XML_GET_LAST_CHILD

XML_GET_LAST_CHILD 

Script function: Identifies the last sub-element of an element

Syntax

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
" " - There is no sub-element.

Comments

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.

Example

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

XML_GET_NEXTSIBLING

Identifies the subsequent element

Script Elements - Read or Modify Objects

Structured Documentation

www.w3c.org/TR/xmlbase

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function