RE: [xsl] special characters

Subject: RE: [xsl] special characters
From: Jarno.Elovirta@xxxxxxxxx
Date: Fri, 23 May 2003 13:18:04 +0300

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



 XSL-List info and archive:

Current Thread