XML output (FORMAT XML)
When you specify FORMAT XML, UNLOAD PLUS performs the following functions:
- Encloses each field in a pair of XML tags as specified by the ENCLOSEDBY and AND options
- Optionally encloses each record in a pair of XML tags as specified by the SELECT_ELEMENT option
UNLOAD PLUS does not validate the XML tags to ensure that they conform to any XML standard.
Option restrictions
UNLOAD PLUS ignores the following options when you specify FORMAT XML:
- CNTLCARDS
- AUTOTAG
- RECORDID
- NULLTYPE
- CONSTRULES
- USELRECL YES
The INTO option is not valid when you specify FORMAT XML. UNLOAD PLUS issues an error message and terminates.
Additional considerations
UNLOAD PLUS does not support FORMAT XML when you are unloading Unicode, LOB, or XML data.
Importing XML output to other applications
Before you import the XML output into another application, you might need to add the following items to the XML output. See your XML parser’s documentation for additional information.
An XML declaration
Each XML parser supports a different set of encoding.
A set of tags for the root element
Some XML parsers require that you include a root element as the first element in your XML document. The root element contains the start tag at the beginning of your document and an end tag at the end of your document.
The following example illustrates the output that UNLOAD PLUS produces when you specify FORMAT XML. The declaration statement and root element tags were added outside of UNLOAD PLUS.