Package org.w3c.dom.ls

Examples of org.w3c.dom.ls.LSSerializer


            this != node.getOwnerDocument() ) {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
        }
        DOMImplementationLS domImplLS = (DOMImplementationLS)DOMImplementationImpl.getDOMImplementation();
        LSSerializer xmlWriter = domImplLS.createLSSerializer();
        if (node == null) {
            node = this;
        }
        return xmlWriter.writeToString(node);
    }
View Full Code Here


    }

    private static String serializeTransformElement(Element xformEl) throws DOMException, LSException {
        Document document = xformEl.getOwnerDocument();
        DOMImplementationLS domImplLS = (DOMImplementationLS)document.getImplementation();
        LSSerializer serializer = domImplLS.createLSSerializer();
//        serializer.getDomConfig().setParameter("namespaces", true);
//        serializer.getDomConfig().setParameter("namespace-declarations", true);
        serializer.getDomConfig().setParameter("canonical-form", false);
        serializer.getDomConfig().setParameter("xml-declaration", false);
        String str = serializer.writeToString(xformEl);
        return str;
    }
View Full Code Here

        return docRoot.setUserData(key, data, handler);     
    }     

    public void exportDocument(MemoryStream stream){     
        DOMImplementationLS implls=(DOMImplementationLS)getImplementation();     
        LSSerializer domWriter = implls.createLSSerializer();     
        LSOutput output=implls.createLSOutput();     
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();     
        output.setByteStream(outputStream);     
        output.setEncoding("UTF-8");     
        domWriter.write(this.docRoot, output);     
        stream.writeByteArray(outputStream.toByteArray());           
    }
View Full Code Here

        return docRoot.setUserData(key, data, handler);     
    }     

    public void exportDocument(MemoryStream stream){     
        DOMImplementationLS implls=(DOMImplementationLS)getImplementation();     
        LSSerializer domWriter = implls.createLSSerializer();     
        LSOutput output=implls.createLSOutput();     
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();     
        output.setByteStream(outputStream);     
        output.setEncoding("UTF-8");     
        domWriter.write(this.docRoot, output);     
        stream.writeByteArray(outputStream.toByteArray());           
    }
View Full Code Here

    org.w3c.dom.Element output = (org.w3c.dom.Element) beanServerConnection
        .invoke(blacktieAdmin, "getServersStatus", null, null);
    Document document = output.getOwnerDocument();
    DOMImplementationLS domImplLS = (DOMImplementationLS) document
        .getImplementation();
    LSSerializer serializer = domImplLS.createLSSerializer();
    String str = serializer.writeToString(output);
    log.info(str);
  }
View Full Code Here

      throw new CommandFailedException(-1);
    }
    Document document = output.getOwnerDocument();
    DOMImplementationLS domImplLS = (DOMImplementationLS) document
        .getImplementation();
    LSSerializer serializer = domImplLS.createLSSerializer();
    String str = serializer.writeToString(output);
    log.info(str);
  }
View Full Code Here

            System.out.println("Normalizing document... ");
            doc.normalizeDocument();


            // create DOMWriter
            LSSerializer domWriter = impl.createLSSerializer();
           
            System.out.println("Serializing document... ");
            config = domWriter.getConfig();
            config.setParameter("xml-declaration", Boolean.FALSE);
            //config.setParameter("validate",errorHandler);

            // serialize document to standard output
            //domWriter.writeNode(System.out, doc);
            LSOutput dOut = new DOMOutputImpl();
            dOut.setByteStream(System.out);
            domWriter.write(doc,dOut);

        } catch ( Exception ex ) {
            ex.printStackTrace();
        }
    }
View Full Code Here

        this != node.getOwnerDocument() ) {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
        }
        DOMImplementationLS domImplLS = (DOMImplementationLS)DOMImplementationImpl.getDOMImplementation();
        LSSerializer xmlWriter = domImplLS.createLSSerializer();
        if (node == null) {
            node = this;
        }
        return xmlWriter.writeToString(node);
    }
View Full Code Here

            }
        }
        LSOutput output = impl.createLSOutput();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        output.setByteStream(byteArrayOutputStream);
        LSSerializer writer = impl.createLSSerializer();
        writer.write(doc, output);
        byte[] buf = byteArrayOutputStream.toByteArray();
        return new ByteArrayInputStream(buf);
    }
View Full Code Here

            this != node.getOwnerDocument() ) {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR", null);
            throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
        }
        DOMImplementationLS domImplLS = (DOMImplementationLS)DOMImplementationImpl.getDOMImplementation();
        LSSerializer xmlWriter = domImplLS.createLSSerializer();
        if (node == null) {
            node = this;
        }
        return xmlWriter.writeToString(node);
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.ls.LSSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.