You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Hall, Joe" <Jo...@Avnet.com> on 2004/03/12 16:04:49 UTC
XMLReader & XSLTC
I have a xslt implementation using a custom XMLReader for the xml data and a cached Templates object with xalan interpretive mode.
I'd like to convert it to XSLTC, but I can't find any examples on how to combine using a XMLReader and XSLTC.
The StreamSource object doesn't accept a XMLReader interface.
Can anyone please provide some hints or links to references on how to achieve this?
Thanks,
Joe Hall
Here's a code snippet from my app that I want to convert to XSLTC.
TransformerHandler handler = StyleCache.getInstance().getTransformerHandler(xsls[0], resourceBundle);
reader.setContentHandler(handler);
java.util.Properties op = handler.getTransformer().getOutputProperties();
op.setProperty("Content-Type", "text/html"); //? hack to fix websphere 5 problem.
Result result = new StreamResult(this.outputStream);
TransformerHandler newHandler = null;
for (int i = 1; i < xsls.length; i++)
{
newHandler = StyleCache.getInstance().getTransformerHandler(xsls[i], resourceBundle);
handler.setResult(new SAXResult(newHandler));
handler = newHandler;
}
handler.setResult(result);
reader.startDoc();