You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Madel,Kurt" <km...@csmi.com> on 2001/10/19 14:59:42 UTC

Anyone using Castor with Cocoon2

I would like to use Castor's data binding and pass its Marshalled xml to
Cocoon2

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Anyone using Castor with Cocoon2

Posted by Frank Taffelt <fr...@interface-business.de>.
Hi,

i'm using the following function to marshal a castor object into cocoon.

/**
  * marshalls an object into cocoon
  *
  * @param obj an <code>Object</code> the Castor generated Object
  * @param map a <code>Mapping</code> the Castor Mapping Object for the
given object
  * @exception Exception if an error occurs
  */
 private void marshal(Object obj,Mapping map) throws Exception{
   Marshaller marshaller = new Marshaller(new DocumentHandlerAdapter(new
EmbeddedXMLPipe(this.xmlConsumer)));
   marshaller.setMapping( map);
   marshaller.marshal(obj);
 }

you can call this from an xsp-page to render your data.

hth,
frank





---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>