xsl-list
[Top] [All Lists]

Perl workaround for XSLT escaped UTF-8 pass-thru to XHTML

2003-03-21 16:09:27
Gan Uesli Starling wrote:
I have an XML here...

http://starling.ws/XML/howto.xml

...which uses this XSLT...

http://starling.ws/XML/howto.xsl

...and looks fine when viewed in either
Mozilla 1.2.1 or MSIE 6 SP 1 as *.xml.

But when I use that same XSLT to output
to *.html as a file, then go to view it
as *.html with those same browsers then
the UTF-8 (since it is not escaped with
ampersand-pound) does not display...

Nobody answered my plea about passing escaped
UTF-8 thru from XML to HTML. So I cobbled my
own ex-post-facto Perl solution. Not elegant,
but at least it works. See results at...

http://starling.ws/XML/howto.html

...which should work for most browsers and not
just Mozilla 1.2.1 and MSIE 6 SP 1.

Here is the Perl script. What it does is
reads in all *.html files and translates
a list of UTF-8 chars to their escaped-for-
HTML identical twins. The list of chars is
for Esperanto and some arrow glyphs. Feel
free to add more.

http://starling.ws/XML/re-escape_UTF-8.pl

Enjoy,

Gan

--

 Mistera Sturno - Rarest Extinct Bird

 <(+)__       Gan Uesli Starling
  ((__/)=-    Kalamazoo, MI, USA
   `||`
    ++        http://starling.us


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