[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: : Escaping '&' in an HTML link.

Subject: RE: : Escaping '&' in an HTML link.
From: Mark Feblowitz <mfeblowitz@xxxxxxxxxxxxxxxx>
Date: Mon, 30 Jul 2001 17:52:21 -0400
html link ampersand
Can't do this. The ampersand is a reserved character in URI-land. See

	http://www.ietf.org/rfc/rfc2396.txt 

In general, special characters in a URL can be quoted so that the URL
remains legal. The ampersand, though, has special meaning in a URL
(additional URL parameters in a URI query) and will make your server choke
once the user tries to visit that link.

You may be stuck with "%20and%20". 


----------------------------------------------------------------------------
----
 
Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
mfeblowitz@xxxxxxxxxxxxxxxx
400 Technology Square, 9th Floor 
Cambridge, MA 02139 
www.frictionless.com  
 

 -----Original Message-----
From: 	Aparna Joshi [mailto:aparna.joshi@xxxxxxxxxx] 
Sent:	Monday, July 30, 2001 5:03 PM
To:	'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject:	 : Escaping '&' in an HTML link.

Hello,

Here is my stylesheet (basic structure):

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="address">index.jsp</xsl:param>
<xsl:output method="html" indent="yes" />  

<xsl:template match="AAA">

    <html>
       <head>
         <title>TITLE</title>
       </head>
       <body >
		<form method="POST" name="index" action="{$address}">
                Your request: <input type="text" name="query"
size="15"></input>
                          <input type="submit" name="go" value="GO"></input>
			............
        		<a>
				<xsl:attribute name="href">
					<xsl:value-of
select="$address"/>?query=Edit+name+<xsl:value-of
select="translate(normalize-space(groupName),' ','+')"/>
				</xsl:attribute>			
			<a>
			............
		</form>
       </body >
    </html>
</xsl:template>
.......


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

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.