use of org.olat.ims.resources.IMSEntityResolver in project openolat by klemens.
the class QTIExportProcessor method readItemXml.
private Element readItemXml(VFSLeaf leaf) {
Document doc = null;
try {
InputStream is = leaf.getInputStream();
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(is, false);
Element item = (Element) doc.selectSingleNode("questestinterop/item");
is.close();
return item;
} catch (Exception e) {
log.error("", e);
return null;
}
}
use of org.olat.ims.resources.IMSEntityResolver in project openolat by klemens.
the class CPManifestTreeModel method loadDocument.
private Document loadDocument(String documentStr) throws IOException {
InputStream in = null;
Document doc = null;
try {
in = new ByteArrayInputStream(documentStr.getBytes());
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(in, false);
in.close();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new IOException("could not read and parse from string " + documentStr, e);
} finally {
IOUtils.closeQuietly(in);
}
return doc;
}
use of org.olat.ims.resources.IMSEntityResolver in project openolat by klemens.
the class CPManifestTreeModel method loadDocument.
private Document loadDocument(VFSLeaf documentF) throws IOException {
InputStream in = null;
Document doc = null;
try {
in = documentF.getInputStream();
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(in, false);
in.close();
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new IOException("could not read and parse from file " + documentF, e);
} finally {
IOUtils.closeQuietly(in);
}
return doc;
}
Aggregations