cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Using Saxon 7.9 with Cocoon?
Date Wed, 24 Mar 2004 17:51:37 GMT
On Wed, 2004-03-24 at 15:16, Andrzej Jan Taramina wrote:
> Sylvain:
> 
> X-posted to the Saxon list as well.....
> 
> > I remember having such problems with older versions of Saxon, and the 
> > culprit was the AElfred parser that comes bundled with Saxon which is 
> > limited to saxon's needs (hence why it's read-only).
> 
> The latest version of Saxon (7.9) does not include AElfred any more.  AElfred 
> is now a separate download, which I am not using, so that part is not an 
> issue.
> 
> > Two trick solve the problem:
> > - remove the META-INF/services/java.xml.parsers.* files in the saxon jar
> 
> With AElfred not included, this entry is no longer in the jar file.  However, 
> there is a java.xml.transform.TransformerFactory entry in META-INF/services 
> with the value of "net.sf.saxon.TransformerFactoryImpl".  I think this entry 
> is the one that causes the Saxon dom to be used.
> 
> > - rename saxon.jar to zsaxon.jar so that it comes after xerces in the 
> > classpath (highly servlet engine dependent though).
> 
> Already did that, but with the latest versions (and Tomcat), it still seems 
> that you need the Xalan jar file ahead of the Saxon one, or the Saxon read-
> only DOM still gets selected.
> 
> It looks to me that it's the java.xml.transform.TransformerFactory entry in 
> META-INF/services that controls this.  With the Xalan jar first the value 
> points to the Xalan implementation of the TransformerFactory implementation, 
> which in turn grabs the Apache DOM implementation instead of the troublesome 
> Saxon one.  The issue with doing this (even though it works...yay!) is that 
> I'm not sure how much of Xalan versus Saxon is being used for XSL 
> transformations when you use the Xalan transformer factory reference.
> 
> Any insight?

throw out the whole META-INF directory from the saxon jar.

Cocoon uses the transformer stuff also for other things, like going from
SAX to DOM (in the DOMBuilder class) or from SAX to stream (in the
serializers).

For the XSLT processor, the transformer factory class name is specified
in the cocoon.xconf, so the things in META-INF aren't relevant for that.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message