XML_GET_NEXTSIBLING

Script Function: Identifies the succeeding element

Syntax

XML_GET_NEXTSIBLING (Reference)

Syntax

Description/Format

Reference

Reference to the element whose successor is to be identified
Format: script literal or script variable

Return codes

Reference to the subsequent element of the same level
" " - There is no subsequent element.

Comments

This script function identifies the succeeding element on the same level in the XML document.

A handle must be given to the script function in order to access the succeeding element. Specific script elements use handles to position themselves within XML document and to edit it.

While XML_GET_NEXTSIBLING serves to identify the succeeding element on the same level, XML_GET_FIRST_CHILD is used to identify the first sub-element.

Example

Starting point for the following example is the first sub-element Description. All subsequent elements of the same level are retrieved and written to the activation protocol - here, it is the element Contacts.

: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

XML_GET_FIRST_CHILD

Identifies the first sub-element of an 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