Hi Andrew,
Andrew S Tomlinson escribió:
> There are server-side XSLT engines (LotusXSL at alphaworks, XALAN at apache,
> XT ) available that you can incorporate into a servlet.
> This servlet could take your XML output (from a JSP) and apply the
> transformations encoded in a designated XSL file and deliver the
> (presumably) HTML result to the client browser.
Yes, but as you mention below you cannot just open an URLConnection to call the JSP
and then apply the
XSLT to the result because you the JSP has to get also the parameters of your
original request and as
you cannot yet get the outputstream of a requestDispatcher.forward()... That's what
Cocoon calls servlet piping and what cannot be one with JSPs.
> The problem of transfering control from the JSP (i.e. the servlet
> representing this JSP) to the XSL servlet can be handled by
> servlet-chaining - a technique that allows you to direct the output of one
> servlet to another according to the mime-type of the output. This feature is
> definitely available in JRun but I do not know about support in other
> containers. You need to make sure you set the mime-type of the JSP output to
> whatever you setup in the servlet-chain configuration (probably text/xml).
We'd rather use the taglib approach because servlet chaining is container dependent
and every container configures it differently. JSP1.1 support is also container
dependent
but as it is a specification, we hope it's support will be more standard and
widespreaded
than the servlet chaining one. And you don't need an extra servlet. OTOH, getting
rid of the servlet and enclosing your JSP pages in an "<apply-xslt ...>" tag when
this
support becomes standard won't be a big fuss so... ;). Tastes again.
> I find it easiest to specify the XSL file to use in the actual XML itself.
> If you are just doing a standard HTML transform though this is probably done
> in one standard XSL that you can identify in an initialization property.
I agree with you. And as you generate your XML "on the fly" using JSP, you can even
decide which XSL to use depending on many factors like the authorized user
etcetera.
> As for browser support, NS6PR1 uses CSS NOT XSL - fine for very rudimentary
> formatting but not what I consider industrial strength.
haven't been there, havent tried that ;). So no opinion yet.
> Regards
> @
Thanks for your input,
Dan
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets