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

Re: [Fwd: %20 in href attribute]

Subject: Re: [Fwd: %20 in href attribute]
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 22 Jan 2002 16:27:21 -0500
html href space
The version with "%20" is correct and the version with spaces is incorrect -
spaces are not allowed in UR:s and must be encoded to %20.  Microsoft
browsers will accept spaces anyway and (I presume) translate them to the
correct forms.

If you have a server that responds to a url with a space, and does not
respond to the same url with the space replaced by "%20", that server has a
bug.

You could process the url value before use to get rid of the "%20" and
replace them by spaces, but it would be clumsy and perhaps the html output
method of your processor would put it back anyway.

My copy of msxml3 does not substitute spaces in hrefs with "%20" even with
html output method in effect, but my copy of Saxon does.

Cheers,

Tom P

[Yan Yi Huang]

> When use a variable with string value, which contains spaces after the
> #, as the value of href attribute to the <a> tag, the transformer
> automatically replaces the spaces with %20 and causes the link not
> recognize the anchor in the targeting page.  Is there a work around for
> that?  Sample code as follow:
>
> <xsl:variable name="url" select="$urlink/@url"/>
> <a href="{$url}" target="ext_link" onclick="new_win()"><xsl:value-of
> select="$title"/></a>
>
> href value desired:
> http://www.state.ma.us/dhcd/components/dns/HtOHA.htm#About Our Programs
> what I got:
>
http://www.state.ma.us/dhcd/components/dns/HtOHA.htm#About%20Our%20Programs
>
> Thank you,
> Yan Yi Huang
>
>
>
>  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.