Code example for LSSerializer

Methods: write, setFilter

0
            domImpl = node.getOwnerDocument().getImplementation();
        } 
 
        final DOMImplementationLS domImplLS = (DOMImplementationLS) domImpl.getFeature("LS", "3.0");
        final LSSerializer serializer = domImplLS.createLSSerializer();
        serializer.setFilter(new LSSerializerFilter() {
 
            public short acceptNode(Node arg0) {
                return FILTER_ACCEPT; 
            } 
 
            public int getWhatToShow() { 
                return SHOW_ALL; 
            } 
        }); 
 
        final LSOutput serializerOut = domImplLS.createLSOutput();
        serializerOut.setByteStream(output);
 
        serializer.write(node, serializerOut);
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java