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

Re: [XPath20] Decoding URIs

Subject: Re: [XPath20] Decoding URIs
From: "Christian Roth" <roth@xxxxxxxxxxxxxx>
Date: Thu, 3 Nov 2005 11:46:40 +0100
christian roth
Colin Paul Adams wrote:

>    Christian> I see there is fn:encode-for-uri, but I cannot find its
>    Christian> counterpart.
>
>There's no need for one, I would have said.

Here's my real use case at hand:

Scenario: I get an XML document that links relatively to images besides
it using xlink:href. The images' names may contain diacritics.

Task 1: I must generate a plain text list of the names of the contained
images.

Task 2: Converting to HTML, I must fill the "title" and "name"
attributes of the <img> element with the name of the image file - user-
readable.

>You could write an xsl:function to do it.

If that is possible without having to resort to a custom extension
function as Michael Kay suggested earlier, I'd really love to see that.

I guess it probably is possible to decode a "%XX" character sequence
into the respective integer using the "Functions on Numeric Values" and
some <xsl:choose>. Then, I'd have to implement an UTF-8 decoder (might
also be possible, I guess) and then use fn:codepoints-to-string(). Hmm,
in case I'm bored this weekend...

>N.B. the result will not be a valid URI.

I know, as that is the whole point of my question: I want to *decode*
URI encoded (parts of) strings. :-)

Regards, Christian.

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.