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/06/14 20:45:00 UTC

[jira] [Created] (DAFFODIL-2826) emptyElementParsePolicy 'treatAsAbsent' not working properly

Mike Beckerle created DAFFODIL-2826:
---------------------------------------

             Summary: emptyElementParsePolicy 'treatAsAbsent' not working properly
                 Key: DAFFODIL-2826
                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2826
             Project: Daffodil
          Issue Type: Bug
          Components: Back End
    Affects Versions: 3.5.0
            Reporter: Mike Beckerle


In either 3.4.0 or 3.5.0-SNAPSHOT the property dfdlx:emptyElementParsePolicy='treatAsAbsent' does not seem to be working at least for empty elements of complex type.

 
{code:java}
<element name="horizontalVisibility" minOccurs="0"     
  dfdlx:emptyElementParsePolicy="treatAsAbsent">
  <complexType>
    <sequence>
      <element name="visibility" type="w:visibilityType" minOccurs="0"/>
      <element name="directionalVariationInVisibility" minOccurs="0">
        <complexType>
          <choice>
            <element name="noDirectionalVariation" 
               dfdl:initiator="%WSP+;NDV NDV" type="w:zlString"/>
            <sequence dfdl:initiator="%WSP+; %ES;">
              <element name="minimumVisibility" type="w:uint4"/>
              <element name="direction" type="w:directionEnum"/>
            </sequence>
          </choice>
        </complexType>
      </element>
    </sequence>
  </complexType>
</element>
 

{code}
The enclosing parent element horizontalVisibility is optional. If all content within it is not present, the property dfdlx:emptyElementParsePolicy="treatAsAbsent" means that this empty complex type element should NOT be added to the infoset. 

Daffodil does have tests for emptyElementParsePolicy, but perhaps the complex-type element case is not included?

See also DAFFODIL-2824.

 



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