// --TransformerFactory actually returns a SAXTransformerFactory instance
// --We didn't care about that before, because we didn't use the
// --SAXTransformerFactory extensions. But now we do, so we cast the result.
SAXTransformerFactory stf =
(SAXTransformerFactory) TransformerFactory.newInstance();
XMLFilter filter1 = stf.newXMLFilter(new StreamSource(stylesheet1));
XMLFilter filter2 = stf.newXMLFilter(new StreamSource(stylesheet2));
// Wire the output of the reader to filter1
// and the output of filter1 to filter2
// --A filter is a kind of reader