You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2023/02/28 14:45:00 UTC
[jira] [Created] (DAFFODIL-2798) No warning on unused dfdlx properties on xs:enumeration
Steve Lawrence created DAFFODIL-2798:
----------------------------------------
Summary: 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
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)