You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ronald Borman <r....@chello.nl> on 2006/05/22 23:22:18 UTC

URI matching.

I have browsed through the documentation and the mail lists, but so far I haven't found an answer for this problem.

Let's say I  have an URI that looks like this:
  http://www.domain.com/cocoon/knowledge/article?id=123

And a sitemap.xmap file that is located in the directory knowledge.

Can I use a matcher element that extracts the id portion with a wildcard pattern but only handles requests that end with article?

Thanks in advance.


Ronald.



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


RE: URI matching.

Posted by Andrew Stevens <at...@hotmail.com>.
>From: Ronald Borman <r....@chello.nl>
>Date: Mon, 22 May 2006 23:22:18 +0200
>
>I have browsed through the documentation and the mail lists, but so far I 
>haven't found an answer for this problem.
>
>Let's say I  have an URI that looks like this:
>   http://www.domain.com/cocoon/knowledge/article?id=123
>
>And a sitemap.xmap file that is located in the directory knowledge.
>
>Can I use a matcher element that extracts the id portion with a wildcard 
>pattern but only handles requests that end with article?

One way (and certainly not the only way) to do it would be just to use the 
wildcard URI matcher to match the "article" (the URI doesn't include the 
query string), and use the request-param input module to extract the value 
e.g.
<map:match pattern="article">
<map:generate src="{request-param:id}.xml"/>
...

Or, as an alternative to the request-param module you could use the request 
generator, or the XSL transformer's use-request-parameters parameter, or ... 
well, you get the idea.


Andrew.

>
>Thanks in advance.
>
>
>Ronald.
>



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