You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2023/04/18 18:01:00 UTC

[jira] [Updated] (DAFFODIL-2798) No warning on unused dfdlx properties on xs:enumeration

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

Mike Beckerle updated DAFFODIL-2798:
------------------------------------
    Priority: Minor  (was: Major)

> No warning on unused dfdlx properties on xs:enumeration
> -------------------------------------------------------
>
>                 Key: DAFFODIL-2798
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2798
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>    Affects Versions: 3.4.0
>            Reporter: Steve Lawrence
>            Priority: Minor
>
> Say we have a schema like this (note that dfdlx:repValue is an intentional typo and should be dfdl:repValues):
> {code:xml}
>   <simpleType name="rep" dfdl:lengthKind="explicit" dfdl:length="1">
>     <restriction base="xs:string" />
>   </simpleType>
>   <simpleType name="value" dfdlx:repType="ex:rep">
>     <restriction base="xs:string">
>       <enumeration value="ZERO" dfdlx:repValue="0" />
>       <enumeration value="ONE" dfdlx:repValue="1" />
>       <enumeration value="TWO" dfdlx:repValue="2" />
>     </restriction>
>   </simpleType>
>   <element name="root" type="ex:value" />
> {code}
> Because *dfdlx:repValue* is a typo, Daffodil ignores it--we do not error on unknown extension properties because those properties may be used for other DFDL implementations.  But with this property being ignored, it can leads to unexpected behavior or even confusing SDE's if the typo is not discovered.
> Because it is ignored, we should output a warning which helps user discover the error. But in this case, with the unknown property being on an enumeration, no warning is generated.
> It looks like the issue is that we only check for unused properties on Terms, but xs:enumeration is not a Term so we do not check them. Ideally this logic would be moved to something more generic so we can warn on all schema components instead of just terms.



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