
But, do you know where in the spec or the errata there are any constraints on format annotations at a particular annotation point? I'm aware of the one about discriminators (only one, and excludes asserts). But I can't find anything saying that you can't have more than one format annotation at a given annotation point, nor anything constraining the relative order of the various annotations that appear at a given annotation point that would dis-allow inter-leaving them arbitrarily. (Though I'm happy to see this constrained.) I also can't find anything in the IBM XML Schema for DFDL annotations that would constrain this. This describes the properties allowed on individual annotation elements, but I don't see how it constrains how they are combined/interleaved. On Tue, Oct 30, 2012 at 2:32 PM, Steve Hanson <smh@uk.ibm.com> wrote:
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* <http://www.ogf.org/dfdl/> IBM SWG, Hursley, UK* **smh@uk.ibm.com* <smh@uk.ibm.com> tel:+44-1962-815848
From: Mike Beckerle <mbeckerle.dfdl@gmail.com> To: dfdl-wg@ogf.org, Date: 30/10/2012 17:50 Subject: [DFDL-WG] question relevant to evaluation timing - short form Sent by: dfdl-wg-bounces@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@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
-- Mike Beckerle | OGF DFDL WG Co-Chair Tel: 781-330-0412