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 2024/10/03 17:39:00 UTC
[jira] [Commented] (DAFFODIL-2934) Local Warning Suppression Issues
[ https://issues.apache.org/jira/browse/DAFFODIL-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17886736#comment-17886736 ]
Olabusayo Kilo commented on DAFFODIL-2934:
------------------------------------------
It would also be nice to be able to suppress a warning on all children of an element by putting the suppression on the element rather than on each individual child. Ex
{code:xml}
<xs:element name="root1" dfdl:initiator="default1,default2,default3,default4:">
<xs:complexType>
<xs:sequence dfdl:separator=";" dfdl:separatorPosition="postfix">
<xs:element name="record" maxOccurs="unbounded" daf:suppressSchemaDefinitionWarnings="noEmptyDefault">
<xs:complexType>
<xs:sequence dfdl:separator=','>
<xs:element name="default1" type="xs:boolean" default="true" dfdl:textBooleanTrueRep="true" dfdl:textBooleanFalseRep="false" />
<xs:element name="default2" type="xs:boolean" default="false" dfdl:textBooleanTrueRep="true" dfdl:textBooleanFalseRep="false" />
<xs:element name="default3" type="xs:boolean" default="1" dfdl:textBooleanTrueRep="1" dfdl:textBooleanFalseRep="0" />
<xs:element name="default4" type="xs:boolean" default="0" dfdl:textBooleanTrueRep="1" dfdl:textBooleanFalseRep="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
instead of
{code:xml}
<xs:element name="root1" dfdl:initiator="default1,default2,default3,default4:">
<xs:complexType>
<xs:sequence dfdl:separator=";" dfdl:separatorPosition="postfix">
<xs:element name="record" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence dfdl:separator=','>
<xs:element name="default1" type="xs:boolean" default="true" dfdl:textBooleanTrueRep="true" dfdl:textBooleanFalseRep="false"
daf:suppressSchemaDefinitionWarnings="noEmptyDefault"/>
<xs:element name="default2" type="xs:boolean" default="false" dfdl:textBooleanTrueRep="true" dfdl:textBooleanFalseRep="false"
daf:suppressSchemaDefinitionWarnings="noEmptyDefault"/>
<xs:element name="default3" type="xs:boolean" default="1" dfdl:textBooleanTrueRep="1" dfdl:textBooleanFalseRep="0"
daf:suppressSchemaDefinitionWarnings="noEmptyDefault"/>
<xs:element name="default4" type="xs:boolean" default="0" dfdl:textBooleanTrueRep="1" dfdl:textBooleanFalseRep="0"
daf:suppressSchemaDefinitionWarnings="noEmptyDefault"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
{code}
> Local Warning Suppression Issues
> --------------------------------
>
> Key: DAFFODIL-2934
> URL: https://issues.apache.org/jira/browse/DAFFODIL-2934
> Project: Daffodil
> Issue Type: Bug
> Components: Back End
> Affects Versions: 3.9.0
> Reporter: Olabusayo Kilo
> Priority: Major
>
> Here are some of the issues we've noted while trying to use daf:suppressSchemaDefinitionWarnings
> * It silently ignores the property on some global elements (these are treated as Root type and are element references so don't actually have the property on them, hence xml.attribute in localSuppressSchemaDefinitionWarnings, fails to return the property). Workaround is to wrap the element in a parent element which seems to fix things. Possible Solution would be to add an isRoot check to localSuppressSchemaDefinitionWarnings and use Root.referencedElement.xml instead of SchemaComponent.xml and call attributes on that. Example: hb_fromString in
> * For the test, schema_warning_locally_suppressed, the property should be on the annotation rather than the element "elem"
--
This message was sent by Atlassian Jira
(v8.20.10#820010)