You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Smigge <jo...@hotmail.com> on 2008/11/14 10:58:47 UTC

How to Cinclude nothing when a file doesn't exist or have alternative map:generate files

I have a match pattern that makes some tests and also reports about the
contents of a file, if the file happens to exist. The problem is that cocoon
crashes if the file doesn't exist. I can see two possible solutions, but
don't know how to implement them

1) having alternative match patterns: when the first fails, then run the
next one.

2) Using an almost empty file and using cinclude to attach the file to be
tested.

The first one would probably be more convenient, but I don't know how to do
this. And the cinclude also causes a crash, when the file doesn't exist. Any
help?
-- 
View this message in context: http://www.nabble.com/How-to-Cinclude-nothing-when-a-file-doesn%27t-exist-or-have-alternative-map%3Agenerate-files-tp20497599p20497599.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: How to Cinclude nothing when a file doesn't exist or have alternative map:generate files

Posted by Smigge <jo...@hotmail.com>.
Hi!

No I hadn't. Thanks for pointing that selector out. That was just what I was
looking for! It works now!


&quot;DAVIGNON Andre - CETE NP/DIODé/PANDOC&quot;-2 wrote:
> 
> Hi,
> 
> Have you tried the resource-exists selector ?
> 
> <map:select type="resource-exists">
> 
> André
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-Cinclude-nothing-when-a-file-doesn%27t-exist-or-have-alternative-map%3Agenerate-files-tp20497599p20498292.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: How to Cinclude nothing when a file doesn't exist or have alternative map:generate files

Posted by DAVIGNON Andre - CETE NP/DIODé/PANDOC <An...@developpement-durable.gouv.fr>.
Hi,

Have you tried the resource-exists selector ?

<map:select type="resource-exists">

André



Le 14/11/2008 10:58, > Smigge (par Internet, dépôt 
users-return-96849-andre.davignon=developpement-durable.gouv.fr@cocoon.apache.org) 
a écrit  :
> I have a match pattern that makes some tests and also reports about the
> contents of a file, if the file happens to exist. The problem is that cocoon
> crashes if the file doesn't exist. I can see two possible solutions, but
> don't know how to implement them
> 
> 1) having alternative match patterns: when the first fails, then run the
> next one.
> 
> 2) Using an almost empty file and using cinclude to attach the file to be
> tested.
> 
> The first one would probably be more convenient, but I don't know how to do
> this. And the cinclude also causes a crash, when the file doesn't exist. Any
> help?

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