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 Numeric literal or identifier of a COBOL numeric data item that specifies the length of the XML document to be transformed.
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 Numeric literal or identifier of a COBOL numeric data item that specifies the length of the transformed XML document.

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 status value is returned in the XML-data-group data item, which is defined in the copybook, lixmldef.cpy.

A block of memory is allocated to hold the transformed XML document. The COBOL application is responsible for releasing this memory when it is no longer needed by using XML FREE TEXT.

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-LENGTH
    "MY-DOCUMENT.XML"
    "MY-MODEL-FILE"
    "MY-STYLE-SHEET"
IF NOT XML-OK GO TO Z.