You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ankur Chavda <an...@livedoor.com> on 2000/08/14 00:00:40 UTC

mulit-stylesheet root transformations

I'm doing multiple transformations with pre-compiled StylesheetRoot objects. I prefer using the process(...) method of the StylesheetRoot as opposed to creating XSLTProcessors because the process(...) method is inherently threadsafe and doesn't require a call to XSLTProcessorFactory on every transformation. However, I'm having problems setting the result target of the first transformation to be the second StylesheetRoot object. So right now I'm creating an XSLTProcessor, setting the stylesheet to the second StylesheetRoot object, and calling the first StylesheetRoot's process(...) method with the XSLTProcessor as its ResultTarget. 

I was wondering if there is a simple way to do send the output of one:

StylesheetRoot.process(...)

method call directly to another :

StylesheetRoot.process(...)

method call.

Thanks in advance for any help you might be able to provide.

Ankur Chavda

try {
    processor = XSLTProcessorFactory.getProcessor();
} catch (org.xml.sax.SAXException e) {...}

processor.setStylesheet(srSecond);
org.apache.xml.serialize.OutputFormat ofSecond = srSecond.getOutputFormat();
ofSecond.setEncoding(p.getString(WC_LANGUAGE_ENCODING_KEY));

try {
     processor.setDocumentHandler(srSecond.makeSAXSerializer(baosOutput, ofSecond));
} catch (java.io.UnsupportedEncodingException e) {...}

try {
      srFirst.process(new XSLTInputSource(inputXML),
                       new XSLTResultTarget(processor));
} catch (org.xml.sax.SAXException e) {...}