You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Mosa Yeung <my...@kinaxis.com> on 2010/06/28 16:32:21 UTC

Exceptions due to control characters

Hi guys,

I've encountered a situation where I have control characters (in this case, &#xF) being written to xml and read back out for output. XMLFormatter was able to write it to the xml file without escaping it, but XMLSanner emits an 'XMLErrs::InvalidCharacterRef' on attempting to parse it. I actually don't care to have the control character pass through correctly, I just want it not to cause the whole parse to fail.

What's the "correct" way to deal with these control characters?

Mosa

Reading value from schema file

Posted by "Sharma, Gaurav" <Ga...@Safenet-inc.com>.
Hi All,

Is there any way through which I can get the value of any xml schema node. Please note I want to fetch the value of the node from schema file not from xml file.


With Best Regards
Gaurav Sharma
The information contained in this electronic mail transmission 
may be privileged and confidential, and therefore, protected 
from disclosure. If you have received this communication in 
error, please notify us immediately by replying to this 
message and deleting it from your computer without copying 
or disclosing it.



RE: Exceptions due to control characters

Posted by John Lilley <jl...@datalever.com>.
I have encountered this as well.  It seems that Xerces incorrectly allows characters to be formatted that it and other XML parsers will fail to parse.  We've had to add a pre-filter to the text before it is added to the XML document, perhaps there is a better approach?
john

-----Original Message-----
From: Mosa Yeung [mailto:myeung@kinaxis.com] 
Sent: Monday, June 28, 2010 8:32 AM
To: c-users@xerces.apache.org
Subject: Exceptions due to control characters

Hi guys,

I've encountered a situation where I have control characters (in this case, &#xF) being written to xml and read back out for output. XMLFormatter was able to write it to the xml file without escaping it, but XMLSanner emits an 'XMLErrs::InvalidCharacterRef' on attempting to parse it. I actually don't care to have the control character pass through correctly, I just want it not to cause the whole parse to fail.

What's the "correct" way to deal with these control characters?

Mosa

Re: Exceptions due to control characters

Posted by David Bertoni <db...@apache.org>.
On 6/28/2010 7:32 AM, Mosa Yeung wrote:
> Hi guys,
>
> I've encountered a situation where I have control characters (in this case,&#xF) being written to xml and read back out for output. XMLFormatter was able to write it to the xml file without escaping it, but XMLSanner emits an 'XMLErrs::InvalidCharacterRef' on attempting to parse it. I actually don't care to have the control character pass through correctly, I just want it not to cause the whole parse to fail.
>
> What's the "correct" way to deal with these control characters?
If XMLFormatter is serializing illegal characters, please file a bug so 
it can be fixed. You should definitely get an error when serializing.

It might be better to report an error when you try to create a text node 
with illegal characters, but that would have a serious performance 
impact on large text nodes.

Dave