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 2019/12/31 19:27:00 UTC

[jira] [Assigned] (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 reassigned DAFFODIL-2262:
------------------------------------

    Assignee: Josh Adams

> 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: Josh Adams
>            Priority: Major
>             Fix For: 3.0.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)