Script function: Creates a data sequence based on a specific XML document.
XML_DOM_TO_PROCESS(Reference)
Syntax part |
Description/format |
---|---|
Reference |
Reference to an XML document that is to be converted into a data sequence. |
Return codes |
---|
Reference of the data sequence |
The script function stores the content of an XML document in a data sequence, which can then be further processed using the appropriate script elements. The reference to the data sequence created is returned as a return code.
The data sequence creates a line for each element of the transferred XML document.
There may also be a reference to a specific XML element, which was selected with the XML_SELECT_NODE script element, for example.
The following example illustrates the functionality of the XML_DOM_TO_PROCESS script function. In the first step, the structured Documentation tab of the own object is opened as an XML document and the reference is stored in a script variable. Next, a data sequence is created and filled with the content of the XML document. Finally, the data sequence is processed line by line and the individual lines are written in the activation log.
: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 content of the Documentation tab is output line by line in XML format in the activation log:
2013-11-21 14:03:58 - U0020408 <Content>
2013-11-21 14:03:58 - U0020408 <Element1>
2013-11-21 14:03:58 - U0020408 <SubElement1/>
2013-11-21 14:03:58 - U0020408 </Element1>
2013-11-21 14:03:58 - U0020408 <Element2/>
2013-11-21 14:03:58 - U0020408 </Content>
See also:
Script element | Description |
---|---|
XML_PROCESS_TO_DOM | Creates an XML document from a data sequence. |
Script Element – Reading or Modifying Objects
Examples
Determining the Error Message and Number
About the Script
Script Elements – Alphabetical Listing
Script Elements – Ordered by Function