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

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

Research on behavior of IBM DFDL (by IBM) shows that zero-length sequence 
groups can have their separators suppressed. So not all model groups are viewed 
as "required" with respect to separators.

A sequence that exists purely for carrying an assertion will always be 
zero-length, and so need not generate a separator when unparsing if the 
dfdl:separatorSuppressionMode is anyEmpty, for example.

When parsing, this will still require some adaptation to avoid requiring a 
separator.

> 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: Minor
>
> 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