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>