Converting XML record units set to Custom

If an output file is in XML format, and XML record unit is set to Custom, a different hierarchy can be specified as a record for each condition.

(1) Conversion from a Multi format file to an XML-format file

This section describes the example of conversion from a Multi format file to an XML format file.

This section describes the conversion when the XML record unit is set to Custom, taking as examples the following input file (Multi format), schema file, and XML information tree:

Figure 4.71 Input file

Figure 4.72 Schema file

Screen 4.37 XML information tree

a) Mapping for key value "HDR"

Mapping for the key value "HDR" is as shown below. No repetition is set here.

Screen 4.38 Mapping information (Key value: HDR)

b) Mapping for key value "DAT"

Mapping for the key value "DAT" is as shown below:

The contents model of DAT is set as the starting point of repetition. Therefore, the elements between <DAT-id> and </DAT-id>, <ORD-list> and </ORD-list>, <DTL-list> and </DTL-list> are output repeatedly for the number of records of key value "DAT".

Screen 4.39 Mapping information (key value: DAT)

c) Mapping for key value "ORD"

Mapping for the key value "ORD" is as shown below.

The contents model of ORD-list is set as the starting point of repetition. Therefore, the elements between <ORD> and </ORD> are output repeatedly for the number of records of key value "ORD".

Screen 4.40 Mapping information (key value: ORD)

d) Mapping for key value "DTL"

Mapping for the key value "DTL" is as shown below.

The contents model of DTL-list is set as the starting point of repetition. Therefore, the elements between <DTL> - </DTL> are output repeatedly for the number of records of key value "DTL".

Screen 4.41 Mapping information (key value: DTL)

When the input file is processed, processing proceeds as follows:

1. The key value of the first record is "HDR", so the HDR element is output.

2. The key value of the second record is "DAT", so the DAT-id element is output.

3. The key value of the third and fourth records is "ORD", so the ORD elements, which are the child elements of the ORD-list element, are output repeatedly.

4. The key value of the fifth record is "DTL", so the DTL element, which is the child element of the DTL-list element, is output.

5. The key value of the sixth record is "DAT". The contents model of DAT is set as the starting point of repetition, so the second DAT-id element is output.

6. The key value of the seventh record is "ORD", so the ORD element, which is the child element of the second ORD-list element, is output.

7. The key value of the eighth and ninth records is "DTL", so the DTL elements, which are the child elements of the second DTL-list element, are output repeatedly.

 

The output file is as follows:

Figure 4.73 Output file

(2) Conversion from a CSV-format file to an XML-format file

This section describes an example of conversion of an input file from CSV format to XML format.

The output might be different depending on the contents model you set as the starting point of repetition. The conversion is described for each starting point of repetition.

Figure 4.74 Input file

Figure 4.75 Schema file

a) If the contents model "item1" is set as the starting point of repetition

If you set the contents model as the starting point of repetition, the mapping becomes as follows:

"item1" is set as the starting point of repetition, so the elements between <item1> and </item1> are output repeatedly for the number of records of key value "item1".

Screen 4.42 XML information tree

The output file is as follows:

Figure 4.76 Output file

b) If the contents model "item3" is set as the starting point of repetition

If you set the contents model as the starting point of repetition, the mapping becomes as follows:

"item3" is set as the starting point of repetition, so the elements between <item3> and </item3> are output repeatedly for the number of records of key value "item3".

Screen 4.43 XML information tree

The output file is as follows:

Figure 4.77 Output file