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

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>. I mean, that:

<?xml version="1.0" encoding="utf-8"?>
    <title>This is title with mdash (&#151;) and nbsp (&#160;)</title>
This is body with with mdash (&#151;) and nbsp (&#160;).

works fine -- I can see long dash in title of window and in text, and if I change
&#160; and &#151; into UTF-8 codes, nothing works in title: I could
see mdash in text, but not in title.

Of course, it is browser (Mozilla 1.5) bug. But I need to workaround

Here is simple way to left some entities in source XML file (and XSLT
file) intact? May be, via some extension to XSLT?

AFAIK, XSLT 2.0 will have such ability...

             Lev Serebryakov

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