Selecting items for the XML Output (DataStage®)
The default XML output includes the following items:
- XML declaration
- Comment, which identifies the generation date and XML Output as the generator
- XML hierarchy
<?xml version="1.0" ?> <!-- - Generated by IBM Corporation, DataStage - XMLOutput stage - - Date --> <root> ... </root>
Adding elements
Using the Document Settings options, you can add the following items to the generated output:
- Document type declaration
- Header elements
- Namespace declaration
- Nested XML chunk
The complete list is arranged in the following order:
<?xml version='1.0'>
<!-- comment -->
<document_type_declaration>
<header_elements>
<root namespace_declaration>
<nested_XML_chunk>
</root>
About document type declarations and nested chunks
A valid XML document conforms to a DTD or XML schema. Using the document type declaration, you can specify a DTD. When using a nested chunk, which can contain any well-formed XML fragment, you can specify an inline schema.
About headers
Headers
include comments and processing instructions, such as xml-stylesheet
, that are
inserted between the XML declaration and the root element. For example:
<?xml version='1.0'>
<?xml-stylesheet type="text/xsl" href="my.xsl"?>
<root>
About namespace declarations
In this context, the namespace declarations that you specify are inserted within the root element tag.
For more information about including these optional items in the final XML, see Document settings page.
Excluding the generated comment
You can exclude generated comment from the output. For more information, see Document settings page.
Generating XML fragments
You can generate an XML fragment, which excludes the XML declaration, the generated comment, headers, and document type declarations. This is useful when your generated XML needs to be combined with other documents.
For information about generating an XML fragment, see Document settings page.