xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ankur Chavda" <an...@livedoor.com>
Subject mulit-stylesheet root transformations
Date Sun, 13 Aug 2000 22:00:40 GMT
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) {...}

Mime
View raw message