Re: Flowscript - delete file

"[email protected]" <[email protected]>
Newsgroups gmane.text.xml.cocoon.user
Message-ID <[email protected]>
Hi Peter,

It's not flowscript, but I believe one can also use the source-writing 
transformer to delete xml files from the filesystem:

<page>
    ...
    <source:delete>
      <source:source>context://doc/editable/my.xml</source:source>
    <source:delete>
    ...
  </page>

One can insert the exact filename via a sitemap parameter/xslt variable earlier in the chain, then use:

<map:transform type="write-source"/>

to delete.

See: https://cocoon.apache.org/2.1/userdocs/sourcewriting-transformer.html

Dan




On 2012-12-29 3:05 AM, Peter Sparkes wrote:
> Solved
>
> I found the answer at 
> http://markmail.org/message/7psype56uhu5kbad#query:+page:1+mid:ezqkl6i255bjdw75+state:results
>
> I amended file.delete(); to:
>
> file["delete"]();
>
> and it works,  the file is deleted. However, I don't know why it works
>
> Thank you all for your help
>
> Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.