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 methods that you can specify for each complex type are described below. 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 (*).
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
The following example shows tags of fixed length:
tag1data1tag2data2tag3data3
The following example shows tags of variable length:
tag1:data1tag11:data2tag111:data3
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:
tagA007dataAAAtagB006dataBBtagC009dataCCCCCGiven 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.
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):
tagA012dataAAAAAtagB010dataBBBtagC016dataCCCCCCCCCGiven 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.
The following example shows this:
data1*data2*data3
The following example shows element 2 as fixed length, and elements 1 and 3 as variable length:
data1*data2data3
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'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.
The following example shows this:
data1data2data3
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 Multipart messages.