I took a look at the sample xsd's with the imbedded schematron asserts. It
looks good. Does the process create SVRL files when it completes? Is there a
commandline option to direct the SVRL file to a specific path and name?
I was recently working with a modified daffodil GIF schema and schematron to
report various findings with GIF files. Several test involved testting that
keyword were not in HEX blob fields. I'm curious of those type of tests will
work with this process. This is a sample assert:
<sch:assert test="not(./LSD_Blob[matches(.,'73716C')]) and
not(./LSD_Blob[matches(.,'53514C')])">
GIF: FAIL: LSD_Blob: AFTER-HDR-REF-SQL: Possible malicious SQL
reference between segemnts
</sch:assert>
I've also done test to see if the count of bytes in one field matched the size
of the field value from another field:
<sch:assert test="if(/GIF/Global_Color_Table/RGB) then
count(/GIF/Global_Color_Table/RGB) eq math:pow(2,
Packed_Byte/number(Size_of_Global_Color_Table) + 1) else true()">
GIF: RED: LSG_GCL: GCL-RGB-CNT: There must be
Size_of_Global_Color_Table RGB values.
</sch:assert>
On 2020/12/18 17:21:02, John Wass <[email protected]> wrote:
> The Embedded Schematron PR is moving along, hoping to get it out of WIP
> soon. https://github.com/apache/incubator-daffodil/pull/463
>
> The JPEG and BMP schema repos are being used for testing now, and the PNG
> looks like it would provide some great coverage.. maybe too great :/ Any
> other noteworthy sources of sch+data that might be beneficial to test with?
>
> Observations on embedding
> - Behavior has been predictable, and errors have been clear
> - There are multiple placement options for schematron rules in a schema
> - The Validator API has held up well, but might be one issue to come out of
> this effort
>
> Examples at
> https://github.com/jw3/incubator-daffodil/tree/validator_spi/embedded_schematron/daffodil-schematron/src/test/resources/xsd
>