cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simone.trip...@gmail.com>
Subject Re: JAXB in Cocoon 3 Pipeline
Date Wed, 17 Feb 2010 07:37:23 GMT
Hi Xasima,
sorry if I missed your email and if I reply so late. Very sorry.
The strategy I can suggest you is the same I applied for the
BetwixtBeanGenerator[1], your thought is right you just have to take a
look at the 'setSAXConsumer(SAXConsumer xmlConsumer)' method
implementation; since SAXConsumer interface extends the ContentHandler
interface, you just need to run your pipeline component ;)

This kind of components has to be definitively integrated in the
optional package, but we've to check first the licensing issues, I'll
propose it on the dev mailing list. If you're pleased to provide a
patch, feel free to do it, I'll follow the thread and take care to
apply it, if licenses allow :)

All the best,
Simo

[1] http://tinyurl.com/ygjdx6e

http://people.apache.org/~simonetripodi/



On Sat, Jan 23, 2010 at 5:40 PM, Xasima <xasima@gmail.com> wrote:
> Hello. I need to use JAXB marshalling as a (SAX-based) generator in cocoon 3
> pipeline.
> Smth like this....
>
> ---------
> // Prepare marshaler
> JAXBContext context = JAXBContext.newInstance(....);
> Marshaller marshaler = context.createMarshaller();
> marshaler.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
> marshaler.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
>
> // Marshaller can output SAX to ContentHandler
> ContentHandler handler = ....
> marshaler.marshal(object, handler);
>
> Pipeline<SAXPipelineComponent> pipe = new
> NonCachingPipeline<SAXPipelineComponent>();
> ...
> ---------
> How to perform  this  ?
>
> Thanks.
>
>
>
>
> --
> Best regards,
>     ~ Xasima ~
>
>
>
> --
> Best regards,
>     ~ Xasima ~
>

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


Mime
View raw message