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

Mike Beckerle mbeckerle.dfdl at gmail.com
Thu Apr 24 17:36:36 EDT 2014


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<http://www.ogf.org/About/abt_policies.php>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20140424/26e5ccfb/attachment.html>


More information about the dfdl-wg mailing list