Hi,

I would like to display HTML information from XML Data build on DB Access
using XSL. I found how to use Xalan to define 2 Source (XML & XSL), call
transform et put it in response:

response.setContentType("text/html; charset=UTF-8");
// Output goes in the response stream.
PrintWriter out = response.getWriter();
try
{
  TransformerFactory tFactory = TransformerFactory.newInstance();
  // Get the XML input document and the stylesheet.
  Source xmlSource = new StreamSource(new
URL("http://gateway:8080/Online/xml/CartedebaseJLL.xml";).openStream());
  Source xslSource = new StreamSource(new
URL("http://gateway:8080/Online/xml/CartedebaseJLL.xsl";).openStream());
  // Generate the transformer.
  Transformer transformer = tFactory.newTransformer(xslSource);
  // Perform the transformation, sending the output to the response.
  transformer.transform(xmlSource, new StreamResult(out));
}
catch (Exception e)
{
  out.write(e.getMessage());
  e.printStackTrace(out);
}
out.close();

return new ActionForward(null);

Now, my problem is to build the XML dynamically. I would like to create JSP
pages that will build XML from collection object put in session by Struts
Action bean. But, I don't know how to call the jsp so that xml will be
created, how to get it as a stream and to put it in Xalan transformation.

Who can help me ?

Frederic



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

Reply via email to