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 Ismail Siddiqui <is...@gmail.com> on 2008/01/22 21:52:26 UTC

Problem with applying stylesheets

I am trying to apply style sheet to result xml by passing argument  like
stylesheet=tabular.xml . but it complained
that stylesheet may be empty.. when i checked the source code for XMLwriter
.. its lookin under /admin

 private static final char[] XML_START1="<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n".toCharArray();
  private static final char[] XML_STYLESHEET="<?xml-stylesheet
type=\"text/xsl\" href=\"/admin/".toCharArray();
  private static final char[] XML_STYLESHEET_END=".xsl\"?>\n".toCharArray();

the problem is my tomcat context is  /solr so if i copy under /solr/admin it
wont work. i had to create a dummy webapp called admin and it worked.. I can
build dist jar by modifying this code but can any one tell why it is looking
under the /admin/ but not under context/admin.


thanks

Ismail

Re: Problem with applying stylesheets

Posted by Chris Hostetter <ho...@fucit.org>.
: I am trying to apply style sheet to result xml by passing argument  like
: stylesheet=tabular.xml . but it complained
: that stylesheet may be empty.. when i checked the source code for XMLwriter
: .. its lookin under /admin

as noted in the wiki the stylesheet param is (vastly) discouraged ... it 
never really did anything useful, and is a throw back to the pre-apache 
days and an assumption that if anyone within CNET wanted to add a local 
stylesheet they would do it in a special directory that was mapped in the 
web.xml.

In the back of my mind, i was thinking for a while that it would be really 
nice to revive the styesheet param by ading init params to the 
XmlResponseWriter that would let you declare a mapping from stylesheet 
"names" to arbitrary hrefs that you wnat included in the XML output which 
could be full URLs or they could be relative paths pointing at 
get-files.jsp (which has since been replaced by a handler/writer pair) but 
i never got arround to doing it.

if anyone else wants to take it on that would be cool.

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

"Use of the stylesheet param is currently discuraged, as there is 
currently no way to specify external stylesheets, and no stylesheets are 
provided in the Solr distributions (it is a legacy param which will 
hopefully be revived and given new life at some point in the future)"




-Hoss