An XML Format Example
The example in this section describes how to decode and encode XML data.
The example includes the following:
Workflow and Ultra configurations (ultra_xml_example.zip):
CSV_TO_XML_WF
 - Collects a CSV formatted file and converts it to XML. Optional fields that are not included in the CSV are populated in the workflow.XML_TO_CSV_WF
 - Collects am XML formatted file and converts it to CSV. Optional fields in the XML are discarded.ULTRA_CSV
 - CSV decoder and encoder.ULTRA_XML
 - XML decoder and encoder.
Input data in CSV format (INFILE01.txt).
Â
Follow these steps to run the example:
Download the example files toÂ
/opt/ultraXML
.Create the subdirectoryÂ
indata
 inÂ/opt/ultraXML
.CopyÂ
INFILE01.txt
 toÂ/opt/ultraXML/indata
.Open the System Importer and selectÂ
/opt/ultraXML/ultra_xml_example.zip
. Import all configurations.Start the workflowÂ
CSV_TO_XML_WF
. This creates an XML file based on the CSV input in the directoryÂ/opt/ultraXML/out
.Copy the generated XML file to the directoryÂ
/opt/UltraXML/indata
.Start the workflowÂ
XML_TO_CSV_WF
. A CSV file that is identical to the downloaded input file is created inÂ/opt/ultraXML/out
.
Below is a description of the Ultra configuration that is used for XML encoding and decoding.
Example - ULTRA_XML
To decode or encode XML data, a format definition (an XML Schema syntax) is included in Ultra xml_schema
block.
Collected XML UDRs are often terminated by one or several whitespace characters. When mapping, the whitespace temporary record is identified. Although input data that includes trailing whitespace characters is valid in XML, it is recommended that you eliminate them when decoding the data. To remove any excessive white spaces from the XML UDRs, the external format WhiteSpace
is used with the in_map
of the decoder. For further information see In-maps and Decoders.
The internal and external formats can be mapped automatically but are mapped explicitly in the example. This is to demonstrate how the interpretation of XML types works.
To get rid of white spaces, create a <literal>in_map</literal> for the external format WhiteSpace
using the discard_output
option. For further information, see the In-maps.Â
To remove as many white spaces as possible from the processed data, WS_map is set first in the deocder.