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

Re: space replaced with %20

Subject: Re: space replaced with %20
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Sun, 15 Oct 2000 19:31:41 +0100
20 space html
Eric,

>Have this is my xsl:
>
>      <xsl:for-each select="//index">
>        <xsl:sort select="@entry"/>
>        <p><a href="{../@location}"><xsl:value-of select="@entry"/></a></p>
>      </xsl:for-each>
>
>I get the appropriate information except that some of the @location
>attributes have spaces in them, and for each of these, the space is replaced
>with %20 (e.g., location="d:\new docs\doc1" ends up as
>"d:\new%20docs\doc1"), which causes my link not to work.  (Using Instant
>Saxon--not sure if this makes a difference.)

If you are outputting HTML (as it looks like you are), then you will be
using the 'HTML' output method which automatically escapes any href values.
 From the Rec:

"The html output method should escape non-ASCII characters in URI attribute
values using the method recommended in Section B.2.1 of the HTML 4.0
Recommendation."

When an HTML browser encounters an escaped URI it should deal with it
properly - I'm not sure but it's possible that you're having problems
because the 'URI's that you're using are local paths - try doing:

  <a href="file:///{../@location}">...</a>

instead and see if that makes a difference.

If you want to stop the URI from being escaped, then you could force SAXON
to use the 'xml' output method instead using:

<xsl:output method="xml" />

but this may cause you problems in other areas (such as outputting closing
tags and doing all the other things that are taken care of for you with the
HTML output method).

I hope that helps somewhat,

Jeni

Jeni Tennison
http://www.jenitennison.com/


 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.