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]

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



You can do either by using "CDATA" or "&".
Both worked for me.

-Hope it helps.
Ram.

-----Original Message-----
From: Aparna Joshi [mailto:aparna.joshi@Dejima.com]
Sent: Monday, July 30, 2001 2:03 PM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] : 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


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