Function
The CLOSE DOCUMENT statement terminates processing of a complete XML document or of a subdocument and adjusts existing assignments of elements or attributes from the XML document to data items.
Format
CLOSE DOCUMENT file-name-1
Syntax rules
file-name-1 must be the name of a file with organization XML.
General rules
If the file-name-1 file is not open, the CLOSE DOCUMENT statement is not successful and the I-O status of the file is set to 4B.
If no XML document is open in the file-name-1 file, the CLOSE DOCUMENT statement is not successful and the I-O status of the file is set to 4D.
The behavior of the statement depends on the STACK phrase which was entered for the last OPEN DOCUMENT statement that was executed successfully for file-name-1:
STACK specified:
The EPV is reset to the status it had before the OPEN DOCUMENT statement. The internal representation of the XML document is retained unchanged.STACK not specified:
All positions in the EPV are set to 'invalid' and the internal representation of the XML document is released.
The CLOSE DOCUMENT statement only terminates processing of an XML document, but not processing of the file.