I somehow think we already discussed this, but am unable to find the thread.


Suppose:

<xs:element name="len" type="xs:int" dfdl:outputValueCalc="{ dfdl:valueLength(../data) + 10 }"/>
<xs:sequence><xs:annotation><xs:appinfo ...>
    <dfdl:setVariable name="var">{ ../len }" />
</xs:appinfo></xs:annotation></xs:setVariable>
<xs:element name="data" dfdl:length="{ $var }">
    ....
</xs:element>

In the above, when unparsing, the output value calc for len can be evaluated, but we must delay its evaluation and unparsing until the subsequent data element is available.

The next thing the unparse has to do, after delaying the unparsing of 'len' is set the var variable. This requires the value of len, which has been deferred.

We have real schemas (e.g., even PCAP) where this occurs.

This breaks the rule that when variables are evaluated, things they reference must have already been evaluated. Basically, when we delay evaluating the OVC for len we are suspending anything that depends on len having a value as well.

Did we discuss and/or agree on this behavior? I don't have any work around for this.



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