xsl-list
[Top] [All Lists]

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

2008-12-07 09:58:30
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'>
     ????
  </span>


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:

  <div>
    <textarea>
      &lt;span style='font-size: 11pt; font-family: Arial;' lang='HE'&gt;
        &amp;#1499;&amp;#1514;&amp;#1493;&amp;#1489;
      &lt;/span&gt;
    </textarea>
  </div>

which only contains 8-bit entities at transformation time.

----------------------------------------------------------------------
 John English              | mailto:je(_at_)brighton(_dot_)ac(_dot_)uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 School of Computing & MIS | "Those who don't know their history
 University of Brighton    |  are condemned to relive it" (Santayana)
----------------------------------------------------------------------

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