You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2001/02/06 21:44:21 UTC
SAXON and Cocoon 2
Is anyone planning on getting SAXON to work with Cocoon 2?
My feeble attempts have all failed. SAXON is supposed to be
jaxp compliant, and all the examples I have seen from the
SAXON archive are pretty much the same as for Xalan 2.
SAXON is a little faster than Xalan 2 right now, so I wanted
to give it a shot.
Re: SAXON and Cocoon 2
Posted by Conny Krappatsch <co...@smb-tec.com>.
On Wed, 7 Feb 2001 14:44:50 -0500 (EST)
Donald Ball <ba...@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
Re: SAXON and Cocoon 2
Posted by Giacomo Pati <gi...@apache.org>.
Davanum Srinivas wrote:
> Berin, Conny,
>
> Looked at this issue a bit deeper. XSLTFactoryLoader acts like a gateway to
> the following classes: - RegexpTargetHostMatcherFactory.java
> - RegexpURIMatcherFactory.java
> - WildcardURIMatcherFactory.java
> - BrowserSelectorFactory.java
> - CodedSelectorFactory.java
The XSLTFactoryLoader in the sitemap.xsl is used to access sitemap components
(Matcher, Selector) which implements the CodeFactory interface to collect the
source code which should be integrated into the generated sitemap class.
Giacomo
>
> One sample entry point in XSLTFactoryLoader is getClassSource:
> public String getClassSource(String className, String prefix, String
> pattern, NodeIterator conf)
>
> The problem is that SAXON does not allow NodeIterator's. But they do allow
> NodeList's. So if someone has a bit more time....But i did send an e-mail
> to mike about supporting NodeIterator's.
>
> Thanks,
> dims
>
> --- Conny Krappatsch <co...@smb-tec.com> wrote:
> > On Tue, 06 Feb 2001 15:44:21 -0500
> >
> > Berin Loritsch <bl...@apache.org> wrote:
> > > Is anyone planning on getting SAXON to work with Cocoon 2?
> > > My feeble attempts have all failed. SAXON is supposed to be
> > > jaxp compliant, and all the examples I have seen from the
> > > SAXON archive are pretty much the same as for Xalan 2.
> > >
> > > SAXON is a little faster than Xalan 2 right now, so I wanted
> > > to give it a shot.
> >
> > After a first try with Saxon and a quick look at the sitemap code it
> > looks like the sitemap is based on some Xalan specific extensions, e.g.
> > in sitemap.xsl line 25:
> >
> > <xsl:variable name="factory-loader"
> > select="java:org.apache.cocoon.sitemap.XSLTFactoryLoader.new()"/>
> >
> > 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).
> >
> > If Saxon is stable and fast (which it seems to be) it would be great to
> > have it as Xalan alternative.
> >
> > regards,
> > Conny
> >
> > --
> > ______________________________________________________________________
> > Conny Krappatsch mailto:conny@smb-tec.com
> > SMB GmbH http://www.smb-tec.com
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
>
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
Re: SAXON and Cocoon 2
Posted by Davanum Srinivas <di...@yahoo.com>.
Berin, Conny,
Looked at this issue a bit deeper. XSLTFactoryLoader acts like a gateway to the following classes:
- RegexpTargetHostMatcherFactory.java
- RegexpURIMatcherFactory.java
- WildcardURIMatcherFactory.java
- BrowserSelectorFactory.java
- CodedSelectorFactory.java
One sample entry point in XSLTFactoryLoader is getClassSource:
public String getClassSource(String className, String prefix, String pattern, NodeIterator conf)
The problem is that SAXON does not allow NodeIterator's. But they do allow NodeList's. So if
someone has a bit more time....But i did send an e-mail to mike about supporting NodeIterator's.
Thanks,
dims
--- Conny Krappatsch <co...@smb-tec.com> wrote:
> On Tue, 06 Feb 2001 15:44:21 -0500
> Berin Loritsch <bl...@apache.org> wrote:
> > Is anyone planning on getting SAXON to work with Cocoon 2?
> > My feeble attempts have all failed. SAXON is supposed to be
> > jaxp compliant, and all the examples I have seen from the
> > SAXON archive are pretty much the same as for Xalan 2.
> >
> > SAXON is a little faster than Xalan 2 right now, so I wanted
> > to give it a shot.
>
> After a first try with Saxon and a quick look at the sitemap code it looks
> like the sitemap is based on some Xalan specific extensions, e.g. in
> sitemap.xsl line 25:
>
> <xsl:variable name="factory-loader"
> select="java:org.apache.cocoon.sitemap.XSLTFactoryLoader.new()"/>
>
> 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).
>
> If Saxon is stable and fast (which it seems to be) it would be great to
> have it as Xalan alternative.
>
> regards,
> Conny
>
> --
> ______________________________________________________________________
> Conny Krappatsch mailto:conny@smb-tec.com
> SMB GmbH http://www.smb-tec.com
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
Re: SAXON and Cocoon 2
Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 7 Feb 2001, Conny Krappatsch wrote:
> On Tue, 06 Feb 2001 15:44:21 -0500
> Berin Loritsch <bl...@apache.org> wrote:
> > Is anyone planning on getting SAXON to work with Cocoon 2?
> > My feeble attempts have all failed. SAXON is supposed to be
> > jaxp compliant, and all the examples I have seen from the
> > SAXON archive are pretty much the same as for Xalan 2.
> >
> > SAXON is a little faster than Xalan 2 right now, so I wanted
> > to give it a shot.
>
> After a first try with Saxon and a quick look at the sitemap code it looks
> like the sitemap is based on some Xalan specific extensions, e.g. in
> sitemap.xsl line 25:
>
> <xsl:variable name="factory-loader"
> select="java:org.apache.cocoon.sitemap.XSLTFactoryLoader.new()"/>
>
> 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
Re: SAXON and Cocoon 2
Posted by Conny Krappatsch <co...@smb-tec.com>.
On Tue, 06 Feb 2001 15:44:21 -0500
Berin Loritsch <bl...@apache.org> wrote:
> Is anyone planning on getting SAXON to work with Cocoon 2?
> My feeble attempts have all failed. SAXON is supposed to be
> jaxp compliant, and all the examples I have seen from the
> SAXON archive are pretty much the same as for Xalan 2.
>
> SAXON is a little faster than Xalan 2 right now, so I wanted
> to give it a shot.
After a first try with Saxon and a quick look at the sitemap code it looks
like the sitemap is based on some Xalan specific extensions, e.g. in
sitemap.xsl line 25:
<xsl:variable name="factory-loader"
select="java:org.apache.cocoon.sitemap.XSLTFactoryLoader.new()"/>
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).
If Saxon is stable and fast (which it seems to be) it would be great to
have it as Xalan alternative.
regards,
Conny
--
______________________________________________________________________
Conny Krappatsch mailto:conny@smb-tec.com
SMB GmbH http://www.smb-tec.com