This statement has the following parameters:
Parameter | Description |
---|---|
InputDocumentPointer | An identifier of a COBOL pointer data item that points to an XML document stored in memory as a text string that is to be transformed. |
InputDocumentLength | An identifier of a COBOL numeric data item that contains the length of the XML document pointed to by InputDocumentPointer. |
StyleSheetName | A nonnumeric literal or an identifier of an alphanumeric data item, the value of which is the name of a file containing an XSLT stylesheet that will be used to transform the input document. |
OutputDocumentPointer | An identifier of a COBOL pointer data item that will point to the transformed XML document as a text string after successful completion of the statement. |
OutputDocumentLength | An identifier of a COBOL numeric data item that will contain the length of the transformed XML document pointed to by OutputDocumentPointer after successful completion of the statement. |
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.
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.