Open ujay68 opened 4 years ago
The difference seems to be in the XSLT implementation, depending on whether Saxon is in the classpath or not. The method com.thaiopensource.validate.schematron.ISOSchemaReaderImpl#createSchema
uses these implementations (AdoptOpenJDK build 1.8.0_242-b08 on macOS):
With Saxon in the classpath:
XMLReader:
com.icl.saxon.aelfred.SAXDriver
TemplatesHandler:
com.icl.saxon.TemplatesHandlerImpl
Without Saxon in the classpath:
XMLReader:
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
TemplatesHandler:
com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesHandlerImpl
The Xalan XSLT compiler runs into an ER_NAMESPACE_PREFIX
exception somewhere deep in its stack (GregorSamsa in between). So, one of these countless bugs in JDK's repackaged Xalan probably.
Strange effect: When I use the runnable jing.jar v20181222 or the runnable jing.jar built with Ant from the current head (commit 12275d1) on the attached Schematron schema and test.xml, I get this exception:
To me, the schema looks ok. I've tried to hunt this down with a development setup in an IDE (IntelliJ IDEA), but when I run the current head code from within the IDE, the xml file validates just fine.
Maybe something to do with a resource missing from the jar but found by the IDE? Any idea what might be wrong here?
test.sch.txt test.xml.txt