reader = _tfactory.getXMLReader();
}
// Create a new internal DOM and set up its builder to trap
// all content/lexical events
XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();
//dtmManager.setIncremental(_isIncremental);
saxImpl = (SAXImpl)dtmManager.getDTM(sax, false, wsfilter, true, false,
hasUserReader, 0, hasIdCall);
//final DOMBuilder builder = ((SAXImpl)dom).getBuilder();
try {
reader.setProperty(LEXICAL_HANDLER_PROPERTY, saxImpl);
}
catch (SAXException e) {
// quitely ignored
}
reader.setContentHandler(saxImpl);
reader.setDTDHandler(saxImpl);
saxImpl.setDocumentURI(_sourceSystemId);
}
else if (source instanceof DOMSource) {
// Create a new internal DTM and build it directly from DOM
XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();
//dtmManager.setIncremental(_isIncremental);
saxImpl = (SAXImpl)dtmManager.getDTM(source, false, wsfilter, true,
false, hasIdCall);
saxImpl.setDocumentURI(_sourceSystemId);
}
// Handle StreamSource input
else if (source instanceof StreamSource) {
// Get all info from the input StreamSource object
final StreamSource stream = (StreamSource)source;
final InputStream streamInput = stream.getInputStream();
final Reader streamReader = stream.getReader();
final XMLReader reader = _tfactory.getXMLReader();
// Create a new internal DOM and set up its builder to trap
// all content/lexical events
XSLTCDTMManager dtmManager = XSLTCDTMManager.newInstance();
//dtmManager.setIncremental(_isIncremental);
InputSource input;
if (streamInput != null) {
input = new InputSource(streamInput);
input.setSystemId(_sourceSystemId);
}
else if (streamReader != null) {
input = new InputSource(streamReader);
input.setSystemId(_sourceSystemId);
}
else if (_sourceSystemId != null)
input = new InputSource(_sourceSystemId);
else {
ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_NO_SOURCE_ERR);
throw new TransformerException(err.toString());
}
saxImpl = (SAXImpl)dtmManager.getDTM(new SAXSource(reader, input),
false, wsfilter, true,
false, hasIdCall);
saxImpl.setDocumentURI(_sourceSystemId);
}
else if (source instanceof XSLTCSource) {