Hi,

I'm working on a project to validate technical journal XML content with a customer-supplied Schematron.  I am able to do so using this sort of command:

java -jar C:\{path}\SaxonHE9-4-0-4J\saxon9he.jar -xsl:C:\{path}\XSLFilename.xsl -s:C:\{path}/InputFilename.sch -o:C:\{path}\OutputFilename.sch  -xi:on

... except that it fails because of an <xsl:include> element used in the Schematron.  The -xi switch is supposed to enable XInclude processing, but the Saxon documentation says "
This currently only works when documents are parsed using the Xerces parser, which is the default in JDK 1.5 and later."

I'm using the JRE 1.6 (not JDK) so I assumed that I needed to download Xerxes 2.11.0, put it in my classpath and configure it with -D switches.  I found some documentation at http://www.sagehill.net/docbookxsl/Xinclude.html that seems to describe what I want to do, and following it yielded this attempt:  (linebreaks added for readability)


java \
 -cp C:\
{path}\SaxonHE9-4-0-4J\saxon9he.jar;C:\{path}\xerces-2_11_0\xercesImpl.jar;C:\{path}\xerces-2_11_0\xml-apis.jar;C:\{path}\xerces-2_11_0\resolver.jar;C:\{path}\xerces-2_11_0\serializer.jar \
 -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl \
 -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \
 -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration \
 -jar C:\
{path}\SaxonHE9-4-0-4J/saxon9he.jar \
 -xsl:C:\
{path}\iso-schematron-xslt2/iso_dsdl_include.xsl \
 -s:C:\
{path}\Schematron/JOURNALARTICLE-CURRENT.sch \
 -o:C:\
{path}\iso-schematron-xslt2/temp1.sch -xi:on

... which throws:

XSLT: Exception in thread "main" javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
XSLT:   at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
XSLT:   at net.sf.saxon.java.JavaPlatform.loadParser(JavaPlatform.java:97)
XSLT:   at net.sf.saxon.Configuration.loadParser(Configuration.java:2427)
XSLT:   at net.sf.saxon.Configuration.getStyleParser(Configuration.java:2452)
XSLT:   at net.sf.saxon.PreparedStylesheet.loadStylesheetModule(PreparedStylesheet.java:272)
XSLT:   at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:206)
XSLT:   at net.sf.saxon.PreparedStylesheet.compile(PreparedStylesheet.java:106)
XSLT:   at net.sf.saxon.Transform.doTransform(Transform.java:559)
XSLT:   at net.sf.saxon.Transform.main(Transform.java:73)

I'm not a proficient Java hacker, so it seems to me that by putting the Saxon and Xerces .jar files in the classpath (with -cp) and configuring Xerces with the -D switches would be sufficient, but apparently not.  If anyone has pointers regarding correcting my Java invocation such that I can use the Xerces .jars I downloaded, or how to enable XInclude functionality without it, I would appreciate it.

Thanks for your time.

Patrick Frazer