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

Mike Beckerle updated DAFFODIL-2982:
------------------------------------
          Component/s: Back End
                       Front End
    Affects Version/s: 3.10.0
          Description: 
Per DFDL Workgroup call on 2025-03-13, if an element is declared with 
minOccurs="0" and dfdl:occursCountKind 'parsed' then Daffodil treats it as an 
array, not as an optional element.

For example, daffodil requires that an expression accessing the value of this 
element must have indexing, and it is an SDE not to express indexing.

This is too strict. First, DFDL's definition of array vs. optional does not 
mention any DFDL properties. Rather it mentions the XSD minOccurs/maxOccurs 
only. 

Access without indexing should be allowed, and if the element has only 1 
occurrence it should succeed. If the element has multiple occurrences, then 
access without indexing should be a processing error. 

Note that this bug is easily worked around by specifying "[1]" indexing on this 
optional element. 

The element declared in this way remains array like in that access to other 
occurrences using indexes greater than 1 is also allowed, if those are in fact 
present in the infoset. 

Implementation-wise, this requires that the runtime have:
 * scalar elements
 * optional elements
 * array elements
 * hybrid array/optional elements 

It is this last category that this issue creates the need for. You can use just 
the element name to access the first occurrence, but only if it is the only 
instance. 

 

 
             Priority: Minor  (was: Major)
              Summary: dfdl:occursCountKind 'parsed' and implied array when 
minOccurs is 0  (was: dfdl:occursCountKind 'parsed' and implied array when 
minOccurs="0)

> dfdl:occursCountKind 'parsed' and implied array when minOccurs is 0
> -------------------------------------------------------------------
>
>                 Key: DAFFODIL-2982
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2982
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, Front End
>    Affects Versions: 3.10.0
>            Reporter: Mike Beckerle
>            Priority: Minor
>
> Per DFDL Workgroup call on 2025-03-13, if an element is declared with 
> minOccurs="0" and dfdl:occursCountKind 'parsed' then Daffodil treats it as an 
> array, not as an optional element.
> For example, daffodil requires that an expression accessing the value of this 
> element must have indexing, and it is an SDE not to express indexing.
> This is too strict. First, DFDL's definition of array vs. optional does not 
> mention any DFDL properties. Rather it mentions the XSD minOccurs/maxOccurs 
> only. 
> Access without indexing should be allowed, and if the element has only 1 
> occurrence it should succeed. If the element has multiple occurrences, then 
> access without indexing should be a processing error. 
> Note that this bug is easily worked around by specifying "[1]" indexing on 
> this optional element. 
> The element declared in this way remains array like in that access to other 
> occurrences using indexes greater than 1 is also allowed, if those are in 
> fact present in the infoset. 
> Implementation-wise, this requires that the runtime have:
>  * scalar elements
>  * optional elements
>  * array elements
>  * hybrid array/optional elements 
> It is this last category that this issue creates the need for. You can use 
> just the element name to access the first occurrence, but only if it is the 
> only instance. 
>  
>  



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

Reply via email to