atom feed1 message in net.sourceforge.lists.saxon-help[saxon] XPathFactory service provider...
FromSent OnAttachments
Owen ReesJun 29, 2006 4:07 am 
Subject:[saxon] XPathFactory service provider configuration and Java 6
From:Owen Rees (
Date:Jun 29, 2006 4:07:38 am

We ran into a problem trying to use Saxon B8.7.3 with the Java SE 6 beta. It was using its own XPathFactory rather than Saxon and so we were getting exceptions for all the XPath 2 constructs.

It seems that the format of the service provider configuration file in saxon8-xpath.jar - i.e. - META-INF/services/javax.xml.xpath.XPathFactory depends on a bug that has been fixed for Java 6.


Unfortunately, changing the file to contain just the class name "net.sf.saxon.xpath.XPathFactoryImpl" (as the service provider documentation describes) works for Java6(beta) but not for Java 5.

I have discovered that adding a line containing only the class name to the beginning of the configuration file, keeping all the property definitions on subsequent lines, works for both Java 5 and the current Java 6(beta). Of course this depends on both versions being lenient in handling of errors and may cause problems for cases I have not tried; it cannot be recommended except as a crude workaround for those who need to work with both versions of Java.