XML_GET_NODE_TEXT

Script function: Supplies the text of an element.

Syntax

XML_GET_NODE_TEXT (Reference)

Syntax

Description/Format

Reference

The reference to the element with the text to be retrieved.
Format: script literal or script variable


Return codes

The text of the element.
" " - There is no text.

Use this script function in order to read an element's text in an XML document. There is no limit for the returned value.

Note: You must provide a handle to the script function to access the element. Use a script function that takes position within the XML document to provide the handle. The following are examples of script elements that you can use for this purpose:

Tip: Use the XML_GET_ATTRIBUTE to retrieve the content of a text attribute. For more information, see XML_GET_ATTRIBUTE.

Examples

The text "Related objects:" of the Objects element is written to the activation report in the example shown below.

:SET &XMLDOCU# = XML_OPEN(DOCU,"ON_CALL","@Details")

:
SET &HND# = XML_GET_FIRST_CHILD(&XMLDOCU#)
:
SET &HND# = XML_GET_FIRST_CHILD(&HND#)

:
WHILE &HND# <> ""
:    
  SET &NAME# = XML_GET_NODE_NAME(&HND#)
:      
SET &TXT# = XML_GET_NODE_TEXT(&HND#)
:     
 PRINT "Text of the element &NAME#: &TXT#"
:      
SET &HND# = XML_GET_NEXTSIBLING(&HND#)
:
ENDWHILE  

:
XML_CLOSE

See also:

seealso

Script Functions for XML Elements