OK, sorry, I misunderstood the question.

So you want a Saxon XSLT transformation factory, which you can get by instantiating net.sf.saxon.TransformerFactoryImpl directly.

And you want the third-party application to use non-Saxon transformation factories and XPath factories, which you can do by setting the Java system properties

* javax.xml.transform.TransformerFactory

* javax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom

respectively. See http://xml.apache.org/xalan-j/xpath_apis.html. The actual settings of these probably depend on whether you want to use the version of Xalan that's distributed with the JDK, or the one distributed directly from Apache - this is outside Saxon territory, so this isn't really the right place to get this information.

Michael Kay

On 24/06/2010 08:53, Asplund Marko wrote:

Thanks for the feedback.

I'm currently using Saxon only for doing XSL transformations so e.g. XPath expressions are not created explicitly in the code.
In addition to specifying the TransformerFactory implementation class through a system property do I need to override other factory implementation class settings in order to get the JAXP default factories for the third party application?
Does Saxon XSL transformation create XPath expressions implicitly? Is the JAXP loading mechanism used to get the XPathFactory or does it use the Saxon implementation directly?



From: Michael Kay [mike@saxonica.com]
Sent: Wednesday, June 23, 2010 19:12
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] Problems using JAXP API and Saxon in parallel

Invoking Saxon explicitly from your application should not be a problem: if you explicitly want Saxon every time, then it's always best to use the explicit constructors rather than rely on the JAXP loading mechanism. The XPathFactory implementation class is net.sf.saxon.xpath.XPathFactoryImpl. If you are using multiple Saxon factory classes in the same application, make sure that they all use the same Saxon Configuration. (But if your application is committed to Saxon, I would stronly suggest using s9api interfaces rather than JAXP interfaces.

The other and more difficult part of the problem is to prevent the "third party web application" from loading Saxon when it hasn't been written to work with Saxon. (It's probably not worth the bother of trying to understand why it doesn't work with Saxon; despite JAXP being a standardized interface, there are many ways of writing applications that work with one JAXP implementation and not another.) It's probably enough to set the system property javax.xml.transform.TransformerFactory to the class name of the Xalan TransformerFactory implementation.

Michael Kay

------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help