A common model that folks are starting to use is that which Orion also
supports, which is to have XML content directly _in_ the JSP.

I understand that Orion has a mechanism for automatically using XML/XSLT to
convert this XML, based on the user agent, but I haven't tried it myself.

What I _have_ tried, which is what is normally done in a platform-neutral
way, is to write a custom body tag. You can pass the content-type to this
tag as an attribute, along with enough other info to specify the stylesheet,
and the doAfterBody() method can contain the code to do the XSLT. Works very
nicely.

As far as doing the XSLT processing in a servlet, which is obtaining the XML
from the EJB, I'm not sure I see the problem. You don't have to embed the
stylesheet PI in the XML; with Xalan you have the option to use a PI, or
specify an external stylesheet as a parameter to process().

Hope this helps.

Arved Sandstrom

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Kev Palfreyman
Sent: Thursday, June 22, 2000 12:27 PM
To: Orion-Interest
Subject: XML + XSLT -> WML or HTML


I looking for some advice and if possible specific examples for this
problem.

Background: I have experience of earlier servlets, lots of Java, some
XML/XSLT, lots of HTML.  New to EJB/JSP/Servlets2.2/Orion

>From what I understand, I think I should be able to have a servlet talk to
some EJB's and dynamically generate XML.  What I don't understand is how the
correct XSL is chosen to generate either WML or HTML.  The Orion FAQ
indicates it is possible, but I cannot find any detail.

Does my servlet have to check the agent type and insert the correct style
sheet ref in the XML?  But in this case how do I make the transform happen
server side?

Where would JSP fit into this?

Any help or pointers to example code would be really useful.  I've searched
all over the standards / FAQs but not found anything about this, only JSP
directly generating WML (which is not what I want).

Thanks in advance

        Kev

--
Kev Palfreyman
[EMAIL PROTECTED]




Reply via email to