Keep in mind I'm using Daffodil 2.4.0 I understand and your explanation makes sense; however...
When I remove highlighted DFDL separator attributes on line #33 per suggestion:... [image: image.png] I get identical result:... [image: image.png] I.E. <CR><CR><LF> still consumed prior to 'tailing-rec' element processing. Unexpectedly, the only way to get the 'expected' result is by adding additional <CR><CR><LF>:... [image: image.png] You've confirmed my understanding of 'infix'; however, not getting expected results. Thx - Attila On Tue, Apr 19, 2022 at 10:40 AM Steve Lawrence <slawre...@apache.org> wrote: > Thanks for the provided schemas. This helps quite a bit. > > In this case, the "record" element does not consume the final CR CR LF > because it is an infix separator, as you expect. > > However, you have an CR CR LF separator on the outer sequence on line > 33, so you have something like this: > > <xs:sequence dfdl:separator="%CR;%CR;%LF;" > dfdl:separatorPosition="infix"> > <xs:sequence> > <xs:element name="MU16Type" ... /> > </xs:sequence> > <xs:element name="trailing-rec" ... /> > </xs:sequence> > > So this expects a CR CR LF in between your MU16Type element and a > trailing-rec element. That is what actually consumes the final CR CR LF > and then the trailing-rec element happily consumes no data and you get > the NIL element. > > So the suggestion if you want the CRCRLF element to be parsed in the > tailing-rec is to remove the CR CR LF separator from the outer sequence. > Note that things get a bit tricky if you do that. In that case, the > final trailing CR CR LF is not consumed as an infix separator, as > expected. And then we do get a single trailing-rec element that consumes > the CR CR LF and we get the <CRCRLF> element. But then because > trailing-rec is unbounded, and happy to try to parse more trailing-rec > elements. But a trailing-rec element can consume no data because of the > NIL element. This would mean Daffodil could get stuck in an infinite > loop happily consuming no data. Daffodil detects this and errors with a > "No forward progress" message. Simply removing the NIL element from the > TailType-TLE fixes this issue, this way it's not possible for > TailType-TLE to consume no data. > > - Steve > > > On 4/19/22 10:12 AM, Attila Horvath wrote: > > ALCON > > > > Same question/issue - see attached samp schema/data. > > > > Thx - Attila > > > > On Tue, Apr 19, 2022 at 10:03 AM <some...@apache.org <http://apache.org>> > wrote: > > > > > > > I can't reproduce this with simpler examples. Can you > provide your > > > actual schema/data? > > > > > > >