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. |
Return codes |
---|
The text of the element. |
Comments
Use this script function in order to read an element's text in an XML document.
The script function requires a reference to be able to access the element. This reference is provided by script elements which can be positioned within the XML document (such as XML_GET_FIRST_CHILD, XML_GET_NEXTSIBLING, XML_SELECT_NODE or XML_OPEN).
The content of a text attribute may be retrieved using the script function XML_GET_ATTRIBUTE.
There is no limit for the returned value.
Examples
The text "Related objects:" of the Objects element is written to the activation protocol 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
Also see:
Script element | Description |
---|---|
Supplies the name of an element. |
Script Elements - Read or Modify Objects
Sample Collection:
Retrieving Error Message and Number
About Scripts
Script Elements - Alphabetical Listing
Script-Elements - Ordered by Function