As the Saxon error message makes clear, this error comes from the XML parser, not from Saxon. And if your XML isn't well-formed, there is no way the XML parser is going to accept it.

Changing the output representation isn't going to make any difference since we're concerned here with the XML input, not the output.

I'm afraid Saxon will only work with well-formed XML input, which means you have to make it well-formed before it gets to Saxon. The best way to do that depends on how you want to handle this content - is it noise that you want to discard, or is it information that you want to preserve?

The bottom line is that XML is a standard, and standards bring benefits only if people conform to them. Being nearly conformant is like being a bit pregnant - it's a meaningless concept.

Michael Kay

On 2 Jul 2013, at 15:10, Praful Tarkar wrote:



                We are using Saxon version.


                While transforming we get the following error..
SXXP0003: Error reported by XML parser: An invalid XML character (Unicode: 0x1) was found in the element content of the document.


                One way to solve this issue is to clean the data before sending it to transformation, however thatís not possible for some reason.


                We tried to use the saxon-character-representation property in the xsl output tag.
<xsl:output method="xml" encoding="UTF-8" indent="yes" saxon-character-representation="hex" />
                However, this doesnít solve the problem.


                Any help would be appreciated.




The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. ------------------------------------------------------------------------------
This email is sponsored by Windows:

Build for Windows Store.
saxon-help mailing list archived at