xsl-list
[Top] [All Lists]

RE: special characters

2003-05-23 03:18:04
Hi,

You could try adding the entity. Make sure that your 
processor supports that
output encoding format and you set it at the top of the intiating
stylesheet...

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:stylesheet [
    <!ENTITY % winansi SYSTEM "characters.ent">
    %winansi;
]>
<xsl:output method="html" encoding="ISO-8859-1" indent="no"
omit-xml-declaration="yes" />
<xsl:stylesheet...
<xsl:text disable-output-escaping="yes">&eacute;</xsl:text>

Then setup characters.ent...

<?xml version="1.0" encoding="UTF-8"?>
<!-- latin capital letter E with grave, U+00C8 ISOlat1 &#201; -->
<!ENTITY eacute "&eacute;">

I think that should work OK!

It would output &eacute;, but not for the reasons you probably expect. The XML 
parser will expand the entity reference to é when the stylesheet is parsed and 
that will also be output to the result tree--d-o-e will have no effect here. 
However, since you've specified HTML output method, é will probably be output 
as &eacute;.  You can use d-o-e to generate entity references with <xsl:text 
disable-output-escaping="yes">&amp;eacute;</xsl:text>, but why do things the 
hard and ugly way?

Cheers,

Jarno

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



<Prev in Thread] Current Thread [Next in Thread>