[DFDL-WG] Clarification: zero-bit-long integer parses to value 0, or parse-error or?

Mike Beckerle mbeckerle.dfdl at gmail.com
Thu Mar 19 18:49:56 EDT 2020


Consider:

<xs:element name="spare" dfdl:length="{ $tns:WordPaddingBits }">
  <xs:simpleType dfdl:lengthKind="explicit">
   <xs:annotation>
    <xs:appinfo source="http://www.ogf.org/dfdl/">
      <dfdl:assert test="{ . eq 0 }" />
    </xs:appinfo>
   </xs:annotation>
   <xs:restriction base="xs:unsignedInt">
    <xs:enumeration value="0" />
   </xs:restriction>
  </xs:simpleType>
</xs:element>

Now, suppose the variable tns:WordPaddingBits has value 0.

So this padding integer will be length 0 (this binary data with
lengthUnits bits).

Currently, Daffodil gives a runtime SDE on this. The assert test
expression complains that "." has no value.
I would claim this should either provide a value of 0 for this
integer, or it should be a parse error because you must have at least
1 bit.

Thoughts?

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Owl Cyber Defense |
www.owlcyberdefense.com (Tresys is now part of Owl)
Please note: Contributions to the DFDL Workgroup's email discussions are
subject to the OGF Intellectual Property Policy
<http://www.ogf.org/About/abt_policies.php>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20200319/2c6237e1/attachment-0001.html>


More information about the dfdl-wg mailing list