XML_GET_NEXTSIBLING

Use the XML_GET_NEXTSIBLING script function to identify the succeeding element on the same level in the XML document.

Syntax

XML_GET_NEXTSIBLING (Reference)

Script Function and Parameters

  • XML_GET_NEXTSIBLING
    Identifies the succeeding element

  • Reference
    Reference to the element whose successor should be identified . A reference or handle must be given to the script function so that it can access the succeeding element. Specific script elements use handles to position themselves within XML document and to edit it.
    Format: script literal or script variable
    Tip: XML_GET_NEXTSIBLING identifies the succeeding element on the same level. Use XML_GET_FIRST_CHILD to identify the first sub-element. For more information, see XML_GET_FIRST_CHILD.

Return Code

This script function returns the reference to the subsequent element of the same level and " " if there is no subsequent element.

Example

Starting point for the following example is the first sub-element of the content structure called 'Description'. All subsequent elements of the same level are retrieved, and all are written to the activation report.

Screenshot of a Calendar object with a Content structure that includes three levels

:SET &XMLDOCU# = XML_OPEN (DOCU,"ON_CALL_SERVICES","@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

The activation report of this example shows three elements that belong to the same group:

Screenshot of an activation report that shows three elements on the same level, the 'Description' element, the 'Contacts' element and the 'Info' element.

See also: