PS:...

Case in point:...

<xs:element name="test" type="xs:string" dfdl:lengthKind="pattern"
dfdl:lengthPattern=".*?(?=(THIS IS A CONTINUATION MESSAGE, PART))"/>
<xs:choice>
<xs:choice dfdl:choiceDispatchKey="{./test}">

When 'Optional line 3' is NOT there, I get an error on 2nd '<xs:choice.../>'
because it resolves to an empty string.

<8(



On Tue, Mar 8, 2022 at 7:20 AM Attila Horvath <[email protected]>
wrote:

>
> ALCON
>
> I'm having difficulty parsing an input ASCII file containing optional
> records as follows:
>
>
>
>
>
>
>
> *Required line 1... fixed length <CR><LF>Required line 2... fixed length
> <CR><LF> Optional line 3... fixed length <CR><LF> Optional comment... 1 of
> n <CR><LF> Optional comment... 2 of n <CR><LF> Optional comment... n of n
> <CR><LF> Required line 4... fixed length <CR><LF> :::*
>
> I've tried various <xs:choice ... /> and lookahead approaches
> unsuccessfully and admittedly getting frustrated. <8(
>
> For example, I'm able to parse 'Optional line 3' *when it exists* BUT I
> can't construct DFDL script to process the file successfully when line 3 is
> not present.
>
> Can someone pls point me to an example/link illustrating best way to
> process this if/when optional lines are NOT present.
>
> Thx in advance
> Attila
>
>

Reply via email to