cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: JNet integration
Date Tue, 25 Mar 2008 17:56:04 GMT
Reinhard Poetz wrote:
> Reinhard Poetz wrote:
>> What about the developer? He could assemble pipelines this way:
>>
>> URL baseUrl = new URL("file:///C:/temp/");
>> Pipeline pipeline = new NonCachingPipeline();
>> pipeline.addComponent(new FileGenerator(baseUrl, "xyz.xml");
>> pipeline.addComponent(new XSLTTransformer(baseUrl, "xyz.xslt");
>> pipeline.addComponent(new XMLSerializer());
>> pipeline.invoke(new InvocationImpl(System.out));
>
> uuups, small correction:
>
> URL baseUrl = new URL("file:///C:/temp/");
> Pipeline pipeline = new NonCachingPipeline();
> pipeline.addComponent(new FileGenerator(new URL(baseUrl, "xyz.xml"));
> pipeline.addComponent(new XSLTTransformer(new URL(baseUrl, "xyz.xslt"));
> pipeline.addComponent(new XMLSerializer());
> pipeline.invoke(new InvocationImpl(System.out));

Or even using method chaining

new NonCachingPipeline()
    .setBaseURL(new URL("file:///C:/temp/"))
    .setGenerator(new FileGenerator("xyz.xml"))
    .addTransformer(new XSLTransformer("xyz.xslt"))
    .setSerializer(new XMLSerializer(new StreamResult(System.out)))
    .process();

Sylvain

-- 
Sylvain Wallez - http://bluxte.net


Mime
View raw message