cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Praher <jpra...@yahoo.de>
Subject Re: xmlform, javabeans and xml instances
Date Sat, 04 Jan 2003 19:48:43 GMT
Am Sam, 2003-01-04 um 20.27 schrieb Lee Pollington:
> Hi all,
> 
> I am not that familiar with JavaBeans so please excuse me if this is a dumb
> question, it's not actually that Cocoon specific, anyways...
> 
> XMLForm uses a JavaBean to store the form data, when I reach an end state I
> want to create an XML instance. Is there a standard JavaBean or Cocoon way
> of doing that? I wasn't sure if a pipeline view would do it or if I need to
> create a bespoke class to do it or whether I should be looking at something
> like Castor.
> 
yes castor is a viable solution or just implmenet XMLizable for your
bean. (Betwixt is also a JavaBean <--> XML Serializer)

if you just want a html representation, you could use the 
<xf:output> 
tag to extract values from the model.


you could also implement a custom stylesheet to convert the output of
the "xmlform" transformer:

<xf:output ref="/firstname" >
	
</xf:output>

after the "xmlform" transformer, the xf:output looks like this:
<xf:output ref="/fristname" >
	<xf:value>My Firstname</xf:value>
</xf:output>

at this point you could transform it to anything you like.
by plugging in a transformer after the 

<map:transform type="xmlform" label="debug,xml" />

hope this helps

-- Jakob
> tia,
> Lee
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


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

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


Mime
View raw message