You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by João César <jo...@duploclique.com> on 2003/03/30 17:24:26 UTC

Xpath translate...

Hi, after trying this {request:translate(query, '+', ' ')}, I don't get any
result from my search... I've tried to see if translate was working but with
no sucess..

What I'm trying to do is, parsing this querystring:

search?query=transgenic+rice

to:

<map:generate type="file"
src="http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&amp;te
rm={request:translate(query, '+', ' ')}&amp;retmax=200"/>

to match:

http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=transg
enic%20rice&retmax=200

TIA

Joao Cesar
joaocesar@netcabo.pt





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


RE: Xpath translate...

Posted by Conal Tuohy <co...@paradise.net.nz>.
Hi João,

one pattern I've used in this situation is to assemble the query URL in
XSLT, rather than in the sitemap.

First, you use the RequestGenerator to produce an XML document describing
the query.
Second, your XSLT transforms this document into an Xinclude statement
containing the new query URL.
Third, you use the XInclude transformer to execute this query.
Then format the results as necessary and serialize.

Cheers!!

Con


> -----Original Message-----
> From: João César [mailto:joaocesar@duploclique.com]
> Sent: Monday, 31 March 2003 03:24
> To: cocoon-users@xml.apache.org
> Subject: Xpath translate...
>
>
> Hi, after trying this {request:translate(query, '+', ' ')}, I
> don't get any
> result from my search... I've tried to see if translate was
> working but with
> no sucess..
>
> What I'm trying to do is, parsing this querystring:
>
> search?query=transgenic+rice
>
> to:
>
> <map:generate type="file"
> src="http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db
> =pubmed&amp;te
> rm={request:translate(query, '+', ' ')}&amp;retmax=200"/>
>
> to match:
>
> http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubm
ed&term=transg
enic%20rice&retmax=200

TIA

Joao Cesar
joaocesar@netcabo.pt





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



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


Re: Xpath translate...

Posted by Lionel Crine <cr...@4dconcept.fr>.
To do this I use an xsp page.

I get the request parameters and apply some modification and put it in a tag.

then I use an xsl page to get the value in the tag and display it.

Lionel


At 16:24 30/03/2003 +0100, you wrote:
>Hi, after trying this {request:translate(query, '+', ' ')}, I don't get any
>result from my search... I've tried to see if translate was working but with
>no sucess..
>
>What I'm trying to do is, parsing this querystring:
>
>search?query=transgenic+rice
>
>to:
>
><map:generate type="file"
>src="http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&amp;te
>rm={request:translate(query, '+', ' ')}&amp;retmax=200"/>
>
>to match:
>
>http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=transg
>enic%20rice&retmax=200
>
>TIA
>
>Joao Cesar
>joaocesar@netcabo.pt
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


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