RE: [xsl] marked characters in html output (3rd attempt)

Subject: RE: [xsl] marked characters in html output (3rd attempt)
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Thu, 13 Mar 2003 14:50:25 -0500
[ani@xxxxxxxxxxxxx]

> When transforming (xerces I guess) and html outputting
> marked characters "á" become entities "&aacute;"
> is there anyway to avoid entitiens because I need the marked
> characters in the html
> 
> thanks
> a.lopez
> 
> (this is the 3rd time I ask this and no responses so I don't
> know what to think, is this such a stupid question? nobody
> read my emails?....)

This kind of question comes up often enought that it must be possible to find out about it in the FAQs and list archives.

There is a difference between what character is in a file, and what glyph gets displayed in a browser (or text editor).  Problems arise when the character encoding of the source file is different from the encoding that the browser expects to see.

A browser should display the character entity (like &aacute;) with the correct glyph(s) - at least, if its character set contains the requested character and the encoding supports it..  Generally, the xslt processor would output a character entity when 1) the output method is set to html, and 2) the chosen encoding cannot otherwise represent the character. 

Remember that if you do not specify an encoding, you will get either utf-8 or utf-16.  The html output should include a <meta> element stating the encoding, and the browser should honor that.  However, one or more of these things may not happen, and then the character may not display right.

So you need to make sure that your browser is using the same encoding as the transformed output, and verify that the wrong glyph is getting displayed for the character entity even if the encoding is correct.  The presence of the character entity usually is enough to get the character displayed properly.  Do not go by what you see on a text editor, which may use the wrong encoding.  See what the browser actually displays.

Cheers,

Tom P

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


Current Thread