[DFDL-WG] alignment questions

Steve Hanson smh at uk.ibm.com
Wed Mar 26 12:21:28 EDT 2014


Mike

Looking at leadingSkip, spec says "A non-negative number of bytes or bits, 
depending on dfdl:alignmentUnits, to skip before alignment is applied" (my 
emphasis). And this is matched by the grammar which says: "
LeadingAlignment = LeadingSkip AlignmentFill" Together these imply that 
any application of leadingSkip takes place before the calculation of the 
AlignmentFill region, and so is not itself aware of alignment. 

Same deal for trailingSkip.

For it to be otherwise, I think the grammar would have to include 
'leadingSkipFill' and 'trailingSkipFill' regions.

-------------------------------
While researching this, I noted that the spec says: 

"The length of the AlignmentFill region is measured in bits. If 
alignmentUnits is 'bytes' then we multiply the alignment value by 8 to get 
the bit alignment, B. If the current position (first position after the 
end of the previous element) value is bit position N, then the length of 
the AlignmentFill region is the smallest non-negative integer L such that 
(L + N) mod B = 1.  The position of the first bit of the aligned element 
is P = L + N."

I read that as saying byte alignment moves you on to a byte boundary. 
Fine, but it doesn't say anything about the effect of leadingSkip. It also 
uses 'element' instead of 'component'. And the start of a component is not 
always straight after the end of the previous component - think about the 
first component in a parent where parent has leading framing. I think this 
should be:

"The length of the AlignmentFill region is measured in bits. If 
alignmentUnits is 'bytes' then we multiply the alignment value by 8 to get 
the bit alignment, B. If the position in the data stream of the start of 
the AlignmentFill region is bit position N, then the length of the 
AlignmentFill region is the smallest non-negative integer L such that (L + 
N) mod B = 1.  The position of the first bit of the aligned component is P 
= L + N."

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



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>, 
Date:   26/03/2014 15:01
Subject:        [DFDL-WG] alignment questions
Sent by:        dfdl-wg-bounces at ogf.org




Are leadingSkip always byte aligned, or are they N * 8 bits added on.
Similarly trailingSkip

E.g., 

<element name="x" type="xs:int" dfdl:lengthKind="explicit" dfdl:length="1" 
dfdl:lengthUnits="bits"
dfdl:trailingSkip="10" dfdl:alignmentUnits="bytes" dfdl:alignment="1"/>

So, after this element am I at bit 81 or bit 88?

In other words, does the trailingSkip region get aligned per size of 
alignment unit, or does alignment really only happen at the beginning of 
an element.

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/20140326/eb180cee/attachment.html>


More information about the dfdl-wg mailing list