Movatterモバイル変換


[0]ホーム

URL:


Apache »Cocoon »

Apache Cocoon

The Apache Cocoon ProjectCocoon Project Logo

 

  Cocoon 3   homepage

Cocoon 3

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 beeasily used with Java code (= no frameworks required!). On top of this, Cocoon 3 has the goal of becoming the best available platform forRESTful webservices and web applications.

Download

Apache Cocoon 3.0.0-alpha-3 is available for download. Please read our alpha software warning message before using it.

Using Pipelines in Java has never been so easy

Here is an example that transforms an XML document by reading it from an URL, will be processed including linked documents following theXInclude recommendation, then will be transformed applying a stylesheet, validated against an XSchema, and finally serialized:

URL base = this.getClass().getResource("http://com.acme/");Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();pipeline.addComponent(new XMLGenerator(new URL(base, "feed.xml")));pipeline.addComponent(new XIncludeTransformer(base));pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/trax.xslt")));pipeline.addComponent(new SchemaProcessorTransformer(this.getClass().getResource("/validate.xsd")));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 stepsbetween the components.

Sitemaps and integration with Java Servlets

But there is more that Cocoon 3 offers. See our features list.

Copyright © 2008-2012 The Apache Software Foundation All Rights Reserved.

Apache Cocoon, Apache, the Apache feather logo, and the Apache Cocoon project logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp