Byte Value Entities are mostly not implemented in Daffodil.

They are described in
6.3.1.4      DFDL Byte Value Entities in DFDL String Literals
They are not implemented (mostly) because they create some difficult 
implementation issues.

We do accept that syntax in just a few places e.g., I think dfdl:fillByte.

The syntax %#83; is whatever unicode character has code point 83 (decimal). If 
you want a hex code point then %#x53; is the same character.

In UTF-16, which has 16-bit code points, a character specified as %#83; or 
%#x53; is still a character, meaning occupies a full 16-bits for its code point.

This differs from %#r83; because even in a 2 byte character set like UTF-16, a 
%#r83; expects/puts a single byte in the data stream, which distorts the proper 
well-formed nature of the string as a sequence of UTF-16 characters, but 
nevertheless was a feature we found was needed in DFDL because sometimes people 
do funny things with separating text in binary data using illegal bit patterns 
that don't make sense as characters.

________________________________
From: Costello, Roger L. <[email protected]>
Sent: Monday, September 9, 2019 11:03 AM
To: [email protected] <[email protected]>
Subject: What is a Byte Value entity?


The specification says this about initiators:



DFDL Byte Value entities ( %#r ) are allowed.



What’s a Byte Value entity? I see in the specification something called a Byte 
Value, but nothing called a Byte Value entity.



Speaking of Byte Value, Table 2 has this:



ByteValue  ::= '%#r' [0-9a-fA-F]{2} ';'



Is that correct?



The way I read it, a Byte Value is the literal string %#r followed by two hex 
digits followed by a semi-colon. So, that means this is legal:



                %#r83;



But Daffodil doesn’t like that. On the other hand, Daffodil likes this:



                %#83;



Note that there is no “r” in the latter.



Typo in the specification?



/Roger

Reply via email to