[DFDL-WG] unparsing with dfdl:setVariable referring to dfdl:outputValueCalc element

Mike Beckerle mbeckerle.dfdl at gmail.com
Mon Jul 25 11:53:24 EDT 2016


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


More information about the dfdl-wg mailing list