[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT outputting to XHTML to display character entities

Subject: XSLT outputting to XHTML to display character entities?
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Tue, 22 Apr 2003 17:36:43 -0500
xsl xhtml entities
Hi all,
Sorry if this is an FAQ, but I've looked and can't find info on it.

I have some non-7-bit characters in my source XML document, e.g. &#216;
(O with slash).
My XSL stylesheet is processing the text and outputting it to an
HTML document.  I had wanted to output to XHTML, thinking that was
better than HTML.  For this reason I used
	<xsl:output method="xml" encoding="UTF-8" indent="yes"
	doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
	doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
(I also tried encoding="ISO-8859-1".)

The result was that the non-7-bit characters were output in raw
form, not escaped, into the resulting (x)html.  This makes sense
for XML and is not unexpected.  However when I tried to view the
result in IE 6.0, the characters did not show up correctly.
(They appeared as a box, or as A~, depending on whether I set
encoding to UTF-8 or ISO-8859-1.)

When I change method to "html", the special characters were escaped
to &Oslash; and were displayed correctly by the browser.

My question, then, is: is IE failing to display XHTML correctly?
Isn't it true that XHTML (being XML) is allowed to contain any
Unicode data (except & and < of course unless escaped)?
And if so shouldn't a browser be able to display it correctly?
I know the browser doesn't lack the font for this character
because it shows up right when represented as &#160; in the html.

For now, it's not a problem to me... I can just use method="html"
and generate html.  But what's the Right way to do this?
Is there a way to generate XHTML using XSL and have special characters in
the output serialized using &#...; character entities?

Thanks,
Lars


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.