XML_DOM_TO_PROCESS

Use the XML_DOM_TO_PROCESS script function to store the content of an XML document in a data sequence, which can you can further process by using other script elements. The data sequence creates a line for each element of the transferred XML document. For more detailed information, see Script Elements for Data Sequences.

Note: There may also be a reference to a specific XML element, which was selected with the XML_SELECT_NODE script element, for example.

Syntax

XML_DOM_TO_PROCESS (Reference)

Script Function and Parameters

  • XML_DOM_TO_PROCESS
    Creates a data sequence based on a specific XML document

  • Reference
    Reference to an XML document that should be converted into a data sequence.
    Format: script variable

Return Code

XML_DOM_TO_PROCESS returns the reference of the data sequence

Example

The following example illustrates the functionality of the XML_DOM_TO_PROCESS script function. In the first step, you open the @XMLDocu structured documentation page of the own object as an XML document, store the reference in a script variable, and then create and file a data sequence with the content of the XML document. Finally, the data sequence will be processed line by line.

Screenshot of the @XMLDocu Structured Documentation page showing its Content structure with Element1 including its Sub-Element-A, and Element2.

:SET &XML# XML_OPEN (DOCU,,"@XMLDocu")

:SET &HND#XML_DOM_TO_PROCESS (&XML#)

:PROCESS &HND#
SET &XMLLINE# = GET_PROCESS_LINE (&HND#)
: PRINT "&XMLLINE#"

:ENDPROCESS

The activation report now shows the content of the @XMLDocu Structured Documentation page line by line in XML format:

Screenshot of the XML_DOM_TO_PROCESS activation report showing the content structure with Element1 including its Sub-Element-A, and Element2

See also: