XML output (FORMAT XML)
To produce an output file in which the unloaded data is formatted with XML tags, specify FORMAT XML.
Optionally, you can specify additional keywords. XML options are SELECT_ELEMENT, ENCLOSEDBY, AND, and NULLSTRING. When you use more than one option, the syntax must follow the sequence in the XML syntax diagram. For example, if you specify SELECT_ELEMENT, that option must appear before ENCLOSEDBY or NULLSTRING.
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 restrictionsUNLOAD 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 considerationsUNLOAD PLUS does not support FORMAT XML when you are unloading Unicode, LOB, or XML data.
Importing XML output to other applicationsBefore 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.
Related topics