Thanks,

I had copied those -D parameters from the site I cited in my first e-mail.  It appears to be wrong there.

I added 'Aware' to the -D parameter and it now appears to work, except that I'm back to square one with the <xsl:include> problem that led me down the Xerces path in the first place.  (It's behaving exactly as if I'm not using Xerces)   Now that I'm certain I'm using Xerces and the XInclude processing is enabled, I suspect the problem is in my customer's Schematron setup.  I'll work with them to pursue that avenue.

Thanks again,

Patrick



Michael Kay wrote:

I don't know the answer.

Are you still using

-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration

because there seems to be a typo there: it should be

-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration

Michael Kay
Saxonica

On 14/09/2012 15:12, Patrick Frazer wrote:

Thanks for your help.  If I use your suggestion then it works, but only if I use -xi:off.  If I turn on XInclude processing, then I get this:

Error
  Selected XML parser org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser does not recognize
  request for XInclude processing: Feature 'http://apache.org/xml/features/xinclude' is not
  recognized.
Failed to compile stylesheet. 1 error detected.

I searched the mailing list and came up with a few messages that seem to reference this situation (including some from you), but they seemed to imply that there was an issue in the 8.9 builds that would get addressed soon.

I did add a '-Djava.endorsed.dirs={path}' parameter, but that didn't seem to have any effect.

Thanks again for your time.

Patrick



Michael Kay wrote:

The message

org.apache.xerces.jaxp.SAXParserFactoryImpl not found

indicates that despite your best efforts, Xerces is not on the classpath.

That's because when you use the -jar option, Java ignores the -cp option. You need to use

java -cp (classpath) net.sf.saxon.Transform -xsl:... -s:...

Michael Kay
Saxonica


On 14/09/2012 14:02, Patrick Frazer wrote:

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



------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help