[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] TrAX XSLT emits &entities for iso-8859-8 characters


Subject: Re: [xsl] TrAX XSLT emits &entities for iso-8859-8 characters
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 17 Aug 2001 09:15:23 +0100

Hi Eli,

> When my TrAX XSLT generates HTML, XSLT emits Hebrew letters as
> &#entities. This makes the HTML illegible, and a nuisance to debug.
> How can I tell TrAX to emit simple Hebrew characters? If there's no
> way, how can I tell my customer that her Web designers will hate the
> tool I've recommended to her? :- (

You may be able to find something in the TrAX API that gives you
control over when character entity references are used, though I can't
immediately find anything with a scan through the documentation.

The XSLT processor that you use may give you a bit more control than
the TrAX API, either through its particular API or within the
stylesheet. For example, Saxon has a saxon:character-representation
attribute on xsl:output that gives you control, so you could do
something like:

<xsl:output method="html"
            saxon:character-representation="native;hex"
            encoding="ISO-8859-8" />

(It might be that Saxon doesn't support that encoding, in which case
you should probably use UTF-8, as long as the editors that you're
using support it.)

The above xsl:output element tells Saxon to serialise characters that
can be represented in the ISO-8859-8 encoding natively, and those that
can't as hexadecimal character references.

If the processor you're using doesn't give you that kind of control,
you could try setting the output method to XML (XHTML) rather than
HTML; that way you get around the HTML serialisation outputting
characters as character entity references, as long as you use (and the
processor supports) an encoding in which the characters can be
represented. You do then have to worry a bit more about the way in
which the result of the stylesheet is serialised, because the HTML
output method does a few very helpful things for you, but usually this
isn't a problem.

I guess the final solution would be to write your own serialiser, or a
post-processor to work on the output, but you shouldn't have to go
that far, I think.

Cheers,

Jeni

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


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



Current Thread
Keywords