cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: How to inject the result of an action into a generator
Date Wed, 26 Mar 2008 01:49:30 GMT
On 25.03.2008 18:46, shai200 wrote:

> This requirement is the primary function that I'll need from Cocoon,
> otherwise it's not good for me and I'll have to find some other servlet
> generating framework.

It's not that Cocoon does not support this functionality in general. 
What we said so far only means you picked the wrong component types. 
Actions are for different purpose than data generation. Look at Vadim's 
post regarding the alternatives.

> What I require is an "Action Generator" (rather than the existing
> FileGenerator) that takes XHTML output that a POJO (i.e. and Action class)
> returns and then moves it down the pipeline.

 From what I understand you are looking for a component converting 
Strings into XML without coping with the parsing - otherwise you could 
just implement a generator. But even parsing is totally easy, an 
implementation of your own generator could be:

InputSource source = new InputSource(new StringReader("<xmlString>");
SAXParser parser = null;
try {
     parser = (SAXParser) manager.lookup(SAXParser.ROLE);
     parser.parse(source, xmlConsumer);
} finally {
     manager.release(parser);
}

xmlConsumer is available in a generator.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message