I've been working on an issue with the VSCode extension dealing with 
dfdlx:trace: https://github.com/apache/daffodil-vscode/issues/116

I got it partially working but was stuck on one particular issue.
The 1.6.0 pre-release extension now automatically saves/re-uses the compiled 
parser if the schema doesn't get changed.
The dfdlx:trace output works when the schema gets compiled but would not work 
when running the precompiled parser.
After beating my head on this for a while, I tried the CLI version...
The -v works with saved parser -- except the dfdlx:trace output is missing!

C:\Users\larry.barber\Documents\PaxRiver> daffodil -v parse -s 
jpeg.trace.dfdl.xsd -o infoset.xml daffodil.jpg
[info] dfdlx:trace testing : DataValue(100)
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 637 column 58 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 629 column 58 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 365 column 46 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 350 column 46 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[3] Location line 767 column 30 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 736 column 30 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 720 column 30 in jpeg.trace.dfdl.xsd
[info] Time (compiling): 2892ms
[info] Time (parsing): 83ms

C:\Users\larry.barber\Documents\dfdlx_trace> daffodil -v save-parser -s 
jpeg.trace.dfdl.xsd tracer
[info] dfdlx:trace testing : DataValue(100)
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 637 column 58 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 629 column 58 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 365 column 46 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 350 column 46 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[3] Location line 767 column 30 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[2] Location line 736 column 30 in jpeg.trace.dfdl.xsd
[warn] Schema Definition Warning: Counterintuitive placement detected. Wrap the 
discriminator or assert in an empty sequence to evaluate before the contents. 
(id: discouragedDiscriminatorPlacement)
Schema context: sequence[1] Location line 720 column 30 in jpeg.trace.dfdl.xsd
[info] Time (compiling): 2728ms
[info] Time (saving): 231ms

C:\Users\larry.barber\Documents\dfdlx_trace> daffodil -v parse -P tracer -o 
infoset.xml daffodil.jpg
[info] Time (reloading): 383ms
[info] Time (parsing): 117ms

I don't know if this was the intended functionality, or if anyone cares to 
change it. The extension will have the same limitation - it's just more 
irritating since it automatically uses saved parsers, so users will have to 
constantly modify their schema to get the trace output.

Also looks like the github schemas need to be updated to eliminate some warning 
messages.

Reply via email to