Re: [xsl]&ndash problem and netscape.

Subject: Re: [xsl]&ndash problem and netscape.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 20 Nov 2001 09:48:11 +0000
Hi Ling,

> the generated xml is look like :
>
> ...
> <para>July 2 ? Aug 25, 2001</para>
> <para>(8 weeks)</para></td>
> ...
>
> is it anyway to keep the &#8211; instead of - ? because i need to
> use the output xml file to render with cocoon, and when i view the
> page ( after process by cocoon ) with IE, the - is shown correctly,
> but when i use the NS4++, the character &ndash is shown. I notice
> that NS4 ++ can't support &ndash but can support &#8211.

I think that the problem here might be that Cocoon doesn't use the
output instructions that you put in the stylesheet, but instead
applies a formatter according to the cocoon.properties configuration
file. You might want to change the default so that it outputs XML
instead, by changing the formatter.default line in cocoon.properties:

formatter.default = text/xml

Or you should add a processing instruction to the source XML file to
tell it to use the XML formatter rather than the HTML formatter:

<?cocoon-format type="text/xml"?>

As it was, using the HTML formatter, the ndash was being escaped as
the character entity reference &ndash;, which is what NS was having
problems with. With the XML formatter, the ndash character will be
output as an ndash character rather than a character reference (or a
character entity reference).

If you want the character reference &#8211; rather than the raw ndash
character, then you should change the encoding of the output to
ISO-8859-1 or something such that 8211 is out of range of the
characters that the encoding can handle. Again you need to do this
through cocoon.properties, by adding the line:

formatter.text/xml.encoding = ISO-8859-1

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread