TDS supports the handling of null values within messages, provided that the logical Nillable property of the element is set.
You can use the message set property Boolean Null Representation to specify the value to be used for Boolean Null representation. You can use the object properties Encoding Null and Encoding Null Value to control how null handling is represented for individual objects.
You can select the Encoding Null property from the enumerated values NULLPadFill, NULLLogicalValue, NULLLiteralValue, and NULLLiteralFill:
tag1:,is written out, where tag1 is the tag for the variable length element with NULLPadFill set, ":" is the tag data separator, and "," is the delimiter.
If the literal value is shorter, the Encoding Null Value is padded (using Padding Character) on output. On input, if the NULLLiteralValue's length does not match the Length field, set the message set level Trim Fix Len String property so that padded nulls are correctly parsed.
The use of the Encoding Null Value property is dependent on the value that you select for the Encoding Null property described above. Null values are not defined for binary types. The properties Encoding Null and Encoding Null Value are therefore not set for binary types.
This is Line 1<CR><LF> <CR><LF> This is Line 3<CR><LF> This is Line 4If the TDS property Suppress Absent Element Delimiters of the parent complex type is set to Never, such a message is successfully parsed, but the blank line does not appear in the message tree:
MRM - line1 = 'This is Line 1' - line3 = 'This is Line 3' - line4 = 'This is Line 4'
MRM - line1 = 'This is Line 1' - line2 = NULL - line3 = 'This is Line 3' - line4 = 'This is Line 4'
The example above assumes that each line is modeled as an element of simple type string. If each line is modeled as an element of complex type, with each line consisting of a repeating number of word elements, set the three null handling properties on the word element instead, because an element of complex type can not have a null value.
MRM - line1 - word = 'This' - word = 'is' - word = 'Line' - word = '1' - line2 - word = NULL - line3 - word = 'This' - word = 'is' - word = 'Line' - word = '3' - line4 - word = 'This' - word = 'is' - word = 'Line' - word = '4'