This statement has the following parameters:
Parameter | Description |
---|---|
DataItem | The name of the COBOL data item that contains data to be exported. |
DocumentPointer | The name of a COBOL pointer data item that will point to the generated XML document as a text string after successful completion of the statement. |
DocumentLength | The name of a COBOL numeric data item that will contain the length of the generated XML document pointed to by DocumentPointer after successful completion of the statement. |
ModelFileName#DataFileName | This parameter may be either of the following:
|
[StyleSheetName] | Optional. The name of an external XSLT stylesheet that will be used to transform the generated XML document before it is stored. |
The XML EXPORT TEXT statement exports the content of the COBOL data item indicated by the DataItem parameter. The content of the data item is converted to an XML document using one or more files indicated by the ModelFileName#DataFileName parameter, and then it is output as a text string. The address and size of the text string is placed in the COBOL data items specified by the DocumentPointer and DocumentLength parameters. If the optional StyleSheetName parameter is present, the external XSLT stylesheet is used to transform the document after it has been generated but before it is stored as a text string.
A block of memory is allocated to hold the generated XML document. The descriptor of this memory block overrides any existing address descriptor in the COBOL pointer data item. The COBOL application is responsible for releasing this memory when it is no longer needed by using XML FREE TEXT.
A status value is returned in the XML-data-group data item, which is defined in the copybook, lixmldef.cpy.
Without an External XSLT Stylesheet:
XML EXPORT TEXT MY-DATA-ITEM MY-DOCUMENT-POINTER MY-DOCUMENT-LENGTH "MY-MODEL-FILE". IF NOT XML-OK GO TO Z.
With an External XSLT Stylesheet:
XML EXPORT TEXT MY-DATA-ITEM MY-DOCUMENT-POINTER MY-DOCUMENT-LENGTH "MY-MODEL-FILE" "MY-STYLE-SHEET" IF NOT XML-OK GO TO Z.
With an External XSLT Stylesheet and Parameters:
XML SET XSL-PARAMETERS "MY-COUNT", 7. IF NOT XML-OK GO TO Z. XML EXPORT TEXT MY-DATA-ITEM "MY-DOCUMENT.XML" "MY-MODEL-FILE" "MY-STYLE-SHEET" IF NOT XML-OK GO TO Z.