Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1155

boolean element default='true' causes SDE

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • deferred
    • s15
    • General, Middle "End"
    • None

      If you have an element declaration like this:

      <xs:element name="foo" type="xs:boolean" default="true" .../>

      Then you get an SDE - cannot convert true to Boolean.
      Changing the default to

      <xs:element name="foo" type="xs:boolean" default="{ fn:true() }" .../>

      Seems logical, but should give a different SDE because the default attribute is an XSD thing, and it can't take DFDL expressions there, only XSD values.

      We need to check that the value of the default attribute is an XSD value. If the type of the element was xs:string, it would be really confusing because then this default value that looks like an expression would be accepted! (but treated as a literal string".

      We should check that the value of the default attribute is a legal XSD value, and issue a warning if it is a string, for an element of type string, which looks like a DFDL expression.

              Unassigned Unassigned
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: