xsl-list
[Top] [All Lists]

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

2006-06-08 03:32:27

Thank you =) Worked great.

Thought i was done with my xsl by now but discovered another problem. I use 
output method="html" (since my output is to a xhtml file). & is then put 
out as & in the html-file. I want to keep it as & in the output too. If i 
use output xml instead & is kept as & like i want to but then all my 
ÅÄÖåäö is being put out as "?".

html output:
<li><a 
href="http://gulasidorna.eniro.se/query?what=yp&search_word=Aff%E4rsluncher";>Aff&auml;rsluncher</a></li>

xml output:
<li><a 
href="http://gulasidorna.eniro.se/query?what=yp&amp;search_word=Aff%E4rsluncher";>Aff??rsluncher</a></li>


So my questions:
1. What is the point of using output html, what is the difference from using 
xml (other than that &amp; is put out as &).
2. Should i stick to output html and try to solve if from there os swich to xml 
and the try to solve why åäö doesn't get put out right?

Thanks again!
/Niklas


Here's my code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:javaUrlEncoder="java.net.URLEncoder" 
exclude-result-prefixes="javaUrlEncoder">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
        <ul id="tagcloud">
        <xsl:for-each select="root/row">
        <xsl:sort select="word"/>
                <li class="weight1"><a><xsl:attribute 
name="href">http://gulasidorna.eniro.se/query?what=yp&amp;search_word=<xsl:value-of
 select="javaUrlEncoder:encode(word, 
'ISO-8859-1')"/></xsl:attribute><xsl:value-of select="word"/></a></li>
        </xsl:for-each>
        </ul>
</xsl:template>
</xsl:stylesheet>



-----Original Message-----
From: Joe Fawcett [mailto:joefawcett(_at_)hotmail(_dot_)com]
Sent: den 8 juni 2006 11:29
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] RE : RE: [xsl] url encoding gets wrong with åöä?

Niklas

<xsl:stylesheet exclude-result-prefixes="javaUrlEncoder" ....

--

Joe




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>
--~--