[DFDL-WG] dfdl:contentLength and complex types with interior alignmentFill

Steve Hanson smh at uk.ibm.com
Mon Apr 28 06:19:34 EDT 2014


Mike

This doesn't solve the problem fully, because it assumes an alignment of 0 
and in practice the alignment might be some odd number that forces the 
first child with alignment 2, 4 or 8 onto a different offset, and hence 
the length is different.  So I'm not sure whether the additional 
calculation helps much.

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:   24/04/2014 22:36
Subject:        [DFDL-WG] dfdl:contentLength and complex types with 
interior        alignmentFill
Sent by:        dfdl-wg-bounces at ogf.org




dfdl:contentLength interacts pretty badly with alignment because 
alignmentFill regions mean you cannot know the size of a complex type 
element without knowing its starting position.

It is very likely that one will have outputValueCalc that wants to 
evalutate dfdl:contentLength on an infoset item before the starting 
position for that item is known or knowable.

To fix this we say that dfdl:contentLength(e) on complex-type infoset item 
e, is computed as if element e's alignment was first put into place along 
with the rest of the LeftFraming, and then the content length computed as 
if the complex content was unparsed starting from after that LeftFraming 
up to the final RightFraming In other words, the entire element has to be 
unparsed, not just the complex content of it, and then the part of that 
unparsed data that corresponds to the complex content is used as the 
return value from dfdl:contentLength.  

This works because element e's alignment (LeftFraming generally) is not 
within the complex content for element e. It is before the complex content 
of the element, so if the schema puts an explicit alignment on element e, 
then it will clearly be aligned that way when it is really unparsed, but 
the dfdl:contentLength function will also compute a length from the 
infoset value as if that same alignment were in place.

I think that is about the best we can do. 

Thoughts?

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/20140428/0f0a6634/attachment.html>


More information about the dfdl-wg mailing list