XSLTResponseWriter and xslt 2.0

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XSLTResponseWriter and xslt 2.0

Brian Whitman
There's a lot of good stuff in XSLT 2.0, specifically for Solr users  
-- like grouping, time and date, and uri encoding.

It's my understanding that the javax.xml.transform used by the  
XSLTResponseWriter is 1.0 only-- at least, it does not understand any  
of the 2.0 stuff I've thrown at it. I am new to world of XSL, thanks  
to Solr, but it seems Saxon-B is a good choice.

Has anyone implemented an XSLT2.0 transformer with Solr?




Reply | Threaded
Open this post in threaded view
|

Re: XSLTResponseWriter and xslt 2.0

Bertrand Delacretaz
On 3/16/07, Brian Whitman <[hidden email]> wrote:

> ...It's my understanding that the javax.xml.transform used by the
> XSLTResponseWriter is 1.0 only-- at least, it does not understand any
> of the 2.0 stuff I've thrown at it. I am new to world of XSL, thanks
> to Solr, but it seems Saxon-B is a good choice...

The XSLTResponseWriter gets its Transformer via the
org.apache.solr.util.xslt.TransformerProvider class, which uses the
standard TraX mechanism to get a TransformerFactory:

  TransformerFactory tFactory = TransformerFactory.newInstance();

So (at least in theory - I haven't tried it) you should be able to use
Saxon instead of the standard XSLT library, by making the Saxon jars
available to your Solr instance, and configuring which
TransformerFactory to use as described for example in:

http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/TransformerFactory.html

Saxon is certainly a good XSLT processor, and XSLT 2.0 brings lots of
improvements - if you need them it might be worth trying. If you do,
it'd be cool to report your findings here or on the wiki.

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: XSLTResponseWriter and xslt 2.0

Brian Whitman
Thanks for the help Bertrand. It was very easy to move it over. I  
updated the Wiki page.

Solr grouping ahoy!

http://wiki.apache.org/solr/XsltResponseWriter



On Mar 19, 2007, at 4:59 AM, Bertrand Delacretaz wrote:

> On 3/16/07, Brian Whitman <[hidden email]> wrote:
>
>> ...It's my understanding that the javax.xml.transform used by the
>> XSLTResponseWriter is 1.0 only-- at least, it does not understand any
>> of the 2.0 stuff I've thrown at it. I am new to world of XSL, thanks
>> to Solr, but it seems Saxon-B is a good choice...
>
> The XSLTResponseWriter gets its Transformer via the
> org.apache.solr.util.xslt.TransformerProvider class, which uses the
> standard TraX mechanism to get a TransformerFactory:
>
>  TransformerFactory tFactory = TransformerFactory.newInstance();
>
> So (at least in theory - I haven't tried it) you should be able to use
> Saxon instead of the standard XSLT library, by making the Saxon jars
> available to your Solr instance, and configuring which
> TransformerFactory to use as described for example in:
>
> http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/ 
> TransformerFactory.html
>
> Saxon is certainly a good XSLT processor, and XSLT 2.0 brings lots of
> improvements - if you need them it might be worth trying. If you do,
> it'd be cool to report your findings here or on the wiki.
>
> -Bertrand

--
http://variogr.am/
[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: XSLTResponseWriter and xslt 2.0

Chris Hostetter-3
In reply to this post by Bertrand Delacretaz

: So (at least in theory - I haven't tried it) you should be able to use
: Saxon instead of the standard XSLT library, by making the Saxon jars
: available to your Solr instance, and configuring which
: TransformerFactory to use as described for example in:

the normal plugin lib directory might not work in this case ...
you might have to do it at a higher level for your entire servlet
container ... but it would be intereresting to find out if you wnat to try
it and let us know.



-Hoss