[oXygen-user] better validation of Schematron schema

Lars Huttar
Wed May 26 11:35:30 CDT 2010


Hi,
My request here does not have to do with validating an XML document
against a Schematron schema, but rather, finding out whether Schematron
schema itself is valid.

I'm pleased with Oxygen's support for Schematron, including ISO
Schematron. Oxygen really has excellent coverage of XML-related tools.
However I have the following enhancement request.

When I'm editing a schema foo.sch in oXygen, I can press Ctrl+Shift+V
and it does something, and says "Document is valid." I guess it's
validating the schema against an RNG schema for Schematron? I don't
know. What I do know is that its validation is not as complete as the
validation for XSLT stylesheets. It helpfully validates the presence of
elements and attributes that are dis/allowed in Schematron (old and ISO
versions); but it does not validate the XPath in test expressions. Just
now I had an assert whose test attribute's value was not well-formed XPath:
            <sch:assert test="../../row1/thing[@id =
current()/transform[@type = 'From']/target/@id">
Note that I'm missing a final square-bracket in the test expression.
Yet Oxygen tells me the Schematron schema is valid.

It was only when I tried to *use* the Schematron schema that it told me
about the missing ']'. And at this point it's quite a bit harder to
debug, because often you're using a manually-constructed pipeline where
you have an XSLT transforming your Schematron schema to another XSLT,
and then the latter is used to validate your XML document. So you have
to sort through several layers to figure out where the problem is.

So my request is for stronger validation for Schematron schemas. I'm not
sure of the best way to accomplish this... Maybe Oxygen could go ahead
and transform the schema to an XSLT using e.g. iso_svrl.xsl and
iso_schematron_skeleton.xsl (in the case of ISO Schematron); then
validate the result as an XSLT stylesheet. This should take care of the
above problem, malformed XPath expressions. It may not be
straightforward to map any errors back to a particular point in the
original schema, but at least we'd know whether the schema was valid or
not, and we'd be better off than we are now, catching errors while
editing the schema instead of when using the schema.

Thanks for your consideration,
Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20100526/3512380b/attachment.html 


More information about the oXygen-user mailing list