cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conny Krappatsch <co...@smb-tec.com>
Subject Re: SAXON and Cocoon 2
Date Thu, 08 Feb 2001 08:42:12 GMT
On Wed, 7 Feb 2001 14:44:50 -0500 (EST)
Donald Ball <balld@webslingerZ.com> wrote:
> On Wed, 7 Feb 2001, Conny Krappatsch wrote:
> 
> > For some reason this causes Saxon to throw a
> > TransformerConfigurationException at
> > org.apache.cocoon.components.language.markup.Logicsheet line 89. The
> > exception is catched and causes a NullPointerException at line 91
> (maybe
> > the log writer isn't inititalized).
> 
> that's probably because the java: extension syntax is xalan-specific - i
> don't think any of the xslt transformers have a standard method of
> invoking external methods in xslt-1.0. do you happen to know what
> SAXON's
> syntax is? i suppose we could write two different sitemap.xsl files, one
> per xslt transformer. alternately, we could force c2 to use xalan for
> transforming the sitemap, at least until xslt-1.1 rolls around.
> 
> - donald
> 

The Saxon syntax for external methods looks quite similar to the Xalan
syntax:

Declare a namespace with an URI pointing to the class whose methods you
want to call:

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:map="http://apache.org/cocoon/sitemap/1.0"
    exclude-result-prefixes="java"
    version="1.0"       
xmlns:java="http://xml.apache.org/xslt/java/org.apache.cocoon.sitemap.XSLTFactoryLoader"
>
<!-- The part before the last '/' can be ommited -->

Refer to the class method using the namespace prefix end the method name:

<xsl:variable name="factory-loader" select="java:new()"/>

At least, this is what I understood. I couldn't get the sitemap to work,
because I didn't understand every java call and to which class it belongs.
(I must admit I didn't try very hard ;-). Furthermore I still get this
NullPointerException because of the missing log writer.

BTW, I got the information about saxon from
<http://users.iclway.co.uk/mhkay/saxon/saxon6.2/extensibility.html>.

Hope it helps a lttle bit,
Conny Krappatsch

-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Mime
View raw message