This topic explains the key points of each of the nine sample message models used in the CSV sample.
This message illustrates the most simple comma separated value message model. In order to create a model for this message it is necessary to decompose the message and understand its structure. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_1 message in the sample message set, to examine its structure and logical properties. Note that the message contains a single element called 'customer' which repeats from 0 to -1 (unbounded) times. You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
This message adds a header record to the CSV message from CSV_1. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_2 message in the sample message set, to compare it's structure and logical properties with those of CSV_1. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
This message adds a trailer record to the CSV message from CSV_2. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_3 message in the sample message set, to compare it's structure and logical properties with those of CSV_2. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
This model correctly parses the instance message, but it also matches a message with multiple trailer records and with trailer records out of sequence. To avoid this a more elaborate model is needed. CSV_4 is an example of this.
This message is an alternative approach to modelling the same message as CSV_3. This model is based on the assumption that the trailer record is the last record in the message and is always present. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_4 message in the sample message set, to compare it's structure and logical properties with those of CSV_3. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
This model correctly parses the instance message. It always parses the last record as the trailer, and all preceding records as customer records.
This message builds on the message from CSV_4 to add support for double-quoted escaping of string fields to a single field. Enclosing a string field in quotes is a common way of allowing characters such as a comma (,) to appear in the data without conflicting with the metadata. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_5 message in the sample message set, to compare it's structure and logical properties with those of CSV_4. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
This model allows the field 'streetaddress' to be parsed with or without quotes. However this model leaves the quotes in the data. A more elaborate model such as that in CSV_6, is required.
This message is an alternative approach to modellng the same message as CSV_5. It separates the quoted and unquoted case, so that the quotes can be included in the metadata, and can be removed when the message is parsed, and added when it is serialized. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_6 message in the sample message set, to compare the structure and logical properties of the CSV_6 message against CSV_5. Note that this message contains a group reference to "streetaddress2" which is a choice of two other groups.
You can examine the 'CSV' physical properties of the message as defined in the model. Features that are worth noting include:
This model allows the field "streetaddress" to be parsed with or without quotes. Quotes are treated as part of the metadata. Quotes are added to the "streetaddress" field when it is serialized. It does not support including quotes in the data of the quoted streetaddress. This requires a slightly more elaborate model such as CSV_7.
This is an alternative approach to modeling the same message as CSV_6. It adds support for including double-quote characters in the data of the streetaddress field. A pair of double-quotes is replaced by a single double-quote in the data. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_7 message in the sample message set, to compare it's structure and logical properties with those of CSV_6. Note that this message contains a group reference to "streetaddress3" which is a choice of two other groups. You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
You can examine the "CSV" physical properties of the message set by opening the messageSet.mset file. Features that are worth noting include:
This model allows the field "streetaddress" to be parsed with or without quotes. Quotes are treated as part of the metadata. Quotes are added to the "streetaddress" field when it is serialized. It also supports including quotes in the data of the quoted streetaddress using double-quote as the escape character.
This message introduces the use of tags in a CSV message to make the model more flexible. If the first field of each CSV record is a unique identifier then it can be used as a tag. This makes modelling the header and trailer much simpler and allows greater flexibility. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_8 message in the sample message set, to examine it's structure and logical properties. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include:
The CSV message has unique tags on each record, which makes the model becomes much simpler. It also means that the message can include alternate record types, as in CSV_9.
This message builds on the message from CSV_8 to add a choice of different customer record in the body of the message. Using tags this becomes very simple. This diagram identifies the key items of metadata in this example CSV message, and shows the logical structure of the message as defined in the message set.
See Description of Comma Separated Value (CSV) sample messages for a textual description of the message as an alternaive to the image.
You can view the CSV_9 message in the sample message set, to compare it's structure and logical properties with those of CSV_8. Features that are worth noting include:
You can examine the "CSV" physical properties of the message as defined in the model. Features that are worth noting include: