Page 1 of 1
XPath 2.0 in Schematron
Posted: Fri Feb 10, 2006 7:58 pm
by dsewell
How does oXygen 7 implement its use of XPath 2.0 syntax in a Schematron schema? It is working perfectly, but if I try using Jing externally as
Code: Select all
java -jar /Applications/oxygen/lib/jing.jar schema.sch file.xml
it complains about the non-XPath 1.0 syntax.
This is an issue only because I would like a third party to be able to validate files against my Schematron schema, and they may or may not have oXygen available.
Posted: Mon Feb 13, 2006 4:44 pm
by sorin_ristache
Hi David,
You cannot use XPath 2.0 expressions in your Schematron schemas if your other tool is Jing, because Jing uses its own Schematron validator, which does not support XPath 2.0. In order to use XPath 2.0 expressions you have to modify the template with the match attribute
match="sch:schema | schema" in
skeleton1-5.xsl so that it generates
<axsl:stylesheet version="2.0"> instead of
<axsl:stylesheet version="1.0"> and use the usual process to validate file.xml against schema.sch using skeleton1-5.xsl: apply skeleton1-5.xsl to schema.sch to generate schema.xsl, apply schema.xsl to file.xml to get the Schematron validation error messages. Of course if you include XPath 2.0 expressions in schema.sch the stylesheets skeleton1-5.xsl and schema.xsl must be applied with an XSLT 2.0 processor.
Regards,
Sorin
Posted: Mon Feb 13, 2006 5:41 pm
by dsewell
Aha. Looking at oxygen.jar, I see that skeleton1-5.xsl is built into it. So if I need to share a Schematron schema with someone who does not have oXygen, I will need to give them that file separately. This makes sense.
Thanks,
David S.