You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ines Robbers <ml...@comprehend.de> on 2003/02/11 17:04:43 UTC

resource-exists problem

Hello!

Can someone help me with this:

<map:pipeline>
    <map:match pattern="test/*">
	 	<map:act type="resource-exists">
			<map:parameter name="url" value="{1}.xml"/>
			<!-- it's available -->
		  <map:generate src="test/{1}.xml"/>
		  <map:transform src="test/style.xsl"/>
        <map:serialize/>
		 </map:act>
		 <!-- not found -->
		 <map:generate src="test/DocumentNotAvailable.xml"/>
		 <map:transform src="test/stylesheet.xsl"/>
		 <map:serialize/>
    </map:match>
</map:pipeline>

When I type in http://localhost:8080/cocoon/test/jobs, for some reason
Cocoon brings up DocumentNotAvailable.xml even though a jobs.xml
document does exist.
What am I doing wrong here?

Many thanks!



Ines Robbers



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


AW: resource-exists problem

Posted by Ines Robbers <ml...@comprehend.de>.
Hi Luca,

Thanks for your help!

* The "url" parameter is relative to the sitemap directory. 
* Therefore, if the jobs.xml existed in the test directory, you 
* would use value="test/jobs.xml" to properly assess its existence.

I managed to get it working.

<map:pipeline>
    <map:match pattern="test/*">
	 	<map:act type="resource-exists">
			<map:parameter name="url" value="{1}.xml"/>
			<!-- it's available -->
		  <map:generate src="{test/../1}.xml"/>
		  <map:transform src="test/style.xsl"/>
        <map:serialize/>
		 </map:act>
		 <!-- not found -->
		 <map:generate src="test/documentNotAvailable.xml"/>
		 <map:transform src="test/stylesheet.xsl"/>
		 <map:serialize/>
    </map:match>
</map:pipeline>


:-)



---------------------------------------------------------------------
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: resource-exists problem

Posted by Luca Morandini <lu...@tin.it>.
Ines,

are you absolutely sure the jobs.xml file is located in the same directory of your sub-sitemap ?

The "url" parameter is relative to the sitemap directory. Therefore, if the jobs.xml existed in the test directory, you would use
value="test/jobs.xml" to properly assess its existence.

Regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Ines Robbers [mailto:mlist@comprehend.de]
> Sent: Tuesday, February 11, 2003 5:05 PM
> To: Cocoon Mailingliste
> Subject: resource-exists problem
>
>
> Hello!
>
> Can someone help me with this:
>
> <map:pipeline>
>     <map:match pattern="test/*">
> 	 	<map:act type="resource-exists">
> 			<map:parameter name="url" value="{1}.xml"/>
> 			<!-- it's available -->
> 		  <map:generate src="test/{1}.xml"/>
> 		  <map:transform src="test/style.xsl"/>
>         <map:serialize/>
> 		 </map:act>
> 		 <!-- not found -->
> 		 <map:generate src="test/DocumentNotAvailable.xml"/>
> 		 <map:transform src="test/stylesheet.xsl"/>
> 		 <map:serialize/>
>     </map:match>
> </map:pipeline>
>
> When I type in http://localhost:8080/cocoon/test/jobs, for some reason
> Cocoon brings up DocumentNotAvailable.xml even though a jobs.xml
> document does exist.
> What am I doing wrong here?
>
> Many thanks!
>
>
>
> Ines Robbers
>
>
>
> ---------------------------------------------------------------------
> 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>