You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Brian Whitman <br...@variogr.am> on 2007/03/16 00:59:48 UTC

XSLTResponseWriter and xslt 2.0

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?





Re: XSLTResponseWriter and xslt 2.0

Posted by Chris Hostetter <ho...@fucit.org>.
: 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


Re: XSLTResponseWriter and xslt 2.0

Posted by Brian Whitman <br...@variogr.am>.
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 <br...@variogr.am> 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/
brian.whitman@variogr.am




Re: XSLTResponseWriter and xslt 2.0

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 3/16/07, Brian Whitman <br...@variogr.am> 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