XML.GENERATE Subroutine

Generates an XML document by inserting data from a dynamic array into an XML template.

Syntax

XML.GENERATE(errorMsg, result, template, array)

Syntax Elements

errorMsg A variable in which to return an error message, should an error occur. If the subroutine completes successfully, a null string is returned.

result A variable in which to return a string containing the resulting XML document. Attribute marks in template are replaced by new lines.

template A string containing an XML template in MultiValue format (lines must be separated by attribute marks). For information about how to write an XML template, refer to Writing an XML Template.

array A dynamic array containing input data.

Operation

The XML document is generated as follows:

Processing Options

The characters used to delimit substitutions, optional text and repeated text can be changed by including, as the first node in the template, an XML node with the following format:

<__nis_cont {paramDelim="string1"} {optionalDelim="string2"} {repeatDelim="string3"} {removeWhiteSpace="YES"}/>

where string1 and string2 are single characters or sequences of character that do not appear elsewhere in the template, and string3 is a pair of characters respectively used to delimit the start and end of a repeated section. The final processing option, if present, suppresses extraneous white space in the XML document.

Comments

Refer to XML Generation for details of how to use this subroutine.