You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bert Van Kets <be...@vankets.com> on 2002/07/31 12:02:05 UTC
creating new file with SWT
Hi all,
I am trying to get the SourceWritingTransformer to create a new XML
file. Is this possible at all? All the samples I find write to existing
files. The portal is the only sample that writes new files, but it's using
session:target to create the new files.
Anyway, here's my code snip
<page>
<source:write>
<source:source>docs/<xsl:value-of
select="$dir"/>/my.xml</source:source>
<source:fragment><page>
<title>new page</title>
<description>description of new page</description>
<content>Enter your content here</content>
</page></source:fragment>
</source:write>
</page>
And the pipeline that manages it
<map:generate type="request"/>
<map:transform src="admin/styles/new-page.xsl">
<map:parameter name="use-request-parameters" value="true"/>
<map:parameter name="dir" value="{1}"/>
</map:transform>
<map:transform type="write-source"/>
<map:serialize type="xml"/>
I'm using CVS HEAD from May 15th. Should I update?
Any help is welcome!
Bert
---------------------------------------------------------------------------------------------
Please notify me if you did not receive this mail.
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>