Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

filtering out unwanted characters

807589Nov 2 2006 — edited Aug 19 2008
I'm writing the contents of my DB to an XML file, but trying to open the outputted XML in Firefox, I get the following exception:

XML Parsing Error: reference to invalid character number

The offending character being:
ampersand-hash-11-semicolon
How do I filter this gremlin out?

I've tried various things:
line = line.replace("\u0011", ""); //is this correct????
and a variety of methods in the commons.lang.StringUtils class. But none of them work. This character still slips through.

Any suggestions on how I might purge this gremlin would be much appreciated.

Many thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2008
Added on Nov 2 2006
8 comments
514 views