This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: white space to + in query string


You might want to check for more than just spaces, as e.g. non-ASCII
characters (accented letters, for example) also need to be escaped.
I hit the problem when I was generating GET queries based on the
contents of database fields, e.g. :

<a href="search.asp&name={@name}">
    click here to search for <xsl:value-of select="@name" />
</a>

I did not want to take any chances so I just defined an extension
function that called Server.URLEncode - but of course there
must be other means...

Cheers,
--Jonathan

----- Original Message -----
From: "Wendell Piez" <wapiez@mulberrytech.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Wednesday, February 13, 2002 4:32 PM
Subject: Re: [xsl] white space to + in query string


> If you're really paranoid (I should get extra Eudora hot peppers for
saying
> that -- huh, no....), you might want to normalize space before you do the
> translate, to avoid extra "+" signs in your href:
>
> <a href="{translate(normalize-space(@some_attribute,' ','+'))}">
>
> Cheers,
> Wendell



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]