[DFDL-WG] Problem: simple format that is impossible to model

Mike Beckerle mbeckerle.dfdl at gmail.com
Thu Sep 26 13:47:17 EDT 2019


I have a dead-simple little format:

    data/data/data/data
    data/data/data/data

it is lines of "/" separated strings. All elements are optional.

I simply want this:

   data//data

to round trip. For that to happen I need it to parse into

   <field>data</field><field></field><field>data</field>

That is, I require that empty field element in the middle to be created and
put into the infoset.

I can find no way to do this.

The strings have no initiator/terminator, so dfdl:emptyValueDelimiterPolicy
is not relevant. All the elements are optional, so default values aren't
relevant.

The spec states:

9.4.2.2      Simple element (xs:string or xs:hexBinary)

Required occurrence: If the element has a default value then an item is
added to the infoset using the default value, otherwise an item is added to
the Infoset using empty string (type xs:string) or empty hexBinary (type
xs:hexBinary) as the value.

Optional occurrence: If dfdl:emptyValueDelimiterPolicy is not 'none'[12]
<https://daffodil.apache.org/docs/dfdl/#_ftn12> then an item is added to
the Infoset using empty string (type xs:string) or empty hexBinary (type
xs:hexBinary) as the value, *otherwise nothing is added to the Infoset*.

There are errata/actions to clarify wording here around
dfdl:emptyValueDelimiterPolicy being in effect or not (because there is no
initiator/terminator for it to use as opposed to the property in isolation
just being 'none').
But that doesn't change anything about this issue.

If this very simple format is not possible, then we need a property or new
property enum value that makes it possible.

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/20190926/aef7cacf/attachment.html>


More information about the dfdl-wg mailing list