XML TRANSFORM TEXT

This statement has the following parameters:

Parameter Description
InputDocumentPointer The name of a COBOL pointer data item that points to an XML document that is stored in memory as a text string (the input document).
InputDocumentLength The name of a COBOL numeric data item that contains the length of the XML document pointed to by InputDocumentPointer.
StyleSheetName The filename of the XSLT stylesheet used for the transformation.
OutputDocumentPointer 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 (the output document).
OutputDocumentLength The name of a COBOL numeric data item that will contain the length of the generated XML document pointed to by OutputDocumentPointer after successful completion of the statement.

Description

The XML TRANSFORM TEXT statement transforms the XML document specified by the InputDocumentPointer and InputDocumentLength parameters using the XSLT stylesheet specified by the StyleSheetName parameter into a new document specified by the OutputDocumentPointer and OutputDocumentLength parameters. The new document may or may not be an XML document depending on the XSLT stylesheet.

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.

Examples

With an External XSLT Stylesheet:

XML TRANSFORM TEXT
    MY-IN-DOCUMENT-POINTER
    MY-IN-DOCUMENT-LENGTH
    "MY-STYLESHEET"
    MY-OUT-DOCUMENT-POINTER
    MY-OUT-DOCUMENT-LENGTH
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 TRANSFORM TEXT
    MY-DATA-ITEM
    "MY-DOCUMENT.XML"
    "MY-MODEL-FILE"
    "MY-STYLE-SHEET"
IF NOT XML-OK GO TO Z.