public void setFeature(String featureName, Boolean flag) throws Exception { getDocumentBuilderFactory().setFeature(featureName, flag); } };
/** * Do the parsing * * @param unit the deployment unit * @param file the metadata file * @return the document * @throws Exception for any error */ protected Document doParse(VFSDeploymentUnit unit, VirtualFile file) throws Exception { if (file == null) throw new IllegalArgumentException("Null file"); log.debugf("Parsing: %1s", file.getName()); InputSource source = new VFSInputSource(file); DocumentBuilderFactory factory = getDocumentBuilderFactory(); DocumentBuilder parser = factory.newDocumentBuilder(); parser.setEntityResolver(new JBossEntityResolver()); return parser.parse(source); }
try DocumentBuilder parser = getDocumentBuilderFactory().newDocumentBuilder(); InputSource source = new InputSource(is); source.setSystemId(file.toURI().toString());