ErrorHandler handler = new SimpleSaxErrorHandler(logger); List<SpringPersistenceUnitInfo> infos = new LinkedList<>(); String resourceLocation = null;
ErrorHandler handler = new SimpleSaxErrorHandler(logger); List<SpringPersistenceUnitInfo> infos = new LinkedList<>(); String resourceLocation = null;
public Document loadDocument(Resource resource) throws IOException, ParserConfigurationException, SAXException { InputStream is = null; try { is = resource.getInputStream(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(isValidating()); factory.setNamespaceAware(true); try { factory.setAttribute(SCHEMA_LANGUAGE_ATTRIBUTE, XSD_SCHEMA_LANGUAGE); } catch (IllegalArgumentException ex) { throw new IllegalStateException("Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. " + "Are you running on Java 1.4 or below with Apache Crimson? " + "If so you must upgrade to Apache Xerces (or Java 5 or >) for full XSD support."); } DocumentBuilder docBuilder = factory.newDocumentBuilder(); docBuilder.setErrorHandler(new SimpleSaxErrorHandler(logger)); docBuilder.setEntityResolver(getEntityResolver()); return docBuilder.parse(is); } finally { if (is != null) { is.close(); } } } }
public Document loadDocument(Resource resource) throws IOException, ParserConfigurationException, SAXException { InputStream is = null; try { is = resource.getInputStream(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(isValidating()); factory.setNamespaceAware(true); try { factory.setAttribute(SCHEMA_LANGUAGE_ATTRIBUTE, XSD_SCHEMA_LANGUAGE); } catch (IllegalArgumentException ex) { throw new IllegalStateException("Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. " + "Are you running on Java 1.4 or below with Apache Crimson? " + "If so you must upgrade to Apache Xerces (or Java 5 or >) for full XSD support."); } DocumentBuilder docBuilder = factory.newDocumentBuilder(); docBuilder.setErrorHandler(new SimpleSaxErrorHandler(logger)); docBuilder.setEntityResolver(getEntityResolver()); return docBuilder.parse(is); } finally { if (is != null) { is.close(); } } } }
public Document loadDocument(Resource resource) throws IOException, ParserConfigurationException, SAXException { InputStream is = null; try { is = resource.getInputStream(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(isValidating()); factory.setNamespaceAware(true); try { factory.setAttribute(SCHEMA_LANGUAGE_ATTRIBUTE, XSD_SCHEMA_LANGUAGE); } catch (IllegalArgumentException ex) { throw new IllegalStateException("Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. " + "Are you running on Java 1.4 or below with Apache Crimson? " + "If so you must upgrade to Apache Xerces (or Java 5 or >) for full XSD support."); } DocumentBuilder docBuilder = factory.newDocumentBuilder(); docBuilder.setErrorHandler(new SimpleSaxErrorHandler(logger)); docBuilder.setEntityResolver(getEntityResolver()); return docBuilder.parse(is); } finally { if (is != null) { is.close(); } } } }
public Document loadDocument(Resource resource) throws IOException, ParserConfigurationException, SAXException { InputStream is = null; try { is = resource.getInputStream(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(isValidating()); factory.setNamespaceAware(true); try { factory.setAttribute(SCHEMA_LANGUAGE_ATTRIBUTE, XSD_SCHEMA_LANGUAGE); } catch (IllegalArgumentException ex) { throw new IllegalStateException("Unable to validate using XSD: Your JAXP provider [" + factory + "] does not support XML Schema. " + "Are you running on Java 1.4 or below with Apache Crimson? " + "If so you must upgrade to Apache Xerces (or Java 5 or >) for full XSD support."); } DocumentBuilder docBuilder = factory.newDocumentBuilder(); docBuilder.setErrorHandler(new SimpleSaxErrorHandler(logger)); docBuilder.setEntityResolver(getEntityResolver()); return docBuilder.parse(is); } finally { if (is != null) { is.close(); } } } }
ErrorHandler handler = new SimpleSaxErrorHandler(logger); List<SpringPersistenceUnitInfo> infos = new LinkedList<>(); String resourceLocation = null;