[DFDL-WG] Action 088 - define semantics of choiceKind 'fixedLength'
Tim Kimber
KIMBERT at uk.ibm.com
Wed Apr 14 06:47:19 CDT 2010
More work to do on this, but no time before the meeting. Let's discuss the
rules below, and refine afterwards:
If dfdl:choiceKind='fixedLength' then there must be at least one branch of
the choice for which all of the content has a calculable length.
Definition : A DFDL region is a region of the data stream described by the
DFDL grammar.
Note : we need to define this term - we use the term 'region' without
definition throughout the specification. Sometimes we call it a 'grammar
region'.
Definition: A DFDL region has a calculable length if the length of its
representation in units of bytes can be calculated from the DFDL
description alone.
The leading alignment region has a calculable length if the alignment of
the component is the same as the alignment of the parent.
The trailing alignment region has a calculable length if the alignment of
the component is the same as the alignment of the parent.
Q: Is this rule necessary?
The initiator region has a calculable length if all of the possible
initiator values have a calculable length.
An initiator value is a DFDL string literal. It has a calculable length if
the DFDL string literal does not contain any variable-length parts.
The terminator region has a calculable length if all of the possible
terminator values have a calculable length.
A terminator value is a DFDL string literal. It has a calculable length if
the DFDL string literal does not contain any variable-length parts.
A variable-length part is any of the following
- a character string in a variable-width encoding
- a DFLD entity in a variable-width encoding
- a DFDL generic entity which can match a variable number of characters (
NL, WSP+, WSP* )
The simple content region has a calculable length if both of the following
are true:
- either the encoding is a fixed-width encoding or the representation does
not contain characters.
- either lengthKind is 'explicit' and the length is not a DFDL expression
or lengthKind is 'implicit' and there is an implicit length for the simple
type and its dfdl:representation
The complex content region has a calculable length if all of the following
are true:
- either the encoding is a fixed-width encoding or the representation (
recursively ) does not contain characters.
- the element has lengthKind='explicit' and dfdl:length is not a DFDL
expression
- all group members, recursively, are required ( minOccurs=maxOccurs )
regards,
Tim Kimber, Common Transformation Team,
Hursley, UK
Internet: kimbert at uk.ibm.com
Tel. 01962-816742
Internal tel. 246742
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/20100414/920587b1/attachment.html
More information about the dfdl-wg
mailing list