Re: File Names with Spaces ???

Subject: Re: File Names with Spaces ???
From: Chris Lilley <chris@xxxxxx>
Date: Sun, 04 Apr 1999 17:50:37 +0200

harryk wrote:
> 
> How do I use xsl to process the element
> <MATL>NEW FILE WITH SPACES.PDF</MATL>
> that contains a file name with spaces so that it is
> attached to the <A HREF with the %20 in the spaces. e.g.,
> NEW%20FILE%20WITH%SPACES.PDF ???

Well, the syntax for your element can be anything you like, and the
syntax for a URI is defined in the relevant RFC and spaces are not
allowed.

So, yes, you need to convert. This is just one case that needs
converting; it could be worse (eg, VMS filenames take alot more
converting).

> <A HREF="http://mysite/NEW FILE WITH SPACES.PDF>NEW FILE WITH
> SPACES.PDF</A>

Thats not well formed (missing trailing quote) and invalid according to
RCC 1766 (number from memory, could be wrong).


> It appears that IE5 inserts the %20 automatically, while
> Netscape 4.5 does not.

Thats error correction, and should not be depended on.


> Is there a way, using xsl, to insure that the file name will always be
> seen  with %20 in the spaces by either/any browser.

Well, if you convert it so, then it will be in the document source so
the browsers will be consistent.

You could do this using the DOM, but its not clear that XSL (by which I
mean, the XSL specification, in case anyonme was confused) can do it.

--
Chris


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


Current Thread