This topic explains how to create your own DFDL schema files to model CSV formatted data, and explains the structure of each DFDL schema file that is used in the CSV sample.
To create a DFDL schema file to model CSV formatted data:
The DFDL schema editor opens, and your new DFDL schema file is displayed. Your DFDL schema file can be edited if required.
When creating a DFDL schema file from the New Message Model wizard, each element is given a default name. To rename an element in your DFDL schema file, double-click the element in the Name column, type the new name for the element, and press Enter.
By default, the type of every element is set to String. To change the type of an element, select the element, then click the Type column.
The following diagram displays a DFDL schema file that models the simplest type of CSV message. The diagram identifies the key items in the CSV message, and shows the logical structure that is defined in the DFDL schema file.
You can view the logical and physical properties that are defined by the DFDL schema file, CSV_1, by selecting CSV_1.xsd from the Integration project, CSVSchemas. Note that the message contains a single element called customer which has maxOccurs set to unbounded.
This DFDL schema file defines the same CSV message structure as CSV_1, and extends it with a header. The following diagram identifies the key items in the CSV message, and shows the logical structure that is defined in the DFDL schema file.
You can view the logical and physical properties that are defined by the DFDL schema, CSV_2, by selecting CSV_2.xsd from the Integration project, CSVSchemas.
This DFDL schema file defines the same CSV message structure as CSV_2, and extends it by adding a choice under the customer element. This choice allows the repeating CSV data to contain different structures for each repeating element. The following diagram identifies the key items in the CSV message, and shows the logical structure that is defined in the DFDL schema file.
You can view the logical and physical properties that are defined by the DFDL schema file, CSV_3, by selecting CSV_3.xsd from the Integration project, CSVSchemas.