[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] strange encoding problem


Subject: [xsl] strange encoding problem
From: "Andreas Schildbach" <andreas@xxxxxxxxxxx>
Date: Fri, 1 Nov 2002 12:57:03 +0100

i've got an utf-8 encoded xml file (test.xml) with an umlaut character, like
this:

<?xml version="1.0" encoding="UTF-8"?>
<a>ue</a> <!-- this is an &uuml; not the two chars u and e -->

i want to apply a simple xsl transformation (test.xml) to html, like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
        <xsl:output method="html" indent="yes" />
</xsl:stylesheet>

when i use the xslt-task of jakarta ant

<xslt in="test.xml" style="test.xsl" out="test.html" />

the result (test.html) is &uuml;
which is correct.

PROBLEM:

when i use tomcat, jsp and the jstl (java standard tag library) to apply the
transformation

<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<c:import url="test.xml" var="xml"/>
<c:import url="test.xsl" var="xsl"/>
<x:transform xml="${xml}" xslt="${xsl}"/>

the result is &Atilde;&frac14;
which is NOT correct in my opinion.

- i made sure that the utf-8 encoded files are really utf-8 encoded (textpad
4.5.0 save-as encoding utf-8)
- i updated my software to the latest revisions:
   jdk 1.4.1_01
   tomcat 4.1.12
   jstl 1.02
   jakarta ant 1.5.1
- i searched for this problem on the internet/faqs

none of this helped. what am i doing wrong?

andreas


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords