cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Huttar" <lars_hut...@sil.org>
Subject RE: Writing files with cocoon
Date Sat, 04 Sep 2004 02:16:42 GMT
Another way is using the source-writing transformer.
http://cocoon.apache.org/2.1/userdocs/transformers/sourcewriting-transformer.html
We are using this successfully.
I have not tried velocity/xmldb though so I can't say source-writing
is better or worse.

Lars


> -----Original Message-----
> From: Rui Alberto L. Gonçalves [mailto:rui-l-goncalves@ptinovacao.pt]
> Sent: Friday, September 03, 2004 1:33 PM
> To: users@cocoon.apache.org
> Subject: Re: Writing files with cocoon
> 
> 
> Hi David,
> you can do this in various ways, I'm presenting to simple options.
> 
> Using velocity... See documentation/examples how to write
> the velocity template. Just checking examples you can solve
> your problem.
> 
> sitemap.xmap
> <map:match pattern="form_action">
>  <map:generate type="velocity" src="produce_doc.vm/>
>  <map:transform type="xmldb"/>
>  <map:serialize type="xml"/>
> </map:match>
> 
> If you just want to use xslt... 
> 
> sitemap.xmap
> <map:match pattern="form_action">
>  <map:generate src="dummy.xml"/>
>  <map:transform src="your_style_to_produce_xml.xsl">
>   <map:parameter name="use-request-parameters" value="true"/>
>  </map:transform>
>  <map:transform type="xmldb"/>
>  <map:serialize type="xml"/>
> </map:match>
> 
> dummy.xml is a file used just to start the pipeline with a 
> generator. (this is not a really clean solution, but... :)
> This file could be something like <root></root>
> Then in your stylesheet have something like:
> 
> <xsl:stylesheet ...
> 
>   <xsl:param name="form_parameter1"/>
>   <xsl:param name="form_parameter2"/>
>   <xsl:template match="root">
>    ... <!--
> produce xml to xmldb transformer using
> parameter values found in request.
> 
>   </xsl:template>
> /xsl:stylesheet>
> 
> Hope this helps.
> 
> Rui
> 
> 
> 
> 
> On Fri, 2004-09-03 at 16:56, David Verdin wrote:
> > Hi everybody,
> > 
> > I'm currently trying to write the result of a form filling 
> to a file.
> > I could understand how to handle this filling and to pass it to a
> > sitemap.
> > 
> > My problem is now to be able to write this to a file, created
> > dynamically.
> > The final aim is to update a Xindice database. I know there are some
> > wikis to understand how to use Xindice with XMLforms in 
> Cocoon, but as
> > there is no longer support of XMLforms in Cocoon 2.1, I'm trying to
> > achieve my own implementation.
> > 
> > The problem is that I am *really* bad at Java, or even Javascript
> > coding. So I try to use XSLT.
> > My idea is to use an XSLT transformation to create an XML 
> document in
> > Cocoon, and then write this to a file. Is this possible ?
> > 
> > Cheers,
> > 
> > David
> > -- 
> > ************************************
> > David Verdin
> > GES / ENSAR - laboratoire d'informatique
> > 65, rue de St Brieuc
> > CS 84 215
> > 35 042 Rennes cedex
> > e-mail : verdin@lilas.roazhon.inra.fr
> > tél : 02 23 48 54 58
> > fax : 02 23 48 54 50
> > ************************************
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For
> > additional commands, e-mail: users-help@cocoon.apache.org
> -- 
> Rui Alberto L. Gonçalves <rui-l-goncalves@ptinovacao.pt>
> PT Inovação
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


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


Mime
View raw message