You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Zohar Amir <da...@hotmail.com> on 2006/02/22 12:07:12 UTC

tomcat and xslt 2.0

Correct me if I'm wrong here: as I understand it, tomcat uses Xalan as its 
XSLT engine. Xalan does not support XSLT 2.0 .
Is there any other XSLT engine I can use with tomcat (I read something about 
Saxon)? If so, how do I do that?
Thanks,
Zohar. 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and xslt 2.0

Posted by Richard Toren <ri...@supportx.com>.
Sorry, I've been too busy or scatter brained to check here.

I use jdom and invoke  this as:

System.setProperty("javax.xml.transform.TransformerFactory", 
"net.sf.saxon.TransformerFactoryImpl");
trans = new XSLTransformer( new FileInputStream( mytransform ));

I think that you have to request this before you request the 
TransformerFactory then cast the
TransformerFactory to a SAXTransformerFactory before creating the 
Templates object.  I sort of do this step out of force of habit and I'm 
not sure it is absolutely necessary (I think not).

As to the NPE, when saxon does the initial parse of the xslt it reports 
errors, which is a good thing since I write most
of my xslt in emacs.   If the xslt doesn't compile you will get an NPE, 
but that doesn't mean that's your problem in this case.  Make sure you 
are logging  your exceptions. 

Wish I could be more helpful

Richard

Zohar Amir wrote:

> I've tried putting it right before TransformerFactory.newInstance() .
> now, when I invoke the transform method I get NPE at 
> net.sf.saxon.Controller.transform(Controller.java:1319)
> Any help?
>
> ----- Original Message ----- From: "Zohar Amir" <da...@hotmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>; ""Richard Toren"" 
> <ri...@supportx.com>
> Sent: Wednesday, March 01, 2006 9:25 AM
> Subject: Re: tomcat and xslt 2.0
>
>
>> Thanks.
>> Where do I put the System.setProperty(...)?
>>
>> ----- Original Message ----- From: "Richard Toren" 
>> <ri...@supportx.com>
>> To: "Tomcat Users List" <us...@tomcat.apache.org>
>> Sent: Monday, February 27, 2006 7:28 PM
>> Subject: Re: tomcat and xslt 2.0
>>
>>
>>> I think there are not that many xslt 2.0 engines out there to choose 
>>> from. In any case saxon is xslt 2.0 and very fast.  You have to 
>>> include the
>>> jar (obvious, but....) and before you instantiate a 
>>> TransformerFactory set the System property:
>>>
>>> System.setProperty( "javax.xml.transform.TransformerFactory", 
>>> "net.sf.saxon.TransformerFactoryImpl");
>>>
>>> You will get a warning if the xslt is 1.0, but it will still compile 
>>> and function.
>>>
>>> Richard Toren
>>>
>>> Zohar Amir wrote:
>>>
>>>> Correct me if I'm wrong here: as I understand it, tomcat uses Xalan 
>>>> as its XSLT engine. Xalan does not support XSLT 2.0 .
>>>> Is there any other XSLT engine I can use with tomcat (I read 
>>>> something about Saxon)? If so, how do I do that?
>>>> Thanks,
>>>> Zohar.
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and xslt 2.0

Posted by Zohar Amir <da...@hotmail.com>.
I've tried putting it right before TransformerFactory.newInstance() .
now, when I invoke the transform method I get NPE at 
net.sf.saxon.Controller.transform(Controller.java:1319)
Any help?

----- Original Message ----- 
From: "Zohar Amir" <da...@hotmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>; ""Richard Toren"" 
<ri...@supportx.com>
Sent: Wednesday, March 01, 2006 9:25 AM
Subject: Re: tomcat and xslt 2.0


> Thanks.
> Where do I put the System.setProperty(...)?
>
> ----- Original Message ----- 
> From: "Richard Toren" <ri...@supportx.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, February 27, 2006 7:28 PM
> Subject: Re: tomcat and xslt 2.0
>
>
>>I think there are not that many xslt 2.0 engines out there to choose from. 
>>In any case saxon is xslt 2.0 and very fast.  You have to include the
>> jar (obvious, but....) and before you instantiate a TransformerFactory 
>> set the System property:
>>
>> System.setProperty( "javax.xml.transform.TransformerFactory", 
>> "net.sf.saxon.TransformerFactoryImpl");
>>
>> You will get a warning if the xslt is 1.0, but it will still compile and 
>> function.
>>
>> Richard Toren
>>
>> Zohar Amir wrote:
>>
>>> Correct me if I'm wrong here: as I understand it, tomcat uses Xalan as 
>>> its XSLT engine. Xalan does not support XSLT 2.0 .
>>> Is there any other XSLT engine I can use with tomcat (I read something 
>>> about Saxon)? If so, how do I do that?
>>> Thanks,
>>> Zohar.
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and xslt 2.0

Posted by Zohar Amir <da...@hotmail.com>.
Thanks.
Where do I put the System.setProperty(...)?

----- Original Message ----- 
From: "Richard Toren" <ri...@supportx.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, February 27, 2006 7:28 PM
Subject: Re: tomcat and xslt 2.0


>I think there are not that many xslt 2.0 engines out there to choose from. 
>In any case saxon is xslt 2.0 and very fast.  You have to include the
> jar (obvious, but....) and before you instantiate a TransformerFactory set 
> the System property:
>
> System.setProperty( "javax.xml.transform.TransformerFactory", 
> "net.sf.saxon.TransformerFactoryImpl");
>
> You will get a warning if the xslt is 1.0, but it will still compile and 
> function.
>
> Richard Toren
>
> Zohar Amir wrote:
>
>> Correct me if I'm wrong here: as I understand it, tomcat uses Xalan as 
>> its XSLT engine. Xalan does not support XSLT 2.0 .
>> Is there any other XSLT engine I can use with tomcat (I read something 
>> about Saxon)? If so, how do I do that?
>> Thanks,
>> Zohar.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat and xslt 2.0

Posted by Richard Toren <ri...@supportx.com>.
I think there are not that many xslt 2.0 engines out there to choose 
from. In any case saxon is xslt 2.0 and very fast.  You have to include the
jar (obvious, but....) and before you instantiate a TransformerFactory 
set the System property:

System.setProperty( "javax.xml.transform.TransformerFactory", 
"net.sf.saxon.TransformerFactoryImpl");

You will get a warning if the xslt is 1.0, but it will still compile and 
function.

Richard Toren

Zohar Amir wrote:

> Correct me if I'm wrong here: as I understand it, tomcat uses Xalan as 
> its XSLT engine. Xalan does not support XSLT 2.0 .
> Is there any other XSLT engine I can use with tomcat (I read something 
> about Saxon)? If so, how do I do that?
> Thanks,
> Zohar.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org