Hi all, thanks in advance for this one.
I am trying to display an xml file on the web using JSTL xml tags. The file is encoded in utf-8 containing ancient Greek characters (x1f92, etc.). The file displays properly from a
servlet + xslt (
http://163.1.169.41/testapp), but I want to use JSTL.
The JSTL produces intricate spaghetti on the screen (e.g. �������������� ). I have seen this before --it would seem that unicode is indeed being directed at the screen but is not being interpreted properly. (Not strings of question marks mind you; the unicode seems to be there in this case).
The code producing the spaghetti is below. I am just dumping in on the screen for now and will use xpath calls later for more precise extraction.
Does the JSTL want character entities for the x
arse call? I would not think so: parsing a utf-8 file would be a very common operation. How can I get the xml unicode file to display properly using the JSTL below?
[headers]
<%@ page contentType="text/html; charset=utf-8"pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...
<c:import var="papyrus" url="blabula.xml" />
<x
arse var="doc" xml="${papyrus}" />
<x
ut select="$doc" />
....