XMLReader xr;
try {
xr = XMLReaderFactory.createXMLReader();
} catch (SAXException e) {
AnalysisContext.logError("Couldn't create XMLReaderFactory", e);
throw new DocumentException("Sax error ", e);
}
xr.setContentHandler(handler);
xr.setErrorHandler(handler);
xr.parse(new InputSource(reader));
} catch (SAXParseException e) {
if (base != null) {
throw new DocumentException("Parse error at line " + e.getLineNumber() + " : " + e.getColumnNumber() + " of "
+ base, e);
}
throw new DocumentException("Parse error at line " + e.getLineNumber() + " : " + e.getColumnNumber(), e);
} catch (SAXException e) {
// FIXME: throw SAXException from method?
if (base != null) {
throw new DocumentException("Sax error while parsing " + base, e);
}
throw new DocumentException("Sax error ", e);
} finally {
Util.closeSilently(reader);
profiler.end(handler.getClass());
}
timeFinishedLoading = System.currentTimeMillis();