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