You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Sparkes <pe...@didm.co.uk> on 2008/08/07 21:05:11 UTC

Passing request parameter from the sitemap

Hi,

I am trying to pass various request parameter from the sitemap to a eXist xquery 
using:

<map:match pattern="register-with-eXist">
   <map:generate src="register.xq" type="xquery">               
      <!--<map:parameter name="user" value="{flow-attribute:user}"/>-->
      <map:parameter name="user" value="test"/>
    </map:generate>


I know the xquery is correct as I have tested it with the the URL register.xql?pass=test

Help please, how do I pass parameters from the sitemap as request parameters?

Thanks

Peter


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


Re: Passing request parameter from the sitemap

Posted by Peter Sparkes <pe...@didm.co.uk>.
Kai Mütz  gave me the answer on  exist-open@lists.sourceforge.net

"No. You are refering to a sitemap parameter not a request parameter. 
XQueryGenerator passes the parameters from sitemap to the XQuery. Thus 
you can use $myuser without declaring it."

Peter

> Hi Andy,
>
> Sorry typos in email.
>
> sitemap extract:
> <map:match pattern="register-with-eXist">
>        <map:generate src="register.xq" type="xquery">
>               <map:parameter name="user" value="test"/>
>           </map:generate>
>
> and register.xq extract:
>
> declare namespace xdb="http://exist-db.org/xquery/xmldb";
> declare namespace request="http://exist-db.org/xquery/request";
> declare namespace session="http://exist-db.org/xquery/session";
>
> let $user := request:get-parameter("user", 'error'),
>     return
>       <p> user  :     {$user} </p>
>
> Returns  < p> user  : error </p>
>
> while http://localhost:8080/exist/register.xq?user=test
>
> Returns  <p> user  :  test</p>
>
> Peter
>> 2008/8/7 Peter Sparkes <pe...@didm.co.uk>:
>>   
>>> I am trying to pass various request parameter from the sitemap to a eXist
>>> xquery using:
>>>
>>> <map:match pattern="register-with-eXist">
>>>  <map:generate src="register.xq" type="xquery">
>>> <!--<map:parameter name="user" value="{flow-attribute:user}"/>-->
>>>     <map:parameter name="user" value="test"/>
>>>   </map:generate>
>>>
>>>
>>> I know the xquery is correct as I have tested it with the the URL
>>> register.xql?pass=test
>>>     
>>
>> register.xq (as you have in the map:generate) or .xql?  Also, you have
>> pass=test in the URL but name="user" value="test" in the
>> map:parameter.  Are those what you're actually using or just typos in
>> your email?
>>
>>
>> Andy.
>>   
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG. 
>> Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
>>   
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
>   


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


Re: Passing request parameter from the sitemap

Posted by Peter Sparkes <pe...@didm.co.uk>.
Hi Andy,

Sorry typos in email.

sitemap extract:
<map:match pattern="register-with-eXist">
       <map:generate src="register.xq" type="xquery">
              <map:parameter name="user" value="test"/>
          </map:generate>

and register.xq extract:

declare namespace xdb="http://exist-db.org/xquery/xmldb";
declare namespace request="http://exist-db.org/xquery/request";
declare namespace session="http://exist-db.org/xquery/session";

let $user := request:get-parameter("user", 'error'),
    return
      <p> user  :     {$user} </p>

Returns  < p> user  : error </p>

while http://localhost:8080/exist/register.xq?user=test

Returns  <p> user  :  test</p>

Peter
> 2008/8/7 Peter Sparkes <pe...@didm.co.uk>:
>   
>> I am trying to pass various request parameter from the sitemap to a eXist
>> xquery using:
>>
>> <map:match pattern="register-with-eXist">
>>  <map:generate src="register.xq" type="xquery">
>> <!--<map:parameter name="user" value="{flow-attribute:user}"/>-->
>>     <map:parameter name="user" value="test"/>
>>   </map:generate>
>>
>>
>> I know the xquery is correct as I have tested it with the the URL
>> register.xql?pass=test
>>     
>
> register.xq (as you have in the map:generate) or .xql?  Also, you have
> pass=test in the URL but name="user" value="test" in the
> map:parameter.  Are those what you're actually using or just typos in
> your email?
>
>
> Andy.
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG. 
> Version: 8.0.100 / Virus Database: 270.5.12/1599 - Release Date: 07/08/2008 20:49
>   


Re: Passing request parameter from the sitemap

Posted by Andy Stevens <in...@googlemail.com>.
2008/8/7 Peter Sparkes <pe...@didm.co.uk>:
> I am trying to pass various request parameter from the sitemap to a eXist
> xquery using:
>
> <map:match pattern="register-with-eXist">
>  <map:generate src="register.xq" type="xquery">
> <!--<map:parameter name="user" value="{flow-attribute:user}"/>-->
>     <map:parameter name="user" value="test"/>
>   </map:generate>
>
>
> I know the xquery is correct as I have tested it with the the URL
> register.xql?pass=test

register.xq (as you have in the map:generate) or .xql?  Also, you have
pass=test in the URL but name="user" value="test" in the
map:parameter.  Are those what you're actually using or just typos in
your email?


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

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