[xsl] XML -> XHTML with UTF-8 escaping pass-thru

Subject: [xsl] XML -> XHTML with UTF-8 escaping pass-thru
From: Gan Uesli Starling <alias@xxxxxxxxxxx>
Date: Fri, 21 Mar 2003 10:46:45 -0500
Howdy,

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 for folks
not-in-the-know enough to re-set their
encoding. Plus it is a hassle for them so
that I fear they won't bother.

The result for them comes out like this...

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

...and does not look as well even though
it is the same contents (because of the
default encoding for those browsers). All
the nbsp's and arrow buttons get trashed.

But it would work even for them if the *.html
output retained the ampersand-pound escaping
for these UTF-8 chars, would it not? At least
I have seen it to work that way at this URL
on those same browsers...

http://esperanto.us

Is there a way to get my XSLT to pass
those escaped UTF-8 chars thru without having
to maintain two versions of the original XML?

That is to say, when the XSLT finds an &#160;
in the XML, that the output HTML would contain
ampersand-pound one-sixty semicolon?

If it proves to be a major pain for XSLT,
then perhaps I'll have to ex-post-facto
filter with Perl.

TIA,

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



Current Thread