Message Sets: Specifying data element separation methods to model a message
Specify the appropriate method of data element separation to identify data elements in a TDS message.
Elements of data in a TDS message are identified according to the data element separation method that you must specify for the Data Element Separation property for a complex type. Depending on the value that you have set for Data Element Separation, the properties Tag Data Separator and Delimiter (for a message set and a complex type) might also be required to identify each element.
The following describes the methods that you can specify for each complex type. The examples given are all based on a complex type that contains three elements of type STRING. The Tag Data Separator, where used, is the colon (:), and the Delimiter, where used, is the asterisk (*).
- Tagged Delimited
- Each data value is preceded by a tag that is specified as an element
property. If the tag has an associated Length
of Tag, indicating that the tag has a fixed length, each
data value follows immediately after the tag. If the tag is not specified
as fixed length, the tag is separated from the next element by a Tag Data Separator. Each data
value is separated from the next by a Delimiter.
There is no Delimiter after
the last element in the complex type.
The following example shows tags of fixed length:
tag1data1*tag2data2*tag3data3
The following example shows tags of variable length:
tag1:data1*tag11:data2*tag111:data3
- Tagged Fixed Length
- This method is the similar to Tagged Delimited, but the data values
are always fixed length. Therefore, no delimiter is required after
each data value. The tags themselves can be fixed length or variable
length, depending the setting of Tag
Data Separator and Length
of Tag.
The following example shows tags of fixed length:
tag1data1tag2data2tag3data3
The following example shows tags of variable length:
tag1:data1tag11:data2tag111:data3
- Tagged Encoded Length
- This method has a tag and a length field before the data. It indicates
to the parser that following each tag in the bit stream there is data
defining the length of data to be associated with that tag. You must
set the Length of Encoded Length parameter.
If the value in Length of Encoded
Length includes extra characters, you must also set the Extra Chars in Encoded Length parameter.
The following example shows a tag of fixed length of four characters (Length of Tag has been set to four), a three-character length field (Length of Encoded Length has been set to three), and several characters of data. Extra Chars in Encoded Length has been set to zero:
Given the bit stream above, the parser finds the tag "tagA" and extracts the length value 7. Because Extra Chars in Encoded Length is set to zero, the next seven (7 - 0) characters are the data. Then follow the characters for the next tag "tagB" and the length value of 6, and so on for tag "tagC". In each case in this example, the value in the length field is exactly the length of data.tagA007dataAAAtagB006dataBBtagC009dataCCCCC
The following example shows tags with a fixed length of four characters (Length of Tag has been set to four), a three-character length field (Length of Encoded Length has been set to three), and several characters of data. Extra Chars in Encoded Length has been set to three (because in this example the length field value includes the three-character length field as well as the data field):
Given the bit stream above, after "tagA" the parser extracts the length value 12. But because Extra Chars in Encoded Length is set to three, only the next nine (12 - 3) characters are the data. Then follow the characters for "tagB" and length value 10, and so on. In each case in this example, the value in the length field is three more than the actual length of data.tagA012dataAAAAAtagB010dataBBBtagC016dataCCCCCCCCC
- All Elements Delimited
- The data values have no tag, but each data value is separated
from the next by a delimiter.
The following example shows this:
data1*data2*data3
- Variable Length Elements Delimited
- If a data element is fixed length, the next data value follows
immediately after it. If the data element is variable length, the
next data value is separated from it by the delimiter. There are no
tags.
The following example shows element 2 as fixed length, and elements 1 and 3 as variable length:
data1*data2data3
- Use Data Pattern
- The data associated with each element is determined by the parser
matching the data with the regular expression in the Data Pattern property for that
element. The TDS parser uses the regular expression in the Data Pattern to:
- Determine the length of data to associate with each element.
- Determine if, in the case of a repeating element, another occurrence of an element is present in the bit stream.
- Determine the presence (if the pattern is matched) or absence (if the pattern is not matched) of an element in the bit stream.
The following example shows three elements, each having the regular expression Data Pattern shown:
The first Data Pattern means "from one to three characters in the range A to Z", the second means "one or more characters in the range 0 to 9", and the third means "zero or more characters in the range a to z". Notice how each element's data was terminated by the first character that did not match the element's Data Pattern.First Data Pattern = [A-Z]{1,3} Second Data Pattern = [0-9]+ Third Data Pattern = [a-z]* Message data = 'DT31758934information for you' First element data: 'DT' Second element data: '31758934' Third element data: 'information'
- Fixed Length
- All elements are fixed length, and each data value immediately
follows the next with no delimiter. There are no tags.
The following example shows this:
data1data2data3
- Fixed Length AL3
- This method is the same as Fixed Length, but it also notifies the parser to implement a number of rules in relation to missing elements, length encoding, and versioning that are predefined in the ACORD AL3 standard.
- Undefined
- This value is set automatically when you set the Type Composition property of
a complex type to Message,
and you cannot set it to any other value. You are also unable to set
values for the TDS Type properties Group
Indicator, Group Terminator, Tag Data Separator, Length of Tag, and Delimiter.
If you set the Data Element Separation method to Undefined, you must not set the Type Composition property to Empty, Choice, Unordered Set, Ordered Set, Sequence, or Simple Unordered Set.
For more information about Type Composition set to Message, see Message Sets: Multipart messages.