ClasspathResourceResolver() { impl = getDOMImpl(); }
ClasspathResourceResolver() { impl = getDOMImpl(); }
public static Document emptyDocument(String title) { DOMImplementation impl = getDOMImpl(); Document doc = impl.createDocument("urn:hl7-org:v2xml", title, null); return doc; }
public static Document emptyDocument(String title) { DOMImplementation impl = getDOMImpl(); Document doc = impl.createDocument("urn:hl7-org:v2xml", title, null); return doc; }
private static void checkDOMImplementation() { try { // Check if proper XML support is available DOMImplementation impl = XMLUtils.getDOMImpl(); if (impl == null) { LOG.warn("DOM Level 3 (Load and Save) is NOT supported by the XML library found first on your classpath!"); LOG.warn("XML parsing and encoding as well as working with Conformance Profiles will fail."); } } catch (Throwable e) { LOG.warn("Error occured while trying to retrieve a DOMImplementation.", e); LOG.warn("XML parsing and encoding as well as working with Conformance Profiles will fail."); } }
private static void checkDOMImplementation() { try { // Check if proper XML support is available DOMImplementation impl = XMLUtils.getDOMImpl(); if (impl == null) { LOG.warn("DOM Level 3 (Load and Save) is NOT supported by the XML library found first on your classpath!"); LOG.warn("XML parsing and encoding as well as working with Conformance Profiles will fail."); } } catch (Throwable e) { LOG.warn("Error occured while trying to retrieve a DOMImplementation.", e); LOG.warn("XML parsing and encoding as well as working with Conformance Profiles will fail."); } }
public static Document parse(String s, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSInput input = impl.createLSInput(); input.setStringData(s); return parse(input, validateIfSchema); }
public static Document parse(InputStream s, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSInput input = impl.createLSInput(); input.setByteStream(s); return parse(input, validateIfSchema); }
public static Document parse(InputStream s, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSInput input = impl.createLSInput(); input.setByteStream(s); return parse(input, validateIfSchema); }
public static Document parse(String s, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSInput input = impl.createLSInput(); input.setStringData(s); return parse(input, validateIfSchema); }
public static String serialize(Document document, boolean prettyPrint) { DOMImplementationLS impl = getDOMImpl(); LSSerializer serializer = impl.createLSSerializer(); // document.normalizeDocument(); DOMConfiguration config = serializer.getDomConfig(); if (prettyPrint && config.canSetParameter("format-pretty-print", Boolean.TRUE)) { config.setParameter("format-pretty-print", true); } config.setParameter("xml-declaration", true); LSOutput output = impl.createLSOutput(); output.setEncoding("UTF-8"); Writer writer = new StringWriter(); output.setCharacterStream(writer); serializer.write(document, output); return writer.toString(); }
public static String serialize(Document document, boolean prettyPrint) { DOMImplementationLS impl = getDOMImpl(); LSSerializer serializer = impl.createLSSerializer(); // document.normalizeDocument(); DOMConfiguration config = serializer.getDomConfig(); if (prettyPrint && config.canSetParameter("format-pretty-print", Boolean.TRUE)) { config.setParameter("format-pretty-print", true); } config.setParameter("xml-declaration", true); LSOutput output = impl.createLSOutput(); output.setEncoding("UTF-8"); Writer writer = new StringWriter(); output.setCharacterStream(writer); serializer.write(document, output); return writer.toString(); }
private static Document parse(LSInput input, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSParser parser = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); DOMConfiguration config = parser.getDomConfig(); config.setParameter("element-content-whitespace", false); config.setParameter("namespaces", true); config.setParameter("validate-if-schema", validateIfSchema); return parser.parse(input); }
private static Document parse(LSInput input, boolean validateIfSchema) { DOMImplementationLS impl = getDOMImpl(); LSParser parser = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null); DOMConfiguration config = parser.getDomConfig(); config.setParameter("element-content-whitespace", false); config.setParameter("namespaces", true); config.setParameter("validate-if-schema", validateIfSchema); return parser.parse(input); }