Re: [xsl] 16-bit entities converted to "?" by XSLT

Subject: Re: [xsl] 16-bit entities converted to "?" by XSLT
From: John English <je@xxxxxxxxxxxxxx>
Date: Sun, 07 Dec 2008 15:03:54 +0000
Michael Kay wrote:
My browser shows this correctly, but when I embed it in some XML and run it though my stylesheet, the output is this:

  <span style='font-size: 11pt; font-family: Arial;' lang='HE'>

When you say the output "is" this, I suspect you mean the output "looks like" this, when displayed using some piece of software to some output device. Are you sure that piece of software and that output device are capable of rendering Hebrew characters correctly? Because it's very likely that the XSLT output is correct, but can't be displayed the way you are trying to display it.

What I showed was what went into the transform (character codes) and what came out (actual genuine 0x3F "?" characters). My browser is quite happy with Hebrew: I some pasted Hebrew text into an input box and hit the "update" button on the page. It was then stored in my DB as the character references I showed. When the page is redisplayed, the "current value" (the Hebrew character refs) is transformed into question marks and immediately below that is the input box containing the Hebrew characters ready for further editing.

If I take the original <span> that gets sent to the XSLT transformer and stick
it in a file called foo.html, it displays correctly with no fuss at all. So the
problem is not in the browser's charset.

Moreover, as I said, it appears correctly in the textarea immediately below the
place where the current value is displayed. The reason it appears correctly in
this case is that the XML in this case contains the following embedded HTML:

      &lt;span style='font-size: 11pt; font-family: Arial;' lang='HE'&gt;

which only contains 8-bit entities at transformation time.

 John English              | mailto:je@xxxxxxxxxxxxxx
 Senior Lecturer           |
 School of Computing & MIS | "Those who don't know their history
 University of Brighton    |  are condemned to relive it" (Santayana)

Current Thread