Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7.0
-
None
Description
The tdml:documentPart type='byte' element only interprets hex digit characters. The documentPart bits only interprets 1 and 0.
For bits, this makes it tempting to put labels in the data like:
<tdml:documentPart type="bits"><![CDATA[
01 flagByte1
1 bool2
]]></tdml:documentPart>
As soon as the label contains a 1 or 0, you are in trouble though, because then that part of the label is getting pikced up as data. The above data is 0111, the 2nd 1-bit is from the word 'flagByte1'.
Nevertheless, if you are careful, with bits you can get away with labels.
But, then if you try to do the same thing for documentPart type byte, all hell breaks loose.because letters a-f and 0-9 all are interperted as hex data even though other characters like ghi....z get ignored.
This is all way too fragile.
Lesson learned is that we need the ability to put labels inside TDML documentPart data areas. Breaking them up into separate documentPart elements so you can use standard XML Comments is not effective enough due to the clutter involved.
It is very important to be able to put labels into data.
So we need to do two things:
1) make document part type 'byte' and 'bit' reject any character other than 0-9a-fA-F (for byte) and 0,1 (for bits) that isn't whitespace.
2) support a comment syntax. I suggest the C/C++ conventions of // (to end of line - which is going to require use of a CDATA block since otherwise the line-endings are fungible by XML) or the /* */ convention.