Package org.apache.cocoon.stax.component

Examples of org.apache.cocoon.stax.component.XMLGenerator


                "/org/apache/cocoon/stax/sample/stax-test-document.xml").openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        pipe.addComponent(new ExampleComplexTransformer());
        pipe.addComponent(new XMLSerializer());
        pipe.setup(out);
        pipe.execute();
View Full Code Here


        "/org/apache/cocoon/stax/sample/stax-test-document.xml").openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        List<Attribute> atts = new ArrayList<Attribute>();
        atts.add(factory.createAttribute("attribute", "bad"));
        StartEndElementPairModificationTransformer modifier = new StartEndElementPairModificationTransformer(
                "anyelement", atts, "somethingdifferent", new ArrayList<Attribute>());
View Full Code Here

        "/org/apache/cocoon/stax/sample/stax-test-document.xml").openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        List<Attribute> atts = new ArrayList<Attribute>();
        atts.add(factory.createAttribute("attribute", "bad"));
        atts.add(factory.createAttribute("attribute", "good"));
        StartEndElementPairModificationTransformer modifier = new StartEndElementPairModificationTransformer(
View Full Code Here

        "/org/apache/cocoon/stax/sample/stax-test-document-nestedDifferent.xml").openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        List<Attribute> atts = new ArrayList<Attribute>();
        atts.add(factory.createAttribute("attribute", "bad"));
        StartEndElementPairModificationTransformer modifier = new StartEndElementPairModificationTransformer(
                "anyelement", atts, "somethingdifferent", new ArrayList<Attribute>());
View Full Code Here

                .openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        pipe.addComponent(new SubSetTransformer("element", factory.createAttribute(new QName("attribute"), "first")));
        pipe.addComponent(new XMLSerializer());
        pipe.setup(out);
        pipe.execute();
View Full Code Here

                .openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        pipe.addComponent(new SubSetTransformer("element", factory.createAttribute(new QName("attribute"), "second")));
        pipe.addComponent(new XMLSerializer());
        pipe.setup(out);
        pipe.execute();
View Full Code Here

                .openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        XMLEventFactory factory = XMLEventFactory.newInstance();
        pipe.addComponent(new CleaningTransformer());
        pipe.addComponent(new SubSetTransformer("element", factory.createAttribute(new QName("attribute"), "second"),
                factory.createAttribute(new QName("attribute"), "first")));
        pipe.addComponent(new XMLSerializer());
View Full Code Here

                .openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        pipe.addComponent(new SubSetTransformer("element"));
        pipe.addComponent(new XMLSerializer());
        pipe.setup(out);
        pipe.execute();
View Full Code Here

                IncludeTransformerTest.class.getResourceAsStream("/org/apache/cocoon/stax/includetest_input.xml"))
                .replaceAll("file_to_include\\.xml", include.toURI().toURL().toString());
        FileUtils.writeStringToFile(input, inputSource);

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(new FileInputStream(input)));
        pipe.addComponent(new IncludeTransformer());
        pipe.addComponent(new XMLSerializer());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        pipe.setup(out);
View Full Code Here

        InputStream input = StAXPipelineTest.class.getResource("/org/apache/cocoon/stax/simple.xml").openStream();

        ByteArrayOutputStream out = new ByteArrayOutputStream();

        Pipeline<StAXPipelineComponent> pipe = new NonCachingPipeline<StAXPipelineComponent>();
        pipe.addComponent(new XMLGenerator(input));
        pipe.addComponent(new XMLSerializer());
        pipe.setup(out);
        pipe.execute();

        String created = out.toString();
View Full Code Here

TOP

Related Classes of org.apache.cocoon.stax.component.XMLGenerator

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.