}
else if (_sourceSystemId != null) {
input = new InputSource(_sourceSystemId);
}
else {
ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
throw new TransformerException(err.toString());
}
// Start pushing SAX events
reader.parse(input);
}
else if (source instanceof SAXSource) {
final SAXSource sax = (SAXSource) source;
XMLReader reader = sax.getXMLReader();
final InputSource input = sax.getInputSource();
// Create a reader if not set by user
if (reader == null) {
reader = _tfactory.getXMLReader();
}
// Hook up reader and output handler
try {
reader.setProperty(LEXICAL_HANDLER_PROPERTY, handler);
}
catch (SAXException e) {
// Falls through
}
reader.setContentHandler(new SAX2TO(handler));
// Start pushing SAX events
reader.parse(input);
}
else if (source instanceof DOMSource) {
final DOMSource domsrc = (DOMSource) source;
new DOM2TO(domsrc.getNode(), handler).parse();
}
else if (source instanceof XSLTCSource) {
final DOMImpl dom = ((XSLTCSource) source).getDOM();
dom.copy(handler);
}
else {
ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
throw new TransformerException(err.toString());
}
}