xsl-list
[Top] [All Lists]

RE: [xsl] url encoding gets wrong with åöä?

2006-06-06 23:46:42

I hope so too but i have no idea where and how to place that piece of code. I'm 
quite new to this...
Below is my xsl-code. Would be great if you could help me to point out where 
and how to apply this.

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
<xsl:template match="/">
        <ul>
        <xsl:for-each select="root/row">
                <li><a><xsl:attribute 
name="href">http://gulasidorna.eniro.se/query?what=yp&amp;search_word=<xsl:value-of
 select="word"/>&amp;selected_header_code=R1001257</xsl:attribute><xsl:value-of 
select="word"/></a></li>
        </xsl:for-each>
        </ul>
</xsl:template>
</xsl:stylesheet>


-----Original Message-----
From: Merico Raffaele [mailto:raffaele(_dot_)merico(_at_)less(_dot_)ch]
Sent: den 6 juni 2006 09:02
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: AW: [xsl] url encoding gets wrong with åöä?

Hi Niklas

I had a similary problem a few months ago and I solved it with:

javaUrlEncoder:encode(./name)

        while javaUrlEncoder: has to be declared as follows:

xmlns:javaUrlEncoder="java.net.URLEncoder"

Hope this helps
Raffaele

-----Ursprüngliche Nachricht-----
Von: Niklas Holmberg [mailto:Niklas(_dot_)Holmberg(_at_)eniro(_dot_)com]
Gesendet: Montag, 5. Juni 2006 15:59
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: [xsl] url encoding gets wrong with åöä?


hi!


i'm trying to put out links from my xml file but the url encoding gets
wrong with åöä for some reason.


my for each-loop contains this line:
<a><xsl:attribute
name="href">http://gulasidorna.eniro.se/query?what=yp&amp;search_word=
<xsl :value-of select="word"/></xsl:attribute><xsl:value-of
select="word"/></a>


for example when i use the word "Avhämtning". the url commes out as
"Avh%C3%A4mtning" and the link text as "Avh&auml;mtning".


the encoding in the url is wrong. it should be Avh%E4mtning and i
can't understand why i get Avh%C3%A4mtning??


all files (xml, xsl and output are UTF-8) and i use ASP to transform
my xml.
does anybody know how to correct this?


thanks!
/niklas




Confidentiality Notice: This e-mail transmission may contain confidential or 
legally privileged information that is intended only for the individual or 
entity named in the e-mail address. If you are not the intended recipient, you 
are hereby notified that any disclosure, copying, distribution, or reliance 
upon the contents of this e-mail is strictly prohibited and may be unlawful. If 
you have received this e-mail in error, please notify the sender immediately by 
return e-mail and delete all copies of this message.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--