You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Olabusayo Kilo (Jira)" <ji...@apache.org> on 2023/02/02 20:08:00 UTC

[jira] [Updated] (DAFFODIL-2783) Assert on Group Definition ignored without Warning

     [ https://issues.apache.org/jira/browse/DAFFODIL-2783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olabusayo Kilo updated DAFFODIL-2783:
-------------------------------------
          Component/s: Back End
        Fix Version/s: 3.5.0
    Affects Version/s: 3.4.0

> Assert on Group Definition ignored without Warning
> --------------------------------------------------
>
>                 Key: DAFFODIL-2783
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2783
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 3.4.0
>            Reporter: Olabusayo Kilo
>            Priority: Major
>             Fix For: 3.5.0
>
>
> 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)