public void loadDocument(InputStream is) throws XQueryException {
if(!(is instanceof FastBufferedInputStream)) {
is = new FastBufferedInputStream(is);
}
_handler.init();
final StopWatch sw = new StopWatch();
try {
_reader.parse(new InputSource(is));
} catch (IOException ie) {
throw new DynamicError("Invalid source", ie);
} catch (SAXException se) {
throw new DynamicError("Parse failed", se);
}
if(LOG.isDebugEnabled()) {
LOG.debug("Elasped time of building a DTM: " + sw.elapsed() + " msec");
}
this._docid = nextDocumentId();
if(_store instanceof IProfiledDocumentTable) {
((IProfiledDocumentTable) _store).setProfiling(true);
}