Transofrming Output of one transformation as input to another

"Schwartz, Rechell R, ALABS" <[email protected]> Sun, 22 Jun 2003 10:36:02 -0500
Newsgroups gmane.text.xml.sax.general
Message-ID <[email protected]>
I am attempting to use SAX to transform an XML file to a SAXResult, and
then to read in the SAXResult as an input source to a second
transformation, and transform the document to HTML to be sent to the
browser. I received an error complaining that the ContentHandler of the
SAXResult was null. Obviously, I don't' understand how to set/use  a
ContentHandler, and I obviously don't understand how to convert a
SAXResult to a SAXSource. Here is the relevant code snippet in my JSP
page. Any help for a newbie like me would be greatly appreciated, as I
am at my wits end. Also, if this is not the right newsgroup for this
problem, please direct me to the right place.

String xsl = "/stylesheets/data.xsl";
String xsl2 = "/stylesheets/format.xsl";
Templates templates = (Templates)application.getAttribute("templates");
Templates templates2 =
(Templates)application.getAttribute("templates2");
if (templates == null) {
				TransformerFactory tfactory =
TransformerFactory.newInstance();
				templates = tfactory.newTemplates(new
StreamSource(getClass().getResourceAsStream(xsl)));
				application.setAttribute("templates",
templates);				
			}
if (templates2 == null) {
		        TransformerFactory tfactory =
TransformerFactory.newInstance();
				templates2 = tfactory.newTemplates(new
StreamSource(getClass().getResourceAsStream(xsl2)));
				application.setAttribute("templates2",
templates2);
			}
Transformer transformer = templates.newTransformer();
SAXResult saxResult = new SAXResult(); transformer.transform(new
StreamSource(new StringReader(hand.detailresult)), saxResult);
transformer = templates2.newTransformer(); transformer.transform(new
StreamSource(saxResult.getSystemId()), new StreamResult(out));



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
List: [email protected]
See:  http://www.saxproject.org
https://lists.sourceforge.net/lists/listinfo/sax-users