Could you provide stack trace from the service?
Perhaps it is possible to fix CXF in a way to support both evaluate() versions. 
Patch is welcome.
Actually I see only workaround with endorsed/classpath hack for Xalan.

Cheers,
Andrei.

From: [email protected] [mailto:[email protected]]
Sent: Mittwoch, 21. November 2012 15:27
To: [email protected]
Subject: Using CXF with Saxon 9.4


Hi guys,

Just joined this mailing list and I have a question:

We are using CXF WebServices in our project web module running on Tomcat.
Now we have Saxon 6.5.5 library in our project dependecies, but we are going to 
use Saxon 9.4 to get benefit of using XSLT2.0.

The problem is that it seams CXF framework doesn't work with Saxon 9.4 library 
(error soap response with a message inside it saying can't cast Arraylist to a 
nodelist),

because:
Saxon has taken to XSLT 2.0 and XPath 2.0 implementation. In 9.4 the library 
goes on to override the default namespace for Xpath to a Saxon implementation, 
this wasn't done in 6.x version. The issue is mainly centered around the 
implementation of "xpath.evaluate(expression, inputSource, 
XPathConstants.NODESET);".

If the InputSource passed is a org.xml.sax.InputSource then an ArrayList (of 
TinyElementImpl) is returned back. If the InputSource is a Document, only then 
it returns a NodeList which most of the callers expect. Michael Kay (person who 
wrote Saxon) says in his blog post the reason behind this change.

It seams CXF expects a NodeList return type that's why XML -->Java -->XML 
marshalling is impacted.

Does anyone know some workaround to make CXF work with Saxon 9.4,
except hacking classpath to inject lets say Xalan library to be picked up 
before Saxon library to satisfy CXF framework?

Thank you,
Oleg

Reply via email to