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]<mailto:[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]<mailto:[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]<mailto:[email protected]>>
Sent: Monday, June 21, 2021 1:27 PM
To: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[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.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.png]

Thx in advance,

Attila




Reply via email to