Retrieve XSL Transformed Result

What is the best method for retrieving in Java some XML data applying a XSL on it (to produce a different XML result) ?

I am trying to get in Java the output of Tamino’s pass-thru servlet when using “&_xslsrc=” argument…

I was expecting to find help in the demo zone, but the link “Transform” goes to http://tamino.demozone.softwareag.com/demozone/demo1stApp/tutorial/kap4.html#16, ie nowhere…

At the moment we are doing something like that by using the Cocoon publishing framework. I have created a simple XSP-file which performes a tamino-query based on some parameters I pass to the page. This output is then transformed to HTML, PDF, SVG, … or some user defined format … works fine for us. But I think this solution is only usefull when doing a lot of XSL transformations ( in a webapplication ).

If you would like some more Information about Cocoon, simply go to http://xml.apache.org and select the Cocoon2.0 Project or simply contact me.

Regards,
Christofer Dutz

Thanks for your answer.

Even if I use Cocoon, I will have to open an input stream to read from an URL, which is equivalent to reading data from Tamino’s pass-thru servlet output (the solution I have chosen).

All this returns “flat” data, ie. text representation of data and not a DOM document, as I would like to do, in an ideal world.

d.

Hi David,
You can use Xalan Transformers to transform DOMSource objects into DOMResult objects. I’ve attached an example that uses the new Tamino Java API to return a series of DOM2 objects, which are then transformed using Xalan and a provided example xsl sheet. The result of the transformations is a series of DOMResult objects, and in the example I’ve serialized these to an output file. Hope it’s useful.
TransformDOM.zip (18.8 KB)

In fact I have decided to use JClark’s XP/XT, which are the parser/processor used by Tamino, aren’t they?

Take Bill Leeney suggestion. It will should be a better choice than the JClark. Since Tamino 3.1 had API that implement DOM2 try not to use DOM1.