cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Billard <obill...@rennes.jouve.fr>
Subject Re: File existence
Date Wed, 17 Sep 2003 09:24:48 GMT
Hi Halgurt...

Where do you intend to find your file ? In the root of the webapp ?

You can try
*/_    <map:when test="/{request-param:ID}.xml">_/* (add the slash)
With this, your file will be searched relatively to the context root of the webapp.
see [1].

But if your only have one resource to look for, why don't you use the ResourceExistAction,

which is more suited to the check of one file ?
The selector is more for a set of resources... (see [1])

[1] 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/selection/ResourceExistsSelector.html


--
Olivier Billard



On 17/09/2003 11:00, Mustafa Ali, Halgurt wrote:
> Hi,
> 
>  
> 
> I had a Problem yesterday and asked for help, I try it now again, is the 
> pipeline below correct or not? I am getting an Error:
> 
> “Invalid pattern ‘{request-parameter}:ID²
> 
>  
> 
> What is a better way to check if a file exists or not? I am getting the 
> file name from a request parameter.
> 
>  
> 
>  
> 
>  <map:pipeline>
> 
>   <map:match pattern="handling">
> 
>    <map:select type="resource-exists">
> 
> */_    <map:when test="{request-param:ID}.xml">_/*
> 
>      <map:generate type="file" src="default.xml" />
> 
>      <map:transform type="xslt" src="form2data.xsl">
> 
>        <map:parameter name="use-request-parameters" value="true" />
> 
>      </map:transform>
> 
>      <map:transform type="write-source">
> 
>      <map:parameter name="use-request-parameters" value="true" />
> 
>      </map:transform>
> 
>      <map:transform type="xslt" src="form2html.xsl" mime-type="text/xml">
> 
>        <map:parameter name="use-request-parameters" value="true" />
> 
>      </map:transform>
> 
>     </map:when>
> 
>     <map:otherwise>
> 
>      <map:generate type="file" src="default.xml" />
> 
>      <map:transform type="xslt" src="form3data.xsl" />
> 
>     </map:otherwise>
> 
>     </map:select> 
> 
>    <map:serialize type="html" />
> 
>   </map:match>
> 
>   </map:pipeline>
> 
>  
> 
>  Am I doing something wrong?
> 
>  
> 
>  Many thanks,
> 
>  Halgurt



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


Mime
View raw message