xsl-list
[Top] [All Lists]

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

2006-06-08 03:52:58

Ok, so the my question is why all my ÅÄÖåäö is being put out as "?".
Both xml and xsl are utf-8 and my output encoding is also utf-8.

/N

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

Niklas

If your output is XHTML then that's an XML output not an HTML one.

--

Joe


From: "Niklas Holmberg" <Niklas(_dot_)Holmberg(_at_)eniro(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: RE: [xsl] url encoding gets wrong with åöä?
Date: Thu, 8 Jun 2006 12:32:10 +0200


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). &amp; is
then put out as & in the html-file. I want to keep it as &amp; in the
output too. If i use output xml instead &amp; is kept as &amp; 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%E4rslun
cher">Aff&auml;rsluncher</a></li>

xml output:
<li><a
href="http://gulasidorna.eniro.se/query?what=yp&amp;search_word=Aff%E4r
sluncher">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>
--~--




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





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