Java 8 LSSerializer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 LSSerializer class.

This code example shows how to use the following methods: getDomConfig, writeToString
        LSInput input = domLS.createLSInput();
        input.setStringData(xml);
        Document document = lsParser.parse(input);
 
        LSSerializer lsSerializer = domLS.createLSSerializer();
        lsSerializer.getDomConfig().setParameter("comments", Boolean.FALSE);
        lsSerializer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
        return lsSerializer.writeToString(document);
    } 
 
    public static void compareXml(final String original, final String marshalled, final boolean ignoreNamespace) throws Exception {
        final String xmlOriginal;
        final String xmlMarshalled;
        if (ignoreNamespace) {
            xmlOriginal = XMLUtils.removeNamespace(original);
            xmlMarshalled = XMLUtils.removeNamespace(marshalled);
        } else { 
            xmlOriginal = original;
            xmlMarshalled = marshalled;
        } 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDomConfig, writeToString
This code example shows how to use the following methods: getDomConfig, write
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDomConfig, write
        } 
        if (domImpl.hasFeature("LS", "3.0") && domImpl.hasFeature("Core", "2.0"))
        { 
            final DOMImplementationLS domImplLS = (DOMImplementationLS) domImpl.getFeature("LS", "3.0");
            final LSSerializer lss = domImplLS.createLSSerializer();
            if (lss.getDomConfig().canSetParameter("format-pretty-print", true))
            { 
                lss.getDomConfig().setParameter("format-pretty-print", true);
                 
                final LSOutput lsOut = domImplLS.createLSOutput();
                lsOut.setEncoding("UTF-8");
                lsOut.setByteStream(out);
                 
                lss.write(node, lsOut);
            } 
            else 
            { 
                logger.warn("DOMConfiguration 'format-pretty-print' parameter isn't settable. Won't pretty print."); 
                write(node, out);
            } 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getDomConfig, write
See Code Examples for Java 8 LSSerializer Methods: