You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by daniel robinson <dr...@dnai.com> on 2002/06/06 00:57:23 UTC

Sitemap parameters passed to XSP

I'm reposting as I had the wrong Subject line - sorry for the double
post.

I've posted to users but nothing yet.

I want to pass a parameter from the sitemap file to an XSP.  In the
Sitemap I
have:

 <map:match pattern="index">
    <map:generate type="serverpages" src="xsp/w3/index2.xsp">
       <map:parameter name="SourcePage" value="Index"/>          <---
set
variable here
    </map:generate>
   <map:transform src="stylesheets/w3/index2.xsl"/>
     <map:serialize/>
  </map:match>

and then use it in index2.xsp.  I tried this, and lots of other things:

...snip...
     <esql:execute-query>
       <esql:query>
                select * from "Story"
                     where
                    "ProjectName" = 'MyProj'
                        and
                    "PageName" = '"$SourcePage"'           <----- use it
here
...snip...


Please help.  I've been looking all through the doco - examples etc.
When I
try the above I get an exception when Cocoon attempts to recompile the
sitemap.

Thanks,

Dan


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


Re: Sitemap parameters passed to XSP

Posted by Sven Kuenzler <sv...@imost.de>.
>  <map:match pattern="index">
>     <map:generate type="serverpages" src="xsp/w3/index2.xsp">
>        <map:parameter name="SourcePage" value="Index"/>          <---

> and then use it in index2.xsp.  I tried this, and lots of other things:
>
> ...snip...
>      <esql:execute-query>
>        <esql:query>
>                 select * from "Story"
>                      where
>                     "ProjectName" = 'MyProj'
>                         and
>                     "PageName" = '"$SourcePage"'           <----- use it

Sitemap parameters are available to XSP logic  via  the "parameters" member
of the underlying Generator.

Try something like

"PageName"=<xsp:expr>parameters.getParameter("SourcePage","Index")</xsp:expr
>

I do not know whether ESQL allows <xsp:expr> at this point, so the real
solution may have to look different. But you get the idea.

Maybe there is some sitemap-parameters taglib which makes such things
easier?

    HTH, Sven.....





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