There are some known issues related to how Daffodil incorrectly
implements separatorSupressionPolicy. However, I'm not sure if those are
the cause of the behavior you're seeing, since I don't think
separatorSuppressionPolicy really works like that. Mike knows more about
those issues and SSP.

That said, if you want to require a trailing newline, you can change the
 dfdl:separatorPosition for your NL sequence from "infix" to "postfix".
You can think of infix and postfix as the same thing except that with
postfix the last instance is followed by the separator, whereas with
infix the last instance is not followed by the separator.

- Steve

On 11/23/18 11:27 AM, Costello, Roger L. wrote:
> Hello DFDL community,
> 
> I have a text format that contains a sequence of rows separated by newline. 
> Each 
> row contains a sequence of strings separated by colon.
> 
> Suppose I do not want to allow the last row to contain a newline. Then here 
> is 
> an example of a valid input file:
> 
> In that case, I should set 
> dfdl:separatorSuppressionPolicy="trailingEmptyStrict"
> 
> Is that correct?
> 
> Conversely, suppose that I want to allow the last row to contain a newline:
> 
> In that case, I should set dfdl:separatorSuppressionPolicy="trailingEmpty"
> 
> Is that correct?
> 
> If that is correct, then there is a bug in Daffodil because I get this 
> warning:
> 
> [warning] Left over data. Consumed 872 bit(s) with at least 16 bit(s) 
> remaining.
> 
> Below is my DFDL schema.
> 
> /Roger
> 
> <xs:elementname="really-simple-format">
> <xs:complexType>
> <xs:sequencedfdl:separator="%NL;"dfdl:separatorPosition="infix"
>                                
> dfdl:separatorSuppressionPolicy="trailingEmpty">
> <xs:elementname="row"maxOccurs="unbounded">
> <xs:complexType>
> <xs:sequencedfdl:separator=":"dfdl:separatorPosition="infix">
> <xs:elementname="label"type="xs:string"/>
> <xs:elementname="message"type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> 

Reply via email to