RE: [xsl] Smart Quote Encoding

Subject: RE: [xsl] Smart Quote Encoding
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 12 Sep 2007 18:42:03 +0100
> I am using Saxon 6.3 

That's a very old release, though that shouldn't matter as it's failing
before it even gets to Saxon.

> and trying to transform some XML 

Actually your problem is that the thing you are trying to transform isn't
XML - the parser is rejecting it.

> The messages sometimes contain special/nonstandard 
> characters, such as smart quotes.  

How are the messages generated? Whatever software generates them should know
what character encoding it is using, and should set this character encoding
in the XML declaration.
> 
> I receive the following error when I try to apply transformations:
> 
>   Fatal error reported by XML parser: illegal XML character U+18
>     URL:    file:/C:/hello/goodbye.log
>     Line:   8
>     Column: 116

That looks like a pretty weird character to me - it's not what I'd expect
when you use typographical quotes in a Windows encoding.

> 
> How do I handle any arbitrary text yet still be able to apply 
> transformations?

All you have to do - it's very simple in principle! - is to ensure that the
encoding of the characters in the file is what the XML declaration claims it
is.

Michael Kay
http://www.saxonica.com/

Current Thread