Code example for LSOutput

Methods: setCharacterStream

0
        DOMImplementation domImpl = node.getOwnerDocument().getImplementation();
        DOMImplementationLS domImplLS = (DOMImplementationLS) domImpl.getFeature("LS", "3.0");
        LSSerializer serializer = domImplLS.createLSSerializer();
 
        LSOutput serializerOut = domImplLS.createLSOutput();
        serializerOut.setCharacterStream(output);
 
        serializer.write(node, serializerOut);
    } 
 
    /** 
     * Converts a QName into a string that can be used for attribute values or element content. 
     *  
     * @param qname the QName to convert to a string 
     *  
     * @return the string value of the QName 
     */ 
    public static String qnameToContentString(QName qname) {
        StringBuffer buf = new StringBuffer();
 
        if (qname.getPrefix() != null) {