Olabusayo Kilo created DAFFODIL-2783:
----------------------------------------

             Summary: Assert on Group Definition ignored without Warning
                 Key: DAFFODIL-2783
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2783
             Project: Daffodil
          Issue Type: Bug
            Reporter: Olabusayo Kilo


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.

 
{code:xml}
<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> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to