I am generating an xml file from a servlet. That works. I want to use a XSLT style sheet with the dynamic xml file. Is that possible? If I use the style sheet with a static xml file it works fine. When I generate the xml file dynamically from a servlet (Tomcat) I get an error message:
Is this what doesn't work dynamically? Thanks very much ... Marv
Hi, It works perfectly and Please check the link http://www.onjava.com/pub/a/onjava/2000/12/15/xslt_servlets.html?page=1 XALAN is required for the XSLT processing. You can get it from the Apache open source project. ATB, Gaya3 ---------------------------------------------------------------------------- Learning By Doing-is Healthy
You can also look into this example, its same like above As mentioned in the above example, you have explicitly specify where the xml file and xsl files were located to the transformer class(see example), it not enough if you just specify <?xml-stylesheet type="text/xsl" href="EssOutline.xsl"?> in the dynamically generated xml file. Also see the XALAN API on how to give the string(i assume u generate xml as string) to the transformer object as an input.