[DFDL-WG] clarification needed: setVariable - executes before or after framing of the element/model group

Mike Beckerle mbeckerle.dfdl at gmail.com
Fri Sep 2 11:56:05 EDT 2016


The spec defines where setVariable executes as a statement relative to
element processing and model-group processing.

Question is: what does element and model group processing mean: the value
region of the element, the content region of the element,  or the whole
element including all framing?

So, for an element, spec says that setVariables run after the element.

Rhetorical question: Does "after" mean after the terminator (including any
expression for the terminator) has completed?

Yes, because otherwise a element could contain the value of its own
terminator, and that wouldn't work for lengthKind='delimited' as you would
need the value to get the terminator to parse the value.

So 'after' has to mean after the terminator, meaning all framing, and any
other expression that can affect the length or interpretation in forming
the element.

For a model group, the spec says that setVariables run before the model
group.

So, can a sequence carry a set-variable that sets a variable value that is
then used in the initiator property of that very sequence?

E.g.,

<xs:sequence dfdl:initiator="{ $init }">
   <xs:annotation><xs:appinfo ...>
       <dfdl:setVariable ref="init">{ ../someplace/else }</dfdl:setVariable>
  </xs:appinfo></xs:annotation>
   ..... reset of sequence
</xs:sequence>

If this is not allowed for the initiator, what about for the terminator or
separator, or outputNewLine or encoding or any other property that
affects the syntax of the model group?

What about discriminators/asserts. Do those run before the sequence's
initiator is matched, or after? E.g., can a discriminator indicate "true",
but then the initiator fails to match?

When unparsing, you don't execute discriminator/assert at all, so no
guidance there.

Maybe this is clear already, but I am not sure if setVariables should run
before any framing of a model group, or after the framing, but before the
content region, or before the value region.

...mikeb

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/20160902/1a1a5a55/attachment.html>


More information about the dfdl-wg mailing list