[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Dealing With 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 £. 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|