[DFDL-WG] spec bug dfdl:choiceLength says 'bytes' should use dfdl:lengthUnits

Steve Hanson smh at uk.ibm.com
Fri Dec 16 04:21:47 EST 2016


Mike

dfdl:lengthUnits is not currently used by dfdl:choice. If by erratum we 
changed this, existing schemas could break as they would suddenly pick up 
the value from scope. We have a couple of alternatives:

1) A new property dfdl:choiceLengthUnits with enums 'bytes' and 'bits' 
(not seen a use case for 'characters').  For compatibility, an 
implementation would need to default the value to 'bytes' if not set 
locally or in scope, rather than give an error. **

2) New enum for dfdl:choiceLengthKind 'explicitBits' which causes the 
dfdl:choiceLength to be interpreted as a bit count. Avoids the default 
pitfall, but is architecturally inconsistent with 
lengthKind/length/lengthUnits.

** IBM DFDL had to do a similar thing when dfdl:encodingErrorPolicy was 
added to avoid breaking existing schemas. Alternative is to bump the DFDL 
version number.

Regards
 
Steve Hanson
IBM Hybrid Integration, Hursley, UK
Architect, IBM DFDL
Co-Chair, OGF DFDL Working Group
smh at uk.ibm.com
tel:+44-1962-815848
mob:+44-7717-378890



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>
Date:   15/12/2016 16:04
Subject:        [DFDL-WG] spec bug dfdl:choiceLength says 'bytes' should 
use     dfdl:lengthUnits
Sent by:        "dfdl-wg" <dfdl-wg-bounces at ogf.org>




for dfdl:choiceLength, the description says "Specifies the length of the 
choice in bytes..." clearly this should use dfdl:lengthUnits. 

We have tons of cases where byte granularity is not sufficient, and this 
is hard to work around. You have to use dfdl:choiceLengthKind='implicit' 
and then carefully pad the branches to the same length in bits. It's 
painful. 

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | 
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are 
subject to the OGF Intellectual Property Policy
--
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  https://www.ogf.org/mailman/listinfo/dfdl-wg


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20161216/1841863b/attachment.html>


More information about the dfdl-wg mailing list