cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Ratcliffe <a...@mrigitech.com>
Subject URL encoding problem
Date Mon, 01 Nov 2004 09:58:55 GMT
Hi,

I've run into some difficulty with URL encoding some URL parameters using the
EncodeURLTransformer.

The transformer is being invoked but the produced document contains unencoded
URLs.  I've tried using the java.net.URLEncoder to explicity encode the URLs in
my stylesheet which works, however Cocoon doesn't appear to understand how to
decode this URL when it receives the request.

The pipline is an internal pipeline invoked from another pipeline by the
CInclude transformer, it looks like this:

      <map:match pattern="categoriesHtml">
	<map:generate type="jx" src="xml/categories.jx">
	  <map:parameter name="cid" value="{request-param:cid}"/>
	</map:generate>
	<map:transform src="xsl/categories2html.xsl">
	  <map:parameter name="cid" value="{request-param:cid}"/>
	</map:transform>
	<map:transform type="encodeURL"/>
	<map:serialize type="xml"/>
      </map:match>

The URLs are built in the stylesheet in this section:

    <a>
      <xsl:attribute name="href"><xsl:value-of
select="concat('search.html?class1=', parent/name/text(), '&amp;class2=',
name/text(), '&amp;loctype=', type/text(), '&amp;categories=true', '&amp;cid=',
$cid)"/>
      </xsl:attribute>
      <xsl:value-of select="name/text()"/>
    </a>

Where some of the parameter values contain spaces and/or the ampersand
character.

I'm sure this should be simple, hopefully someone can point out the error of my
ways :)

Cheers
Adam







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


Mime
View raw message