1) I don't believe you can enable both schematron and Xerces at the same
time. We only support a single "full" validator. An API user could
probably create a custom validator that uses multiple validators, but
that's not built into Daffodil.
A related aside, personally, I kind of wish we didn't even support
Xerces/Schematron validators at all. It's definitely convenient to have
it all built in, but in security applications where Daffodil is commonly
used, Xerces/Schematron validation is going to be a separate validation
step anyways. Likewise with things like NiFi, where separator Processors
can be used for additional validation in a modular way. I prefer the
unix philosophy where each tool (Daffodil, Xerces, Schematron, etc.) are
separate tools that can be pipelined together, instead of having
Daffodil do it all as one monolithic tool. It's more work, but more
modular and configurable.
And note that our Xerces/Schematron validation isn't even particularly
efficient. We essentially create two infosets, validate one with
Xerces/Schematron and throw it away, and send the other to the user. So
we don't even really get a performance benefit from doing it inside
Daffodil. Though that could potentially be improved in the future.
Not saying we should remove existing support, but I'm not sure we want
want to try support more validation languages (XProc, XSLT, RELAX NG,
DTD, etc.) or different combinations.
2) I don't think the TDML Runner supports schematron validation. The
validation mode is either off, limited, or full, and full uses Xerces.
But if schematron is enabled with the CLI or API, the errors are
reported the same as other validation errors.
On 2023-08-18 09:16 AM, Mike Beckerle wrote:
Some schematron questions.
1) Can I use both XSD validation and Schematron validation at the same
time? I want to do XSD validation (regular validation="on"), and then
also have the schematron check run because there are a few things that
need to be checked that XML Schema (version 1.0) validation cannot express.
Specifically, I have a dfdl:binaryNumberRep='bcd' number, the last digit
of which must be 0 or 5. DFDL doesn't allow pattern facets on numbers.
2) How can I verify that I'm getting the schematron validation errors
detected from a TDML test? Will schematron errors come out as Validation
errors just like Xerces validation errors do?
I can't find examples that use schematron with TDML in the Daffodil
source tree.
Thanks