ࡱ > z | y ` 0 bjbj .p 4 j . . . . , . ? 0 0 0 0 0 0 0 0 m? o? o? o? o? o? o? $ @ h BC x ? ( 0 * 0 0 1 11 ? 0 0 ? 9 9 9 A1 0 0 m? 9 0 m? 9 9 9 0 0 þO . 7 9 A; , ? 0 ? 9 C 7 C 9 9 J C 6 A: 0 0 9 0 0 0 0 0 ? ? 9 0 0 0 ? 0 0 0 0 $
2007-08-10
DFDL Proposal to simplify length and occurs specification properties.
Version 003
This proposal expands on a theme suggested early on by Kris Rose, and subsequently by Simon Parker.
The goal is to decouple the multiple properties from eachother as much as possible and remove meaningless combinations.
This first table for scalar lengths.
Note that in draft v1 I forgot nullTerminated and endOfData in the Original lengthKind description, so Ive added those here so that original is more correct.
All proposals below continue to use prefixLength and prefixLengthIncludesPrefix properties for the prefix style of length.
PropertyValues/Description
OriginallengthKindfixed, schemaFacet, xpath, prefixed, delimited, nullTerminated, endOfData, regularExpressionlengthliteral or xpath or regular expression based on lengthKindlengthUnitsbits, bytes, characters, fullUnicodeCharacters, digits
We agreed to drop digits and fullUnicodeCharacters from lengthUnits.
Agreed
Simplification
To lengthUnitslengthKindfixed, schemaFacet, xpath, prefixed, delimited, nullTerminated, endOfData, regularExpressionlengthliteral or xpath or regular expression based on lengthKindlengthUnitsbits, bytes, characters
Two ideas were discussed for even further simplification:
Plan A
Further SimplificationlengthKindexplicit, schemaFacet, prefixed, delimited, nullTerminated, endOfDatalengthliteral or xpath or regexp by special syntaxlengthUnitsbits, bytes, characters
Plan B
Further SimplificationlengthInBitsliteral value or xpath expression (recognized by special syntax - braces), or special token prefixedlengthInBytesliteral value or xpath expression (recognized by special syntax - braces) or special token prefixedlengthInCharactersliteral number, xpath expression , or regexp (recognized by special syntax - tbd) or special token prefixedlengthKinddelimited, endOfData, nullTerminated, schemaFacet
This second table is for vector (occurs) lengths:
In draft v1, I had valueDelimited, which is not consistent with the spec. The spec has stopValue=. Where you specify the value to be used as the value delimiter or stop value.
I do not mention the occursSeparator property here, but it is used orthogonally to the use of occursKind. That is, occursKind can be explicit with occurs=10, but if occursSeparator is specified, then 9 of them must be found between the elements.
OriginaloccursKindfixed, xpath, delimited, stopValue, regularExpressionoccursPathliteral or xpathoccursUnitsbytes, bits, items (I think characters and fullUnicodeCharacters are also needed here but are not in doc draft 019.)stopValueLiteral or expression that gives value used to determine end.
Plan AoccursPathliteral or xpath or regularExpression by special syntax or token delimited or token stopValueoccursUnitsBits, bytes, characters, itemsstopValueLiteral or expression that gives value used to determine end.
Plan BoccursInBitsliteral value or xpath expression (recognized by special syntax - braces)occursInBytesliteral value or xpath expression (recognized by special syntax - braces)occursInCharactersliteral number, xpath expression , or regexp (recognized by special syntax)occursInItemsliteral number, xpath expression (recognized by special syntax - braces)occursKinddelimited, endOfData, stopValuestopValueLiteral or expression that gives value used to determine end when occursKind=stopValue
Note: perhaps occursInBits is meaningless? I have never seen this for arrays, though lengthInBits is clearly used for bit fields.
Plan C was suggested by Simon Parker. The occurs units are always items in this case.
You achieve the equivalent of lengthInBytes by enclosing the array in a sequence where the sequence has lengthInBytes=. which constraints the length the array must live within. This eliminates the need for occursUnits property entirely at the expense of making people introduce this sequence. Note that if their array already has a initiator/terminator then they already need to wrap in a sequence since specifying initiator/terminator on an array element is specifying each element inside the arrays initiator and terminator.
Plan Ccccursliteral or xpath occursKindDelimited or stopValue or explicit or endOfData (tbd: or schemaFacet?)stopValueLiteral or expression that gives value used to determine end when the occursKind=stopValue.
Note: I considered further collapsing occursKinds enums as special tokens on the occurs property; however, this makes it impossible to express the combinations of fixed length with delimiters. E.,g., 1,2,3,4 as occurs=4, occursKind=delimited, occursSeparator=,
Clarifications:
occursKind=delimited means the occurs count is determined by finding a terminator of an enclosing sequence or element.
Therefore occursSeparator and stopValue can be used together to describe 1,2,3,,-. Also occursKind=explicit and occurs=10 and occursSeparator can be used together.
Length by container capacity
Allow length, lengthUnits, and lengthKind to be specified on sequences.
Examples:
String maximum length 256, allocated always 256, stored actual length.
Array of records fitting into 64KByte buffer.
New,
New.
New.
U _ ` @ f
/ Y Z [
!
"
9
Ҿxttxx h h CJ OJ QJ ^J aJ hY h}T h f CJ OJ QJ ^J aJ h}T CJ aJ h}T CJ OJ QJ ^J aJ h;E h\^ CJ aJ &h\^ 56CJ OJ QJ \]^J aJ h\^ CJ OJ QJ ^J aJ h)* h;U h.f hiM h hoV h\^ hN *
T U a b @ A f g
$$If a$gd; $If gd; gdiM
{ r r $If gd(y $$If a$gd(y v kd $$If l F cN
% , E 0*6 4 4
l ap Z ~ ~ ~ $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap Z [ \ h ~ ~ ~ $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap t y y y p p $If gd(y $$If a$gd(y w kd $$If l 4 F cN
%, E 0*6 4 4
l ap t u v } ~ ~ ~ $If gd(y w kdx $$If l 4 F cN
%, E 0*6 4 4
l ap ~ ~ ~ $If gd(y w kd] $$If l 4 F cN
%, E 0*6 4 4
l ap
"
9
D
y y p p $If gd(y $$If a$gd(y w kdB $$If l 4 F cN
%, E 0*6 4 4
l ap
{ r r $If gd(y $$If a$gd}T w kd' $$If l 4 F cN
%, E 0*6 4 4
l ap
{ r r $If gd(y $$If a$gd}T w kd $$If l 4 F cN
%, E 0*6 4 4
l ap
{ y y p p $If gd; $$If a$gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap
] z { | W s t u B C ~p~p h|b CJ OJ QJ ^J aJ hn CJ OJ QJ ^J aJ h2A CJ aJ h2A CJ OJ QJ ^J aJ j h* 0J UhVr hC hC h\^ h.f h\^ CJ aJ hu^| CJ OJ QJ ^J aJ h\^ CJ OJ QJ ^J aJ h CJ OJ QJ ^J aJ hp CJ OJ QJ ^J aJ ({ | } ~ ~ ~ $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap t ~ ~ ~ $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap t u v ~ ~ ~ $If gd; w kd
$$If l 4F cN
%, E 0*6 4 4
l ap y p p $If gd; $$If a$gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap ~ ~ ~ $If gd; w kdj $$If l 4 F cN
%, E 0*6 4 4
l ap
~ ~ ~ $If gd; w kd]
$$If l 4 F cN
%, E 0*6 4 4
l ap ~ ~ ~ $If gd; w kdB $$If l 4 F cN
%, E 0*6 4 4
l ap C y p p $If gd(y $$If a$gdn w kd $$If l 4 F cN
%, E 0*6 4 4
l ap C D E Q p ~ ~ ~ $If gd(y w kd $$If l 4 F cN
%, E 0*6 4 4
l ap C D p q v w / 0 1 4 5 W ` a b K W ʴvvv hF CJ OJ QJ ^J aJ hcc" CJ OJ QJ ^J aJ hF h hq h h\^ h'H CJ OJ QJ ^J aJ h CJ OJ QJ ^J aJ h\^ CJ aJ h\^ CJ OJ QJ ^J aJ h)T CJ OJ QJ ^J aJ hC h|b CJ OJ QJ ^J aJ h|b CJ aJ +p q r | ~ ~ ~ $If gd(y w kd $$If l 4 F cN
%, E 0*6 4 4
l ap y p p $If gd; $$If a$gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap , v ~ ~ ~ $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap v w x ~ ~ ~ $If gd; w kdh $$If l 4 F cN
%, E 0*6 4 4
l ap 0 ~ ~ ~ $If gd; w kdM $$If l 4F cN
%, E 0*6 4 4
l ap 0 1 2 4 ~ r $$If a$gd; $If gd; w kd2 $$If l 4 F cN
%, E 0*6 4 4
l ap 4 5 6 A a $If gd; _ kd $$If l 4 0 c%, $ 0*6 4 4
l ap a b c m ~ u u $If gd(y $If gd; w kd $$If l 4 F cN
%, E 0*6 4 4
l ap K L y p p $If gd(y $$If a$gdcc" w kd $$If l 4 F cN
%, E 0*6 4 4
l ap
, { r r $If gd(y $$If a$gdcc" w kd $$If l 4 F cN
%, E 0*6 4 4
l ap + , - i 7 ~ > ? H I Ƹθ|xt h* h^N huI j h* 0J Uh h%M h- h: hy j h"WF 0J UheC h9&