[DFDL-WG] clarification needed: conversions to required type of expressions - implicit or explicit

Mike Beckerle mbeckerle.dfdl at gmail.com
Tue Nov 20 13:21:54 EST 2018


We have a test for Daffodil that does this:

<element name="y" type="xsd:boolean" maxOccurs="unbounded"
      dfdl:textBooleanTrueRep="{ 1*10 }" dfdl:textBooleanFalseRep="{'a b
c'}" />

We found that we must change this to:

      dfdl:textBooleanTrueRep="{ xsd:string(1*10) }"

For the test to be portable and work on IBM DFDL as well as Daffodil.

So the issue to discuss is, are string conversions, or in general
conversions to the required property's type (e.g., integer for
dfdl:length), are these implicit, or do they have to be explicit?

I didn't find language in the DFDL spec that makes this clear.  The
properties tend to be clear on what the type needs to be (string or integer
typically).

The XPath language that is what we derive DFDL's expression language from,
has lots of conversion/coercion rules. Everything can be implicitly
converted to a string.

We say our DFDL expression language is a subset of XPath 2.0, and that we
explicitly say we use XPath 2.0's type system and respect its errors, and
we say DFDL implementations may use XPath 2.0 implementations if they do
some pre-processing.

So the clarification is reduced to this: Does an entire DFDL expression for
the value of a property behave as if it was an actual argument to a
function, that formal argument having the type required by the property? In
that case coercions would be inserted to convert say, numbers to strings.

Alternatively, does the expression for a property have to explicitly
convert to the type that the property requires?

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20181120/37676ab7/attachment.html>


More information about the dfdl-wg mailing list