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 Fri, 19 Sep 2003 08:29:20 GMT
Sorry, I think I misinterpreted your goal in your pipe...
To fit what you want, the red line whould be :

<map:generate type="file" src="default.xml" />

--
Olivier Billard


On 19/09/2003 09:32, Mustafa Ali, Halgurt wrote:

> Hi,
> 
>  
> 
> I had 2 days ago a question about the way to test whether a file exist 
> or not, I got a lot of answers, the answers are list below, the last 
> suggestion was to write something like that:
> 
>  
> 
> <map:pipeline>
> 
>   <map:match pattern="handling">
> 
>  
> 
>    <map:act type="resource-exists">
> 
>     <map:parameter name="url" value="context://{request-param:ID}.xml"/>
> 
>  
> 
>     <!-- if resource exists : -->
> 
>     <map:generate type="file" src="{request-param:ID}.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:serialize type="html" />
> 
>    </map:act>
> 
>  
> 
>     <!-- else -->
> 
>     <map:generate type="file" src="default.xml" />
> 
>     <map:transform type="xslt" src="form2data.xsl" />
> 
>     <map:serialize type="html" />
> 
>    </map:match>
> 
> </map:pipeline>
> 
>  
> 
> but then I get an error message for the red marked line:
> 
>  
> 
> error while creating node generate at (red line)
> 
>  
> 
> Please help, I am really despaired.
> 
>  
> 
> Many thanks
> 
>  
> 
>  
> 
>  
> 
>  
> 
> -----Ursprüngliche Nachricht-----
> Von: Olivier Billard [mailto:obillard@rennes.jouve.fr]
> Gesendet: Mittwoch, 17. September 2003 10:29
> An: users@cocoon.apache.org
> Betreff: Re: AW: AW: AW: File existence
> 
>  
> 
> it is *{request-param:ID}* instead of {request-parameter:ID}
> 
>  
> 
> --
> 
> Olivier Billard
> 
>  
> 
>  
> 
> On 17/09/2003 09:41, Mustafa Ali, Halgurt wrote:
> 
>  
> 
>>  Oh it seems no to work, I got an Error, her eis it:
> 
>>
> 
>>  Invalid pattern '{request-parameter:ID}'
> 
>>
> 
>>  Do you have an idea what this is?
> 
>>
> 
>>  regards,
> 
>>
> 
>>  -----Ursprüngliche Nachricht-----
> 
>>  Von: Joerg Heinicke [mailto:jheinicke@virbus.de]
> 
>>  Gesendet: Dienstag, 16. September 2003 15:11
> 
>>  An: users@cocoon.apache.org
> 
>>  Betreff: Re: AW: AW: File existence
> 
>>
> 
>>  Try to pass the value of {request-param:ID} to the stylesheet or debug 
> it in
> 
>>  another way and tell us if this works correctly.
> 
>>
> 
>>  Joerg
> 
>>
> 
>>  Mustafa Ali, Halgurt wrote:
> 
>>
> 
>> >But I am using different stylesheets, I made a mistake, I corrected my 
> pipeline and now the Otherwise part will be taken, never mind if the 
> file exists or not, I think there  is an error in the red line.
> 
>> >
> 
>> >Thanks,
> 
>> >Halgurt
> 
>> >
> 
>> >-----Ursprüngliche Nachricht-----
> 
>> >Von: Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com]
> 
>> >Gesendet: Dienstag, 16. September 2003 14:56
> 
>> >An: users@cocoon.apache.org
> 
>> >Betreff: Re: AW: File existence
> 
>> >
> 
>> >Hi:
> 
>> >
> 
>> >I never used it. From your pipeline, it looks like your are always
> 
>> >generating from the same source no matter if the fileexists or not.
> 
>> >
> 
>> ><map:generate type="file" src="default.xml" />
> 
>> >
> 
>> >Then you use a tranformer in both cases, the only diference is when you
> 
>> >the file exists, you send parameters to the tranformer:
> 
>> >
> 
>> ><map:transform type="xslt" src="form2data.xsl">
> 
>> >  <map:parameter name="use-request-parameters" value="true"/>
> 
>> >
> 
>> >But when the file does not exists you dont send them! Can be this the
> 
>> >source of the error?
> 
>> >
> 
>> >Best Regards,
> 
>> >
> 
>> >Antonio Gallardo
> 
>> >
> 
>> >Mustafa Ali, Halgurt dijo:
> 
>> >
> 
>> >
> 
>> >>Thank you, I tried it, but I have a Problem, I am getting an empty page,
> 
>> >>here is my pipeline:
> 
>> >>
> 
>> >><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