Good questions/comments/suggestions - as I said it is a 'work in progress' version.
re: header-absent case... The schema was a copy/paste from previous dfdl conversion task. This particular input dataset ALWAYS has a header record so the header-absent case is moot. For posterity, I just wanted to get my solution out there to the original problem I asked about. re: complexity... The schemas come w/ an 'official' external detailed data specifications document so, while I agree w/ your comment in principle, in this particular case comment blocks in schema would be duplicating the accompanying documenation ergo omitted |BUT| I do understand your point. re: "block-escapes" Not exactly sure what you mean by that. If you're referring to escaping delimiters and double-quotes, they are not necessary in this particular case as they are not required. Thx for the ongoing support. Attila On Wed, Jun 23, 2021 at 11:42 AM Beckerle, Mike < [email protected]> wrote: > I took a quick look at this. Looks pretty good. > > I am curious as to why only the header-absent case has the assert with > pattern "." in the record element. The header-present case doesn't have > this. > > Also the regex pattern for the field strings surprises me with its > complexity. You may want to put in a block comment explaining what it is > doing and what the special cases are. (I recommend this for basically all > non-trivial regexs) > > I suspect you are doing some sort of variation on block-escapes, but I'm > not sure. > > -mikeb > ------------------------------ > *From:* Attila Horvath <[email protected]> > *Sent:* Wednesday, June 23, 2021 6:56 AM > *To:* [email protected] <[email protected]> > *Subject:* Re: how to incorporate file terminator into generic CSV schema? > > ALCON > > Attached is a 'work in progress' (not final) version of dfdl schema > resolving my original question. > > v/r > > Attila > > On Tue, Jun 22, 2021 at 12:58 PM Attila Horvath < > [email protected]> wrote: > > ALCON > > I have resolved the issue w/ help from Mike's hint. > I can/will post the solution shortly. > > Thx - v/r > > Attila > > > On Mon, Jun 21, 2021 at 3:20 PM Beckerle, Mike < > [email protected]> wrote: > > Attila, > > It took me a bit to spot this, and I'm really not sure I am correct here. > > I think you need one more sequence. If you insert another element of type > "TailType-perstempo" at the end, it doesn't want to be inside the sequence > with NL infix separators. It wants to be after that sequence has ended, but > inside a surrounding sequence that is the model group of the complexType of > the csv-version4... element, but which has no separators. > > Given the images you provided, I can't cut/paste to try this theory out. > > I would like to make self-contained TDML files be the way we all exchange > examples/bug-reports. > > Could you make a TDML file? (See https://daffodil.apache.org/tdml/) > > Their beauty is that they can be fully self-contained, i.e., contain > schema, data, and expected results all together. Everything to reproduce > can be in the same file. > > -mikeb > > > > > > ------------------------------ > *From:* Attila Horvath <[email protected]> > *Sent:* Monday, June 21, 2021 1:27 PM > *To:* [email protected] <[email protected]> > *Subject:* how to incorporate file terminator into generic CSV schema? > > I have following generic variable field/record length schema which > daffodil 2.4.0 parses/unparses verbatim except "No newline at end of file" > error when I diff original CSV against reconstituted CSV. Otherwise > reconstituted CSV appears to match original CSV:... > [image: image.png] > > To get around this I've tried/failed to incorporate code block in *RED* > into code block in *YELLOW* (see code block image). I've used code block > in *RED* successfully but not w/ variable fields/records CSV via > "...fn:count...". > Can someone pls suggest how to correctly integrate unknown file terminator > into code block in *YELLOW* in this schema? > [image: image.png] > > Thx in advance, > > Attila > > > > >
