[DFDL-WG] question relevant to evaluation timing - short form
Steve Hanson
smh at uk.ibm.com
Tue Oct 30 14:32:09 EDT 2012
This makes no sense to me. It doesn't work - you can't spread properties
across multiple annotations and expect the timing to be different at
runtime - what if dfdl:length was on one and dfdl:lengthKind on the other?
IBM DFDL disallows this in its xsd for DFDL annotations. Spec should make
this clear if it doesn't already.
Regards
Steve Hanson
Architect, Data Format Description Language (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,
Date: 30/10/2012 17:50
Subject: [DFDL-WG] question relevant to evaluation timing - short
form
Sent by: dfdl-wg-bounces at ogf.org
Can I do this?
<sequence>
<annotation><appinfo...>
<dfdl:setVariable ref="foo" .../>
<dfdl:sequence initiator="{...expression involving foo...}"/>
<dfdl:newVariableInstance ref="foo" value="{...some
expression...}"/>
<dfdl:sequence terminator="{...expression involving foo...}"/>
</appinfo></annotation>
</element>
See how I am spreading out the evaluation of the runtime-valued properties
with the setVariable and newVariable stuff.
This works so long as we evaluate everything in schema definition order.
Now let me throw one more wrench (spanner for the UK folks) in the works.
I'm going to add a short form annotation:
<sequence dfdl:separator="{... expression...}">
<annotation><appinfo...>
<dfdl:setVariable ref="foo" .../>
<dfdl:sequence initiator="{...expression involving foo...}"/>
<dfdl:newVariableInstance ref="foo" value="{...some
expression...}"/>
<dfdl:sequence terminator="{...expression involving foo...}"/>
</appinfo></annotation>
</element>
Now, a short form annotation is equivalent to a long form conversion
thereof, but in this case is it this one???
<sequence>
<annotation><appinfo...>
<!-- short form annotation comes FIRST when converted. -->
<dfdl:sequence separator="{...expression ...}"/> <!-- Expression
cannot use variable foo. -->
<dfdl:setVariable ref="foo" .../>
<dfdl:sequence initiator="{...expression involving foo...}"/>
<dfdl:newVariableInstance ref="foo" value="{...some
expression...}"/>
<dfdl:sequence terminator="{...expression involving foo...}"/>
</appinfo></annotation>
</element>
Or... is it this one:
<sequence>
<annotation><appinfo...>
<dfdl:setVariable ref="foo" .../>
<dfdl:sequence initiator="{...expression involving foo...}"/>
<dfdl:newVariableInstance ref="foo" value="{...some
expression...}"/>
<dfdl:sequence terminator="{...expression involving foo...}"/>
<!-- short form annotation comes LAST when converted -->
<dfdl:sequence separator="{...expression ...}"/> <!-- expression
could use varible foo. -->
</appinfo></annotation>
</element>
I would argue I prefer the first one, because makes the lexical order of
appearance consistent with evaluation order.
...mikeb
--
Mike Beckerle | OGF DFDL WG Co-Chair
Tel: 781-330-0412
--
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/20121030/fc848ec7/attachment-0001.html>
More information about the dfdl-wg
mailing list