Conversion from a format file to an XML-format file

 

This section describes the conversion from a format file to an XML format file for each setting of the XML record unit, taking as examples the following input file, schema file, and mapping information:

 

Figure 4.46 Input file

Figure 4.47 Schema file (XML information)

Screen 4.20 Mapping information

(1) If the XML record unit is "1"

One record of the input file corresponds to one root element <root> of the output file. Because only one root element exists for each file, one output file is created for every record of the input file.

Figure 4.48 Output file

(2) If the XML record unit is "2"

One record of the input file corresponds to one element of the level just below the root element <root> of the output file. In this example, the same number of elements <A> as the number of records of input files (four in this case) are output.

Figure 4.49 Output file

(3) If the XML record unit is "3"

One record of the input file corresponds to one element of the level that is two levels below the root element <root> of the output file. In this example, the same number of elements <AA> as the number of records of input files (four in this case) are output.

Figure 4.50 Output file

(4) If the XML record unit is "Custom"

For one record of the input file, you can handle any level in the output file as one record.

In the Set Mapping Information screen, right-click the contents model containing its child elements, which is the level that you want to process as a record, or the element that you want to process as a record. Then, click Use this as base point for repetition from the context menu.

When the contents model or element is set as the starting point of repetition, the icon turns pink and the names are displayed in bold type in the mapping screen.

Screen 4.21 Setting the starting point of repetition

The output file depends on which contents model or element is set as the starting point of repetition, as described below.

a) If the starting point of repetition is not set

No repetition is specified, so only the last record is output, even if there are multiple input records.

Figure 4.51 Output file

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

If you set the contents model sequence of root as the starting point of repetition, the element A is processed as one record. Therefore, the elements between <A> and </A> are output repeatedly for the number of input records.

Screen 4.22 Setting to repeat the element A

Figure 4.52 Output file

c) If the contents model of the element A is set as the starting point of repetition

If you set the contents model sequence of the element A as the starting point of repetition, the element AA is processed as one record. Therefore, the elements between <AA> and </AA> are output repeatedly for the number of input records.

Screen 4.23 Setting to repeat the element AA

Figure 4.53 Output file

d) If the contents model of the element AA is set as the starting point of repetition

If you set the contents model sequence of the element AA as the starting point of repetition, the elements item1, item2, and item3 are processed as one record. Therefore, the elements between <item1> and </item1>, <item2> and </item2>, and <item3> and </item3> are output repeatedly for the number of input records.

Screen 4.24 Setting to repeat elements between item1 and item3

Figure 4.54 Output file

e) If the element A is set as the starting point of repetition

If you set the element A as the starting point of repetition, the element A is processed as one record. Therefore, the elements between <A> and </A> are output repeatedly for the number of input records.

Screen 4.25 Setting to repeat the element A

Figure 4.55 Output file

f) If the element AA is set as the starting point of repetition

If you set the element AA as the starting point of repetition, the element AA is processed as one record.

Therefore, the elements between <AA> and </AA> are output repeatedly for the number of input records.

Screen 4.26 Setting to repeat the element AA

Figure 4.56 Output file