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

Assert on Group Definition ignored without Warning

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.4.0
    • 3.5.0
    • Back End
    • None

    Description

      According to the spec, asserts are only allowed on group references, not group definitions, however there is no warning when an assert is put on the spec. In fact, the following test fails, which is not expected behavior. There should we atleast a schema definition warning, rather than just ignoring the assert.

       

      <tdml:defineSchema name="assertsOnGroupDef">
        <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
        <dfdl:format
                ref="ex:GeneralFormat"
                lengthKind="delimited" />
      
      
        <xs:group name="namedGroup">
          <xs:annotation>
            <xs:appinfo source="http://www.ogf.org/dfdl/">
              <dfdl:assert message="{ fn:concat('Value was not 5 but was ', xs:int(.)) }">{ . eq '5' }</dfdl:assert>
            </xs:appinfo>
          </xs:annotation>
          <xs:sequence>
            <xs:element name="value" type="xs:string">
            </xs:element>
          </xs:sequence>
        </xs:group>
      
        <xs:element name="e1">
          <xs:complexType>
            <xs:group ref="ex:namedGroup"/>
          </xs:complexType>
        </xs:element>
      
      </tdml:defineSchema>
      
      <tdml:parserTestCase
              name="test_assertsOnGroupDef_01"
              root="e1"
              model="assertsOnGroupDef"
      >
        <tdml:document>4</tdml:document>
        <tdml:errors>
          <tdml:error>Assertion failed</tdml:error>
          <tdml:error>Value was not 5 but was 4</tdml:error>
        </tdml:errors>
      </tdml:parserTestCase> 

      Attachments

        Activity

          People

            mikemcgann Mike McGann
            okilo@tresys.com Olabusayo Kilo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: