Closed aanno closed 4 years ago
When I use https://github.com/aanno/ph-schematron/tree/issue_96 in conjunction with -Djavax.xml.xpath.XPathFactory=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
the issue is solved.
Thanks. Sorry for the delay - I am currently busy with other issues. That looks like a classical issue between Saxon and Xalan 🤷♂
I again reworked the API a bit to be more backwards compatible, but from a general point of view I didn't change the logic. Thanks for PR'ing this :)
How did you manage to fix this issue? I'm using version 5.6 and I'm still encountering it.
Thanks !
Did you see setting the XML factory via the system property:
-Djavax.xml.xpath.XPathFactory=com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
Yes but still no luck. I was using variables to simplify a Schematron rule but because I'm using SchematronResourcePure (and after found some issue related to the use of variables), I had to change and the alternative I found was to use current() function to get the context node inside a Xpath predicate.
Any thoughts?
Please try the ...Xslt version instead of the ...Pure version. Pure only supports Xpath and basically sucks for anything real-world...
I managed to get it working with SchematronResourceXSLT but using this approach I have to "compile" the schematron in advance which complicated due to many phases. I tried using SchematronResourceSCH thinking it would work as well (compiling the schematron to xlst and then use it to create the svrl) but it's just hangs for a long time. Is it possible to use SchematronResourceSCH or am I going at this the wrong way?
Schematron Pure: works only with XPath rules - XSLT is not possible. Schematron XSLT: unleashes the full power of Schematron using XSLT as the language of choice
To simplify the process, I added the Maven plugin/ANT task to convert the SCH to XSLT at compile/build time. At runtime you can than simply use the XSLT which is much quicker in execution. hth
When I use http://docbook.org/xml/5.1CR4/sch/docbook.sch Schematron to validate a DocBook, I encounter the following error:
I guess this is because I'm using Saxon.HE@9.9.1-6 and - according the feature matrix - the open source saxon does not support XPath functions.
Is there a way to tell ph-schematron which implementation of
javax.xml.xpath.XPathExpression
to use?