You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by MAHE Vincent FTRD/DIH/REN <vi...@rd.francetelecom.fr> on 2000/08/07 14:05:39 UTC

problem with disable-output-escaping with french accents

Hello,

I have the following XML file containing Javascript code with a "é" french
accent :

	<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>

	<DOC>

		<Javascript>
			<validate><![CDATA[<a href="javascript:validate()"
onmouseover="m1('test é');return true;"></a>]]></validate>
		</Javascript>
	</DOC>

I want to parse it with the following XSL stylesheet and generate HTML using
Xalan 1.2 D01 :

	<?xml version="1.0" encoding="ISO-8859-1"?>

	<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output indent="yes" method="HTML"/>

	<xsl:template match="/">
		<html>
		<head>
			<title>
			</title>
		</head>

		<body>
			<xsl:value-of select="/DOC/IMAGE/validate"
disable-output-escaping="yes"/>
		</body>

		</html>
	</xsl:template>

	</xsl:stylesheet>


But the fact I'm using attribute "disable-output-escaping" generates this
HTML :

	<html>
    		<head>
        		<title>
        		</title>
    		</head>

     		<body>
			<a href="javascript:valider()" onmouseover="m1('test
é');return true;"></a>
		</body>
	</html>


Does anyone know why my "é" becomes a "é" ? How can I avoid this ?


Thanks.



Re: problem with disable-output-escaping with french accents

Posted by Etienne Posthumus <et...@cs.uu.nl>.
On Mon, 7 Aug 2000, MAHE Vincent FTRD/DIH/REN wrote:
> Does anyone know why my "�" becomes a "é" ? How can I avoid this ?

Change your outout specification to explicitly give the encoding:
<xsl:output indent="yes" method="html" encoding="iso-8859-1"/>

If you don't specify one, your output is encoded using UTF-8. The editor
or window that your using to look at the output probably doesn't support
UTF-8 so the eacute looks funny. (even though it is correct).

-- 
Etienne Posthumus
- http://www.cs.uu.nl/staff/etienne.html -
------------------------------------------------
Institute for Information and Computing Sciences 
------------------------------------------------