List of usage examples for org.springframework.beans.factory.xml DefaultDocumentLoader loadDocument
@Override public Document loadDocument(InputSource inputSource, EntityResolver entityResolver, ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws Exception
From source file:org.impalaframework.util.XMLDomUtils.java
public static Document loadDocument(Reader reader, String description) { Document document = null;/* ww w . j av a2 s. c o m*/ DefaultDocumentLoader loader = new DefaultDocumentLoader(); try { InputSource inputSource = new InputSource(reader); document = loader.loadDocument(inputSource, null, new SimpleSaxErrorHandler(logger), XmlBeanDefinitionReader.VALIDATION_NONE, true); } catch (Exception e) { throw new ExecutionException("Unable to load XML document from resource " + description, e); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { } } return document; }