This statement has the following parameters:
Parameter | Description |
---|---|
DocumentPointer | Identifier of a COBOL pointer data item that will point to the in-memory text after successful completion of the statement. |
DocumentLength | Identifier of a COBOL numeric data item that will contain the length of the in-memory text after successful completion of the statement. |
DocumentName | Nonnumeric literal or identifier of an alphanumeric data item that specifies the filename of the file containing the text to load into memory. If an extension is not specified in the filename, the extension .xml is appended to the specified filename. |
The XML GET TEXT statement copies the content of a file specified by the DocumentName parameter to COBOL memory. A block of memory is allocated to contain the text. The address and size of the memory block are returned in the DocumentPointer and DocumentLength parameters, respectively. The text is normally, but not necessarily, an XML document.
When the program has finished using the in-memory document, a call to XML FREE TEXT should be made to release the allocated memory.
A status value is returned in the data item XML-Status of XML-data-group, which is defined in the copy file lixmldef.cpy.
XML GET TEXT MY-DOCUMENT-POINTER MY-DOCUMENT-LENGTH "MY-DOCUMENT". IF NOT XML-OK GO TO Z.