You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Josh Adams (Jira)" <ji...@apache.org> on 2020/01/02 16:29:00 UTC

[jira] [Resolved] (DAFFODIL-2262) occursCountKind 'expression' should avoid separator suppression, but does not.

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

Josh Adams resolved DAFFODIL-2262.
----------------------------------
    Fix Version/s:     (was: 3.0.0)
                   2.5.0
         Assignee: Dave Thompson  (was: Josh Adams)
       Resolution: Fixed

This has been resolved in commit 03364e0a0dc49b13d2d21572069aff2537ea8e84

> occursCountKind 'expression' should avoid separator suppression, but does not.
> ------------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2262
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2262
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End
>    Affects Versions: 2.4.0
>            Reporter: Mike Beckerle
>            Assignee: Dave Thompson
>            Priority: Major
>             Fix For: 2.5.0
>
>
> Reported on users mailing list.
> Section 14.2.2 of the DFDL specification says this:
> {color:#000000}When dfdl:occursCountKind is 'expression' the number of occurrences is given by dfdl:occursCount and exactly that many occurrences are always expected along with their separators. The dfdl:separatorSuppressionPolicy is not applicable and the implied behaviour is 'never'.{color}
> The below schema has dfdl:occursCountKind="expression" and yet I am not observing the expected implied behavior of 'never'. That is, with this input:
> {code:java}
> header1,header2
>  a,{code}
> After parsing and then unparsing I get this:
> {code:java}
> header1,header2
>  a{code}
> Notice that the comma separator has been suppressed after ‘a’ but the specification says that the implied behavior is to never suppress the separator. This seems like a bug to me. Do you agree?  
> {code:java}
> <xs:element name="input">
>      <xs:complexType>
>          <xs:sequence dfdl:separator="%NL;" dfdl:separatorPosition="infix">
>              <xs:element name="header">
>                  <xs:complexType>
>                      <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix"  dfdl:separatorSuppressionPolicy="anyEmpty">
>                          <xs:element name="title" maxOccurs="unbounded" type="xs:string" />
>                      </xs:sequence>
>                  </xs:complexType>
>              </xs:element>
>              <xs:element name="row" maxOccurs="unbounded">
>                  <xs:complexType>
>                      <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix" dfdl:separatorSuppressionPolicy="anyEmpty">
>                          <xs:element name="field" maxOccurs="unbounded" type="xs:string"
>                              dfdl:occursCount="{ fn:count(../../header/title) }"
>                              dfdl:occursCountKind="expression" />
>                      </xs:sequence>
>                  </xs:complexType>
>              </xs:element>
>          </xs:sequence>
>      </xs:complexType>
>  </xs:element>{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)