Examples of XMLGenerator


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

        pipeline.execute();
    }

    private Pipeline<SAXPipelineComponent> createValidatingPipeline(String xmlInput) {
        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
        pipeline.addComponent(new XMLGenerator(xmlInput));
        pipeline.addComponent(new SchemaProcessorTransformer(this.getClass().getResource("/test.xsd")));
        pipeline.addComponent(new XMLSerializer());

        return pipeline;
    }
View Full Code Here

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

        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put("translet-name", "CompiledXslt");
        attributes.put("package-name", "org.apache.cocoon.sax");

        newCachingPipeline()
            .setStarter(new XMLGenerator("<x></x>"))
            .addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt"), attributes))
            .setFinisher(new XMLSerializer())
            .withEmptyConfiguration()
            .setup(baos)
            .execute();
View Full Code Here

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

     * A pipeline that performs a simple transformation: generator -&gt; transformer -&gt;
     * serializer.
     */
    public void testPipelineWithTransformer() throws Exception {
        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
        pipeline.addComponent(new XMLGenerator("<x></x>"));
        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt")));
        pipeline.addComponent(new XMLSerializer());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos);
View Full Code Here

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

        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put("translet-name", "CompiledXslt");
        attributes.put("package-name", "org.apache.cocoon.sax");

        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
        pipeline.addComponent(new XMLGenerator("<x></x>"));
        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt"), attributes));
        pipeline.addComponent(new XMLSerializer());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        pipeline.setup(baos);
View Full Code Here

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

public final class FopSerializerTestCase {

    @Test
    public void testPipelineWithFOPSerializer() throws Exception {
        Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
        pipeline.addComponent(new XMLGenerator(this.getClass().getResource("page.xml")));
        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("page2fo.xsl")));
        pipeline.addComponent(new FopSerializer());

        File tmp = File.createTempFile("fop_test_case", ".pdf");
        FileOutputStream fos = new FileOutputStream(tmp);
View Full Code Here

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

        try {
            // a single ZipEntry in the ZipInputStream (see ReportJob)
            zis.getNextEntry();

            Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
            pipeline.addComponent(new XMLGenerator(zis));

            Map<String, Object> parameters = new HashMap<String, Object>();
            parameters.put("status", reportExec.getStatus());
            parameters.put("message", reportExec.getMessage());
            parameters.put("startDate", reportExec.getStartDate());
View Full Code Here

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

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

        ByteArrayOutputStream outputStAX = new ByteArrayOutputStream();

        NonCachingPipeline<StAXPipelineComponent> pipeStAX = new NonCachingPipeline<StAXPipelineComponent>();
        pipeStAX.addComponent(new XMLGenerator(input));
        pipeStAX.addComponent(new CleaningTransformer());
        pipeStAX.addComponent(new XMLSerializer());

        pipeStAX.setup(outputStAX);
        pipeStAX.execute();
View Full Code Here

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));
        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

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));
        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

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

                "/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
TOP
Copyright © 2018 www.massapi.com. 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.