There are of course alternatives.

E.g., a hidden or non-hidden field which is a byte array or hexBinary to absorb the padding bytes at the ends of the shorter variants. Or one could put trailing skip bytes on the last element  or group of each of the shorter variants.

One can also encapsulate the whole choice in a sequence whose length is the fixed maximum length. This is my personal favorite, since it uses the FinalUnused that is already in the grammar.

E.g., suppose the length of the longest variant is 258 bytes.

<sequence dfdl:lengthKind="explicit" dfdl:length="258" dfdl:lengthUnits="bytes" dfdl:applies="hereOnly">
    <choice>
         .....
   </choice>
</sequence>

The only thing I don't like about this is I don't have a way to express the length other than to hard-code the constant 258, but since tooling would typically put this in based on Cobol descriptors or other information I don't mind so much.

...mikeb


Mike Beckerle
STSM, Architect, Scalable Computing
IBM Software Group
Information Platform and Solutions
Westborough, MA 01581
direct: voice and FAX 508-599-7148
assistant: Pam Riordan  
                 priordan@us.ibm.com
                 508-599-7046




Steve Hanson/UK/IBM@IBMGB

11/16/2007 11:24 AM

To
Mike Beckerle/Worcester/IBM
cc
dfdl-wg@ogf.org
Subject
Re: [DFDL-WG] Grammar as adapted to infosetLink




Hi Mike

One extra thought post-call, caused by thinking about the FinalUnused  part of a sequence. Some fixed length choices have a rule that each branch of the choice must be of equal length. This results in unused bytes for branches shorter than the maximum.  In a bitstream instance, a user will see these bytes. Perhaps the grammar should acknowledge their existence, even if there are no DFDL properties to express the bytes (like FinalUnused)?

Regards, Steve

Steve Hanson
WebSphere Message Brokers
Hursley, UK
Internet: smh@uk.ibm.com
Phone (+44)/(0) 1962-815848



Mike Beckerle <beckerle@us.ibm.com>
Sent by: dfdl-wg-bounces@ogf.org

10/11/2007 00:16

To
dfdl-wg@ogf.org
cc
Subject
[DFDL-WG] Grammar as adapted to infoset






I took a crack at this. I ripped it out of the main document for faster review/turnaround.


I think this matches the latest infoset email diagram.




Mike Beckerle
STSM, Architect, Scalable Computing
IBM Software Group
Information Platform and Solutions
Westborough, MA 01581
direct: voice and FAX 508-599-7148
assistant: Pam Riordan  
                priordan@us.ibm.com
                508-599-7046
--
 dfdl-wg mailing list
 dfdl-wg@ogf.org
 http://www.ogf.org/mailman/listinfo/dfdl-wg