This statement has the following parameters:
Parameter | Description |
---|---|
DocumentPointer | An identifier of a COBOL pointer data item that will point to the in-memory text string after successful completion of the statement. |
DocumentLength | An identifier of a COBOL numeric data item that will contain the length of the text string pointed to by DocumentPointer after successful completion of the statement. |
DocumentName | A nonnumeric literal or an identifier of an alphanumeric data item, the value of which is the filename of the file containing the text to load into memory. This text string is not necessarily an XML document. The content may even be a binary data; the term text in this context simply means in-memory instead of in-file. |
The XML GET TEXT statement copies the content from the file specified by the DocumentName parameter to COBOL memory. A block of memory is allocated to contain the document. The address and size of the memory block are returned in the DocumentPointer and DocumentLength parameters.
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 XML-data-group data item, which is defined in the copybook, lixmldef.cpy.
XML GET TEXT MY-POINTER MY-LENGTH "MY-DOCUMENT". IF NOT XML-OK GO TO Z.