Ah, nevermind. I had skipped, "To ensure that Saxon is selected
as your XPath implementation, you must specify one of these constants
as your chosen object model..." in the docs. Now, calling...
XPathFactory xpf = XPathFactory.newInstance("http://saxon.sf.net/jaxp/xpath/om");
...does the trick.
Sorry for the noise, all.
More info ...
Loading a Transformer factory works as expected.
TransformerFactory tf = TransformerFactory.newInstance();
log.debug( "TransformerFactory class: " + tf.getClass().getCanonicalName() );
2005-06-09 12:47:06,594 [main] DEBUG - TransformerFactory class: net.sf.saxon.TransformerFactoryImpl
in the logs.
On 6/9/05, Cass Costello <email@example.com > wrote:Hello all,
I'm building a simple API and want to use Saxon at runtime for my xpath and xslt needs.
In Eclipse 3.1, I've created a Junit run configuration that includes "-Djavax.xml.xpath.XPathFactory=net.sf.saxon.xpath.XPathFactoryImpl" in the VM arguments pane. However, when the tests run and I log the loaded XPathFactory's class name, like so..
XPathFactory xpf = XPathFactory.newInstance();
log.debug( "XPathFactory class: " + xpf.getClass().getCanonicalName() );
... the output shows ...
2005-06-09 11:40:09,784 [main] DEBUG - XPathFactory class: com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
I have saxon8.jar and saxon8-xpath.jar on the classpath. What am I doing wrong? Also, , I see the same behavior outside Eclipse. Namely, when using Maven to build my project, running the command...
maven jar -Djavax.xml.xpath.XPathFactory=net.sf.saxon.xpath.XPathFactoryImpl
...doesn't seem to work either. The unit test output is the same as above. I'm using Java 5 on Windows XP.
Thank you for your time,