Package org.dom4j.io

Examples of org.dom4j.io.DocumentSource


        // load a default transformer
        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();

        // use dom4j document as the source
        Source source = new DocumentSource(document);

        // use pretty print format and a buffer for the result
        OutputFormat format = OutputFormat.createPrettyPrint();
        StringWriter buffer = new StringWriter();
        Result result = new XMLResult(buffer, format);
View Full Code Here


        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer();

        // now lets create the TrAX source and result
        // objects and do the transformation
        Source source = new DocumentSource(document);
        StringWriter buffer = new StringWriter();
        StreamResult result = new StreamResult(buffer);
        transformer.transform(source, result);

        String text = buffer.toString();
View Full Code Here

            TransformerFactory factory = TransformerFactory.newInstance();

            Transformer transformer = factory.newTransformer();

            StreamResult result = new StreamResult(out);
            DocumentSource source = new DocumentSource(document);

            transformer.transform(source, result);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

            // return original document
            return document;
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
       
        try
        {
            transformer.transform( source, result );
View Full Code Here

            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        // now lets style the given document
        DocumentSource source = new DocumentSource( document );
        DocumentResult result = new DocumentResult();
        try
        {
            transformer.transform( source, result );
        }
View Full Code Here

        TransformerFactory transformerFactory = TransformerFactory.newInstance();

        Transformer transformer = transformerFactory.newTransformer(new StreamSource(xsl));
        transformer.setParameter("tempDir", tempDir);

        Source xmlSource = new DocumentSource(doc);

        Result outputTarget = new StreamResult(out); // new
                                                     // FileWriter(outFile));

        log.debug("starting bytestream transformation ...");
View Full Code Here

TOP

Related Classes of org.dom4j.io.DocumentSource

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.