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

Re: Passing through character entities intact

Subject: Re: Passing through character entities intact
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 10 Oct 2001 18:20:14 -0400
xsl encode character entities
[McCollum , Angus]

> I would like pass the entity through so I can use a non-encodable
> character(mdash) in the final output. What happens in Xalan, is that when
it
> finds a '&' character code it substitues the '&amp;' reference. This does
> not work for non-standard, but common references such as mdash. As a
result
> setting the output encoding to ISO_8859-1, which is the most compatable
for
> the web, will cause an XSLT processor to throw and error or input a
> character like '?' instead of the entity reference.
>
Hmm, if it's non-encodable then how can it be encoded in the output?
Conversely, if it is encodable, the processor should encode it, otherwise it
should output a character reference.  Have you tried another processor to
see whether it handles it more to your liking?  They don't all do the same
thing.

Sometimes you actually get the right thing but it looks different depending
on your editor or viewer and the encoding in use.  If you look at the result
with a hex editor, the character reference is really there.  I just tried
this out, transforming an XML document with a &#160; in it, using utf-8 and
iso-8859-1.  Depending on the encoding and the processor, it displayed
differently in XML Cooktop on Windows 2000 (variously as a space or an A
with an hat over it), but the hex viewer showed that &#160; was actually in
all these versions.

So you may really be getting the result you want but not realize it.

Cheers,

Tom P



 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.