[ 
https://issues.apache.org/jira/browse/DAFFODIL-1975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16643880#comment-16643880
 ] 

Michael Beckerle commented on DAFFODIL-1975:
--------------------------------------------

Suggest deferring fixing this. I don't think it will affect interoperability 
with IBM DFDL much, as realistic schemas won't have these constructs (much).

I also think the resolution - that even empty sequences require separators, is 
perhaps not the right decision. We depend on being able to throw empty 
sequences into place which carry only assertions or other statements. Requiring 
the structure of the enclosing sequence to be restructured is potentially 
problematic. 

> Incorrect separator behavior - missing separator for empty sequence 
> (non-backward compatible)
> ---------------------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-1975
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-1975
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, Compatibility
>    Affects Versions: 2.1.0
>            Reporter: Michael Beckerle
>            Assignee: Michael Beckerle
>            Priority: Major
>
> Consider the following
> {{    <xs:element name="NS_13a">
>       <xs:complexType>
>         <xs:sequence dfdl:separator=","  dfdl:separatorPosition="infix"><!-- 
> OUTER -->
>             <xs:sequence> <!-- INNER -->
>               <xs:annotation>
>               <xs:appinfo source="http://www.ogf.org/dfdl/";>
>                 <dfdl:assert>{fn:true()}</dfdl:assert>
>               </xs:appinfo>
>               </xs:annotation>
>           </xs:sequence>
>           <xs:element name="e2" type="xs:int" minOccurs="1" 
> maxOccurs="unbounded" dfdl:textNumberPattern="#####"
>                dfdl:occursCountKind="implicit" />
>         </xs:sequence>
>       </xs:complexType>
>     </xs:element>}}
> The sequence labeled INNER has no syntax, only an assertion. However, the 
> OUTER sequence specifies infix separator.
> Per clarifying discussion on the DFDL workgroup mailing list, and tests with 
> IBM DFDL, daffodil behavior is wrong if it suppresses the separator after the 
> INNER sequence. Separator suppression applies only to "optional" children, 
> not required children. All model group instances are considered required, 
> even if empty. 
> Hence, valid data to match the above schema looks like
> ,1,2,3
> The leading comma there is required. 
> Daffodil must be doing something clever to detect that this initial sequence 
> is empty and so is suppressing the separator for it. But this is incorrect.
> Test test_NumSeq_13a illustrates the bug. (Test added as part of sequence and 
> separators refactoring 2018-08-01)
> Fixing this may cause many tests to break. This is a major 
> non-backward-compatible change, and so should be fixed carefully. Schemas 
> outside of daffodil for delimited formats may be impacted also. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to