* get system-id); no need to force auto-close here
*/
autoCloseInput = false;
} else if (src instanceof DOMSource) {
autoCloseInput = false; // shouldn't matter
ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
return DOMReaderImpl.createFrom((DOMSource) src, cfg);
} else {
throw new IllegalArgumentException("Can not instantiate StAX reader for XML source type "+src.getClass()+" (unrecognized type)");
}
if (in != null) {
ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
}
if (r != null) {
ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
return StreamReaderImpl.construct(CharSourceBootstrapper.construct(cfg, r));
}
if (sysId != null && sysId.length() > 0) {
/* If we must construct URL from system id, caller will not have
* access to resulting stream, need to force auto-closing.
*/
autoCloseInput = true;
ReaderConfig cfg = getNonSharedConfig(pubId, sysId, encoding, forEventReader, autoCloseInput);
try {
URL url = URLUtil.urlFromSystemId(sysId);
in = URLUtil.inputStreamFromURL(url);
return StreamReaderImpl.construct(ByteSourceBootstrapper.construct(cfg, in));
} catch (IOException ioe) {