This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: : Escaping '&' in an HTML link.
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] : Escaping '&' in an HTML link.
- From: "Clapham, Paul" <pclapham at core-mark dot com>
- Date: Mon, 30 Jul 2001 14:45:21 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
You're correct, the HTTP rules require you to escape an "&" character. Just
as you replaced each space by "+", you need to replace each "&" by "%26".
This would mean that you would have to call a template to do this
replacement before sending the translated string to the output, since there
is no built-in support for URL encoding in XSLT. However, I believe you may
find that code in the EXSLT project, which you can access via
http://www.exslt.org/, under the name of str:replace.
PC2
-----Original Message-----
From: Aparna Joshi [mailto:aparna.joshi@Dejima.com]
Sent: July 30, 2001 14:03
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] : Escaping '&' in an HTML link.
Hello,
Here is my stylesheet (basic structure):
</snip>
But this link fails when it encounters a value with "&" in it e.g.
Star&Bucks fails because of the '&' in between.
Is there any to escape the '&' so that the URL is completely and properly
formed?
I tried "disable-output-escaping" but it didnot seem to work.
Thanks in anticipation for any help provided.
Aparna
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list