[DFDL-WG] EDIFACT schema - daffodil bug or schema bug

Mike Beckerle mbeckerle.dfdl at gmail.com
Wed Nov 4 11:58:45 EST 2015


I'm trying to get EDIFACT working on Daffodil.

I have a somewhat interesting chicken-egg problem.

This schema uses dfdl:escapeCharacter and dfdl:escapeEscapeCharacter as
expressions. E.g., there is a top-level dfdl:defineVariable named
"EscapeChar" which has a default value, and the expression for the
dfdl:escapeCharacter property is { $ibmEdiFmt:EscapeChar }.

The default format that is in effect for the root element 'Interchange' has
dfdl:lengthKind='delimited'.

When daffodil starts parsing the top level root/document element, it enters
a parser that is for delimited elements with an escape-scheme in effect.
First thing this parser does is get the escape scheme which evaluates the
expressions for escapeCharacter and escapeEscapeCharacter. This picks up
the default values for those variables and the variables are then set as
"already evaluated", as DFDL specifies that once a variable's default value
has been used, it cannot be subsequently set via dfdl:setVariable.

Now, when the very first UNA is encountered, that reads the various
delimiters/escapes from the data, and tries to set the variables.

But the variables have already been evaluated, on the way into parsing the
"delimited" top level element.

So it fails with a runtime SDE - default value has already been used for
EscapeChar variable.

So the question is. Is this a schema bug in the EDIFACT schema, or is there
a principle at work here for DFDL implementations generally?

The principle would be that a complex-typed element of length kind
delimited when there is no definition of terminator nor applicable
separator, that this situation is treated like dfdl:lengthKind='implicit'
and the escapeScheme is therefore not relevant and the expressions "must
not" be evaluated?

One could argue that the EDIFACT schema should have
dfdl:lengthKind='implicit' on the 'Interchange' element and any other
complex type element.

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/20151104/d49482be/attachment.html>


More information about the dfdl-wg mailing list