Apache Cocoon 3
Apache Cocoon 3 is a major rewrite of Cocoon 2.2. Like Cocoon 2 it is based around the concept of pipelines and sitemaps and it is very similar to Cocoon 2.2 in many respects but is slimmed down and designed to be easily usable from within any Java environment. On top of this, Cocoon 3 has the goal of becoming the best available platform for RESTful webservices and web applications.
Using Pipelines in Java has never been so easy
Here is an example that transforms an XML String by using two stylesheets:
Pipeline pipeline = new NonCachingPipeline(); pipeline.addComponent(new StringGenerator("<x></x>")); pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test1.xslt"))); pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test2.xslt"))); pipeline.addComponent(new XMLSerializer()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); pipeline.setup(baos); pipeline.execute();
The idea behind using a pipeline for this purpose is that the content of the pipeline (in this case SAX events) is streamed without any necessary serialization or deserialization steps between the components.
Sitemaps and integration with Java Servlets
But there is more that Cocoon 3 offers. See our features list.