[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: strange encoding problem

Subject: Re: strange encoding problem
From: Gregory Murphy <Gregory.Murphy@xxxxxxxxxxx>
Date: Fri, 1 Nov 2002 12:10:33 -0800 (PST)
jstl apostrophe

On Fri, 1 Nov 2002, Andreas Schildbach wrote:

> 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 -->
> 
> [...] 
> 
> 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.


The following hack might help you to work around the problem. Redefine the
character entity so that it refers to a numeric character entity. In other
words, make your XML look something like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
  <!ENTITY uuml	 "&#x00FC;">
]>

I have found that, in general, numeric character entity references survive
repeated processing better than do the HTML named references.

// Gregory Murphy <Gregory.Murphy@xxxxxxx>
// Software Engineer
// Customer Network Platform, Sun Microsystems


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.