Package com.volantis.mcs.dom.output

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


        StringWriter writer = new StringWriter();
        StyledDocumentWriter documentWriter = new StyledDocumentWriter(
                writer, styleAttributeName);

        DOMDocumentOutputter outputter = new DOMDocumentOutputter(
                documentWriter, new DebugCharacterEncoder());
        try {
            outputter.output(document);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return writer.toString();
    }
View Full Code Here


            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

        return transformer;
    }

    // javadoc inherited
    public DocumentOutputter createDocumentOutputter(Writer writer) {
        return new DOMDocumentOutputter(
                new VDXMLDocumentWriter(new XMLDocumentWriter(writer)),
                getCharacterEncoder());
    }
View Full Code Here

                getCharacterEncoder());
    }

    // javadoc inherited
    public DocumentOutputter createDebugDocumentOutputter(Writer writer) {
        return new DOMDocumentOutputter(new XMLDocumentWriter(writer),
                                        getCharacterEncoder());
    }
View Full Code Here

    public DocumentOutputter createDocumentOutputter(Writer writer) {

        DTD dtd = protocolConfiguration.getDTD();
        DocumentWriter documentWriter = dtd.createDocumentWriter(writer);

        return new DOMDocumentOutputter(documentWriter, getCharacterEncoder());
    }
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

        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.DOMDocumentOutputter

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.