Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2033

dfdl:defineVariable defaultType does not properly convert value

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.3.0
    • Middle "End"
    • 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.

      Attachments

        Activity

          People

            slawrence Steve Lawrence
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: