Package org.apache.cocoon.sax.component

Examples of org.apache.cocoon.sax.component.CleaningTransformer


    public void testSAXComponentInStAXPipeline() throws Exception {
        NonCachingPipeline<SAXPipelineComponent> pipeSAX = new NonCachingPipeline<SAXPipelineComponent>();
        ByteArrayOutputStream outputSAX = new ByteArrayOutputStream();
        pipeSAX.addComponent(new org.apache.cocoon.sax.component.XMLGenerator(CleaningTransformerTest.class
                .getResource("/org/apache/cocoon/stax/converter/complex-stax-test-document.xml").openStream()));
        pipeSAX.addComponent(new CleaningTransformer());
        pipeSAX.addComponent(new XMLSerializer());
        pipeSAX.setup(outputSAX);
        pipeSAX.execute();

        String outputSAXString = outputSAX.toString();
        outputSAX.close();

        // StAX pipeline with SAXCleaningTransformer
        InputStream input = CleaningTransformerTest.class.getResource(
                "/org/apache/cocoon/stax/converter/complex-stax-test-document.xml").openStream();
        ByteArrayOutputStream outputStAX = new ByteArrayOutputStream();
        NonCachingPipeline<PipelineComponent> pipeStAX = new NonCachingPipeline<PipelineComponent>();
        pipeStAX.addComponent(new XMLGenerator(input));
        pipeStAX.addComponent(new StAXToSAXPipelineAdapter());
        pipeStAX.addComponent(new CleaningTransformer());
        pipeStAX.addComponent(new XMLSerializer());
        pipeStAX.setup(outputStAX);
        pipeStAX.execute();
        input.close();
View Full Code Here


    public void testSAXComponentInStAXPipeline() throws Exception {
        NonCachingPipeline<SAXPipelineComponent> pipeSAX = new NonCachingPipeline<SAXPipelineComponent>();
        ByteArrayOutputStream outputSAX = new ByteArrayOutputStream();
        pipeSAX.addComponent(new XMLGenerator(IOUtils.toString(CleaningTransformerTest.class.getResource(
                "/org/apache/cocoon/stax/converter/complex-stax-test-document.xml").openStream())));
        pipeSAX.addComponent(new CleaningTransformer());
        pipeSAX.addComponent(new org.apache.cocoon.sax.component.XMLSerializer());
        pipeSAX.setup(outputSAX);
        pipeSAX.execute();

        String outputSAXString = outputSAX.toString();
        outputSAX.close();

        // StAX pipeline with SAXCleaningTransformer
        InputStream input = CleaningTransformerTest.class.getResource(
                "/org/apache/cocoon/stax/converter/complex-stax-test-document.xml").openStream();
        ByteArrayOutputStream outputStAX = new ByteArrayOutputStream();
        NonCachingPipeline<StAXPipelineComponent> pipeStAX = new NonCachingPipeline<StAXPipelineComponent>();
        pipeStAX.addComponent(new org.apache.cocoon.stax.component.XMLGenerator(input));
        pipeStAX.addComponent(new SAXForStAXPipelineWrapper(new CleaningTransformer()));
        pipeStAX.addComponent(new XMLSerializer());
        pipeStAX.setup(outputStAX);
        pipeStAX.execute();
        input.close();
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public LinkedSAXPipelineComponentBuilder addCleaningTransformer() {
        return this.addComponent(new CleaningTransformer());
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sax.component.CleaningTransformer

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.