Package com.volantis.mcs.dom.output

Examples of com.volantis.mcs.dom.output.DocumentOutputter


            XMLDTDBuilder builder = new XMLDTDBuilder();
            builder.setMaximumLineLength(maximumLineLength);

            DTD dtd = builder.buildDTD();

            DocumentOutputter outputter = new DOMDocumentOutputter(
                dtd.createDocumentWriter(writer), getCharacterEncoder());

            outputter.output(outputBuffer.getRoot());

            preContent = writer.toString();
            boolean requiresSub = false;
            int startIndex = 0;
            int endIndex = preContent.length();
View Full Code Here


            // We need to render the content of the anchor as a string.
            Object contentObject = attributes.getContent();
            if (contentObject instanceof DOMOutputBuffer) {
                StringWriter contentWriter = new StringWriter();
                DocumentOutputter outputter = new DOMDocumentOutputter(
                        new XMLDocumentWriter(contentWriter),
                        characterEncoder);


                DOMOutputBuffer contentBuffer = (DOMOutputBuffer) contentObject;
                Element contentRoot = contentBuffer.getRoot();
                try {
                    outputter.output(contentRoot);
                    content = contentWriter.getBuffer().toString();
                } catch (IOException ioe) {
                    logger.error("content-generation-error", ioe);
                }
            } else {
View Full Code Here

                    protocol.setTransformToTextMarker(element, false);

                    // Serialize the element to the string.
                    StringWriter writer = new StringWriter();

                    DocumentOutputter outputter = protocol.createDocumentOutputter(writer);

                    try {
                        outputter.output(element);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }

                    // Create text node with serialized string.
View Full Code Here

    protected void debug(String label, DOMOutputBuffer dom) {
        System.out.println(label);
        Element root = dom.getRoot();
        Writer writer = new OutputStreamWriter(System.out);
        CharacterEncoder encoder = getCharacterEncoder();
        DocumentOutputter outputter = new DOMDocumentOutputter(
            new XMLDocumentWriter(writer), encoder);
        try {
            outputter.output(root);
            writer.flush();
            System.out.println();
        } catch (IOException e) {
            logger.error("dom-outputting-error", new Object[]{dom}, e);
        }
View Full Code Here

     * @param writer
     * @throws IOException
     */
    private void writeDocument(final Document document, final Writer writer)
            throws IOException {
        DocumentOutputter documentOutputter = createDocumentOutputter(writer);
        documentOutputter.output(document);
        documentOutputter.flush();
    }
View Full Code Here

        StringWriter writer = new StringWriter();

        XMLDTDBuilder builder = new XMLDTDBuilder();
        DTD dtd = builder.buildDTD();

        DocumentOutputter outputter = new DOMDocumentOutputter(
            dtd.createDocumentWriter(writer), getCharacterEncoder());

        try {
            outputter.output(dom.getRoot());
            content = writer.toString();

            if (debug) {
                writeLogicalContent("<<");
            }
View Full Code Here

        StringWriter writer = new StringWriter();

        XMLDTDBuilder builder = new XMLDTDBuilder();
        DTD dtd = builder.buildDTD();

        DocumentOutputter outputter = new DOMDocumentOutputter(
            dtd.createDocumentWriter(writer), getCharacterEncoder());

        try {
            outputter.output(prevOutputBuffer.getRoot());
            content = writer.toString();
        } catch (IOException e) {
            if (logger.isDebugEnabled()) {
                logger.debug("Could not add content of pre tag to output" +
                        " because of an unexpected Exception: ", e);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.dom.output.DocumentOutputter

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.