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

Re: Dealing With Unwanted Characters

Subject: Re: Dealing With Unwanted Characters
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 25 Jul 2001 09:59:20 +0100
unwanted characters
Hi Bryan,

> I am handling an XML file that has a number of '£' characters within
> the text nodes. These are causing difficulties when I try to display
> the output in IE 5 - a message appears telling me that these
> characters are invalid. Anything I can do in my xsl to overcome
> this, or do I need to do something (if so, what?) to my xml (apart
> from removing the '£' from the source xml, which I have no power to
> do)?

The reason that IE is objecting is because the character encoding
that's been used to save the document is not the same as the character
encoding declared (or left undeclared) for the document. Given that it
contains '£' signs, most likely you have an XML declaration like:

  <?xml version="1.0"?>

which indicates that the file is saved in UTF-8, whereas it's actually
been saved in ISO-8859-1. You need to either change the XML
declaration to:

  <?xml version="1.0" encoding="ISO-8859-1"?>

or go through the document and change all the '£' characters into the
character reference &#163;.

If you cannot change the source document at all, then you're pretty
much stuck. XSLT can only work with well-formed XML documents, and a
document that contains '£' characters without the proper encoding is
not a well-formed XML document.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.