You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rob Hoopman <ro...@tuna.nl> on 2002/11/21 07:16:57 UTC

Output to file/ replace file

Hi,
I realise this is a question that probably has come up before on the list but I can't seem to find it in the archives or on google. 

I have two questions:
1. How can I manipulate files using cocoon, I have some xml data I want to be able to change without storing it in a database.

2. The same question but for binary data, I can upload binary files just fine, but haven't found an obvious way to pick it up from the 'upload-directory' and store it in it's final location.

Pointers to information or past threads apreciated.

Rob

---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Alex McLintock <al...@OWAL.co.uk>.
At 16:13 21/11/02, Alex McLintock wrote:
>Someone asked:
>>1. How can I manipulate files using cocoon, I have some xml data I want 
>>to be able to change without storing it in a database.
>
>
>You might want to look at XOpus which is essentially an "easy" XML editor. 
>You might want to use it with Wyona which is a Cocoon based CMS.
>http://www.xopus.org, http://www.wyona.org


There is also Bitflux, which is similar to XOpus (so I am told) and Wyona 
comes with a html forms editor for XML files - though it isn't completed yet.

Alex



Openweb Analysts Ltd, London.
Software For Complex Websites http://www.OWAL.co.uk/
Open Source Software Companies please register here 
http://www.OWAL.co.uk/oss_support/


---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Ludovic de Beaurepaire <lu...@axonie.com>.
Hi Rob,

> 1. How can I manipulate files using cocoon, I have some xml data I want to
be able to change without storing it in a database.

You can store your xml generated data in a stylesheet :

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
 extension-element-prefixes="redirect">
<xsl:output method="xml" encoding="ISO-8859-1"/>
 <xsl:template match="/">
 <redirect:open file="webapps/cocoon/samples/srvimp/content/xml/doc8.xml"/>
 <redirect:write file="webapps/cocoon/samples/srvimp/content/xml/doc8.xml">
  <xsl:copy-of select="*"/>
 </redirect:write>
 <redirect:close file="webapps/cocoon/samples/srvimp/content/xml/doc8.xml"/>
 </xsl:template >
</xsl:stylesheet>

I think there are better solutions, but i didn't find it when i have this
need.

Ludovic


----- Original Message -----
From: "Rob Hoopman" <ro...@tuna.nl>
To: <co...@xml.apache.org>
Sent: Thursday, November 21, 2002 7:16 AM
Subject: Output to file/ replace file


> Hi,
> I realise this is a question that probably has come up before on the list
but I can't seem to find it in the archives or on google.
>
> I have two questions:
> 1. How can I manipulate files using cocoon, I have some xml data I want to
be able to change without storing it in a database.
>
> 2. The same question but for binary data, I can upload binary files just
fine, but haven't found an obvious way to pick it up from the
'upload-directory' and store it in it's final location.
>
> Pointers to information or past threads apreciated.
>
> Rob
>
> ---------------------------------------------------------------------
> 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>
>
>
>


---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Rob Hoopman <ro...@tuna.nl>.
If you get around to writing a (mini-)howto, I'll be glad to do some 
testing/ proofreading. I need to spend some time on this next week anyway.

Thanks everyone for the replies.

Rob


Sheraz Sharif wrote:

>I, too, have come across this.  I searched the Archives with other
>keywords and discovered this little gem:
>
>http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102950781606334&w=2
>
>Basically, there exists in Cocoon 2.1 and in the scratchpad of 2.0.3 a
>Transformer (SourceWritingTransformer).  Check out the link above.  I
>will probably try it out this weekend and if anyone is interested, I'll
>write up the mini-howto...or at least make an attempt at one.
>
>Sheraz
>
>On Thu, 2002-11-21 at 00:16, Rob Hoopman wrote:
>  
>
>>Hi,
>>I realise this is a question that probably has come up before on the list but I can't seem to find it in the archives or on google. 
>>
>>I have two questions:
>>1. How can I manipulate files using cocoon, I have some xml data I want to be able to change without storing it in a database.
>>
>>2. The same question but for binary data, I can upload binary files just fine, but haven't found an obvious way to pick it up from the 'upload-directory' and store it in it's final location.
>>
>>Pointers to information or past threads apreciated.
>>
>>Rob
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>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>
>
>
>  
>



---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Sheraz Sharif <li...@m3b.net>.
I, too, have come across this.  I searched the Archives with other
keywords and discovered this little gem:

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102950781606334&w=2

Basically, there exists in Cocoon 2.1 and in the scratchpad of 2.0.3 a
Transformer (SourceWritingTransformer).  Check out the link above.  I
will probably try it out this weekend and if anyone is interested, I'll
write up the mini-howto...or at least make an attempt at one.

Sheraz

On Thu, 2002-11-21 at 00:16, Rob Hoopman wrote:
> Hi,
> I realise this is a question that probably has come up before on the list but I can't seem to find it in the archives or on google. 
> 
> I have two questions:
> 1. How can I manipulate files using cocoon, I have some xml data I want to be able to change without storing it in a database.
> 
> 2. The same question but for binary data, I can upload binary files just fine, but haven't found an obvious way to pick it up from the 'upload-directory' and store it in it's final location.
> 
> Pointers to information or past threads apreciated.
> 
> Rob
> 



---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Alex McLintock <al...@OWAL.co.uk>.
Someone asked:
>1. How can I manipulate files using cocoon, I have some xml data I want to 
>be able to change without storing it in a database.


You might want to look at XOpus which is essentially an "easy" XML editor. 
You might want to use it with Wyona which is a Cocoon based CMS.
http://www.xopus.org, http://www.wyona.org


However neither of these are terribly easy to use.

Alex



Openweb Analysts Ltd, London.
Software For Complex Websites http://www.OWAL.co.uk/
Open Source Software Companies please register here 
http://www.OWAL.co.uk/oss_support/


---------------------------------------------------------------------
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>


Re: Output to file/ replace file

Posted by Alex McLintock <al...@OWAL.co.uk>.
>1. How can I manipulate files using cocoon, I have some xml data I want to 
>be able to change without storing it in a database.


To ask a slightly different question - I'd like to use XMLForms as a simple 
survey / questionaire software - and have it drop the results as a text / 
xml file on the file system.
Is there an easy XMLForms example which does that or do I need to get 
XMLForms to write to a DOM objec, and then serialise the DOM object to a file?

Alex




Openweb Analysts Ltd, London.
Software For Complex Websites http://www.OWAL.co.uk/
Open Source Software Companies please register here 
http://www.OWAL.co.uk/oss_support/


---------------------------------------------------------------------
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>