Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] [XPath20] Decoding URIs

From: "Christian Roth" <roth@-------------->
To:
Date: 11/3/2005 10:47:00 AM
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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent