Hi Heiko

Thank you for your prompt reply. I don't think I clarified myself very well so I hope 
you don't mind if I give it another go...

The reason I'm confused is because I used the code sample you gave to me in an action 
class, i.e. I copied the code sample from:
http://obj.fork.de/docs/XSLTSample.html

I'm using JSPs so I just replace your velocity context line, i.e.

context.put("xml2html", xml2Html(XSLURI, XMLURI, data));

and put my returned transformed string, from the method xml2Html(), into the RunData 
class as a request attribute [I then just output the transformed String in a JSP 
template]. So, as far as I can tell I am calling the XSLT service exactly the same way 
as in your sample code - i.e. the transform method call:

transformedDoc = serv.transform(xsl, new FileReader(DEFAULT_DOC_PATH + xml));

is giving me back the xsl file!

As far as I know the XSLTService in Turbine is just a wrapper around xalan [I was told 
this in a past mailing list message]. Is it possible I've got a configuration wrong 
somewhere which is causing this?

Is it possible you can send me your turbine properties file? Or can you spot anything 
really silly which I've done?

Thanks again, Hong.

Original Message:
-----------------
From: Heiko Braun [EMAIL PROTECTED]
Date: Wed, 20 Jun 2001 20:02:59 +0100 (BST)
To: [EMAIL PROTECTED]
Subject: Re: Fwd: Re: XSLTService with JSPs


On Wed, 20 Jun 2001, FWC Stylist Hong Wong wrote:

-|I've had a go at trying to use the XSLT service but am getting the XSL file
-|back as the transformed doc!

thats because i use turbine with velocity.
the xml file gets transformed and is then put
into the velocity context as a string object.
this way, you can place the resulting html anywhere in your screen.

-|I'm a little confused [new to XSL] because the we pass in the path to the
-|XSL file as part of the call to the transform method. But, usually you
-|specify the XSL stylesheet in the XML source file [i.e. we seem to be
-|specifying it twice]!

yeah, thats correct. usally you specify the xslsheet in the
xml file. thats where the parser looks (i.e. xalan) to locate
the correct stylesheet. cocoon works the same way.

with the turbine XSLT service it works a little different,
as the xslsheet definition is part of the transform method.

this way you can choose on the fly ,
which xslsheet to take for the transformation.

-|If I remove the reference to the XSL file from my XML source file I then get
-|a badly formed XML file exception!

well, i tried your source files in my app.
with or without the processing instruction it works fine.

i dont know about your requirements.
but if you choose turbine just for the xslt service,
then you should also take a look at cocoon, which makes
the whole transformation somehow easier.

hope that helps,

heiko



--------------------------------------------------------------------
Mail2Web - Check your email from the web at
http://www.mail2web.com/ .


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to