Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.0
-
None
Description
The defaultValue attribute in the dfdl:defineVariable element is allowed to contain either a DFDL expression or a logical value, for example, the following are equivalent
<dfdl:defineVariable name="foo" type="xs:boolean" defaultValue="false" /> <dfdl:defineVariable name="foo" type="xs:boolean" defaultValue="{ fn:false() }" />
However, Daffodil always treats the defaultValue as an expression, assuming curly braces if they are missing. So in the case ofthe logical value, Daffodil tries to set the default value to
{ false }
Which isn't valid and result in an error. Instead, we should only treat the defaultValue as an expression if curly braces exist. Otherwise, we should convert the logical value to the the type using standard string-to-type XML conversion methods.