You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Simon Hutchinson <si...@misgl.com> on 2003/11/19 13:14:14 UTC
URL Encoding (Coccon 2.1 cvs as of about 2 weeks ago)
Hi,
I am very new to coccon so please excuse any glaring errors in my
question.
I have written a transformer whose job in part is to extrat a uri
from a knowledge article returned from our knowledgebase.
<swsolution>
<cinclude:include select="*|text()">
<xsl:attribute
name="src">cocoon:/soldoc?url=<xsl:value-of
select="normalize-space(LongDescLink)"/>
</xsl:attribute>
</cinclude:include>
</swsolution>
The snippet above indicates my attempt. -
The cinclude transformer then transforms the xml and finds the
correct matcher in my sitemap.
I want to use the html generator to return the file. <see below>
<map:pipeline>
<map:match pattern="soldoc">
<map:generate src="{request-param:url}" type="html"/>
<map:serialize/>
</map:match>
</map:pipeline>
This solution works until I try to generate a uri with an illegal
character ie a space.
It appears that the request-param is (correctly) decoding the
parameter I am passing it but unfortunately this is not the behaviour I
require.
Is there any way that I can re-code the parameter before generating it ?
Or can anyone suggest an alternative means of achieving the same
end. ie generating html from a remote server.
Any help would be appreciated.
Cheers
Si
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: URL Encoding (Coccon 2.1 cvs as of about 2 weeks ago)
Posted by Simon Hutchinson <si...@misgl.com>.
Tony Collen wrote:
> Simon Hutchinson wrote:
>
>
>> This solution works until I try to generate a uri with an illegal
>> character ie a space.
>> It appears that the request-param is (correctly) decoding the
>> parameter I am passing it but unfortunately this is not the behaviour
>> I require.
>>
>> Is there any way that I can re-code the parameter before generating
>> it ?
>> Or can anyone suggest an alternative means of achieving the same
>> end. ie generating html from a remote server.
>
>
> I think what you need is the RawRequestParameterModule.
>
> See http://wiki.cocoondev.org/Wiki.jsp?page=InputModules
Thanks for the suggestion. From the documentation this seems like the
correct input module for my issue.
It does allow me to reduce my probelm to a simpler case however.
With the following sitemap match
<map:match pattern="soldoc">
<map:generate src="{raw-request-param:url}" type="html"/>
<map:serialize/>
</map:match>
If I request
http://localhost:8080/cocoon/soldoc?url=http://example.com/foo.html
the html is returned
However even with the "raw-request-param" module specified if I request
http://localhost:8080/cocoon/soldoc?url=http://example.com/fo%20o.html
I get a file not found exception (the file "fo o.html" does exist and I
can get it with the plain url http://example.com/fo%20o.html)
Can anyone advise me as to why this might be ?
Thanks
Si
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: URL Encoding (Coccon 2.1 cvs as of about 2 weeks ago)
Posted by Tony Collen <co...@umn.edu>.
Simon Hutchinson wrote:
> This solution works until I try to generate a uri with an illegal
> character ie a space.
> It appears that the request-param is (correctly) decoding the
> parameter I am passing it but unfortunately this is not the behaviour I
> require.
>
> Is there any way that I can re-code the parameter before generating it ?
> Or can anyone suggest an alternative means of achieving the same end.
> ie generating html from a remote server.
I think what you need is the RawRequestParameterModule.
See http://wiki.cocoondev.org/Wiki.jsp?page=InputModules
HTH
Tony
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org