Discussion:
[saxon] SXXP0003: An invalid XML character (Unicode: 0x1)
Praful Tarkar
2013-07-02 14:10:02 UTC
Permalink
Hi,

We are using Saxon 9.3.0.11 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" />
As referenced from http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Serializer.Property.html#SAXON_CHARACTER_REPRESENTATION
However, this doesn't solve the problem.

Any help would be appreciated.

Regards,
Praful

________________________________
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.
Julian Reschke
2013-07-02 16:45:58 UTC
Permalink
Post by Praful Tarkar
Hi,
We are using Saxon 9.3.0.11 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./*
...
Saxon uses an XML parser to get its input. The XML parser (not part of
Saxon) reports the error. It does so correctly.

So you'll have to either cleanup the data, or fix the code that
generates it.

Best regards, Julian
Michael Kay
2013-07-02 16:46:39 UTC
Permalink
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
Saxonica
Post by Praful Tarkar
Hi,
We are using Saxon 9.3.0.11 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" />
As referenced fromhttp://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Serializer.Property.html#SAXON_CHARACTER_REPRESENTATION
However, this doesn’t solve the problem.
Any help would be appreciated.
Regards,
Praful
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. ------------------------------------------------------------------------------
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
https://lists.sourceforge.net/lists/listinfo/saxon-help
David Lee
2013-07-02 16:41:19 UTC
Permalink
Since this is reported by the parser, not the serializer,
this is not something saxon can fix.
You need to clean the data to remove invalid XML characters


----------------------------------------
David A. Lee
***@calldei.com<mailto:***@calldei.com>
http://www.xmlsh.org

From: Praful Tarkar [mailto:***@smartstream-stp.com]
Sent: Tuesday, July 02, 2013 10:10 AM
To: saxon-***@lists.sourceforge.net
Subject: [saxon] SXXP0003: An invalid XML character (Unicode: 0x1)

Hi,

We are using Saxon 9.3.0.11 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" />
As referenced from http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Serializer.Property.html#SAXON_CHARACTER_REPRESENTATION
However, this doesn't solve the problem.

Any help would be appreciated.

Regards,
Praful

________________________________
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.
Loading...