Re: [xslt] It seems to be standard question... Leave entites intact

On Sat, Nov 22, 2003 at 01:33:04PM +0300, Lev Serebryakov wrote:
> Hello, xslt! How are you?
>  I use xsltproc to generate XHTML site. Text on site contains standard
> HTML entities:   — &raquo. «. I could define then in
> <!DCOTYPE []> to UNICODE characters. But here are problem: when output
> encoding as ASCII, these entities are expanded to &#xxx; character
> entities, and everything works Ok in any browser. But if output is
> UTF-8 (and I need it for Russian version of my site), they are
> replaced with true UNICODE characters. And it doesn't work, for
> example, in <title></title>.
> Of course, it is browser (Mozilla 1.5) bug. But I need to workaround
> it.
> Here is simple way to left some entities in source XML file (and XSLT
> file) intact? May be, via some extension to XSLT?

  Not possible, entities are not seen from the XPath data model.
Define your own encoding type and register it at the libxml2 level.
The point is that if browsers don't handle UTF-8 they have a serious problem.
I'm surprized Mozilla fails something that basic ! XHTML is XML, they
*MUST* parse properly UTF8. The problem probably occurs because the way the
title is handled, and possibly the toolkit handling of UTF-8 string for
windows title. IMHO it's a widget or a widget binding issue you're seeing.

> AFAIK, XSLT 2.0 will have such ability...

  Probably in a very convoluted and absolutely horrible to implement


Daniel Veillard      | Red Hat Network  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]