tags:

views:

90

answers:

1

Hey guys, I have a schema which I use xmlbeans to umarshal to java objects. I have no control over the kind of data that comes thru. One such field looks like <Name>Barnes & Noble</Name> Parsing fails at the character & with lexical error. Is there a way to specify an option while parsing xml files to ignore some special characters?

Any help you could provide will be great.

thanks

+2  A: 

No. This is invalid XML. Ampersand must be escaped into "&amp;".

You can manually escape all ampersand before parsing it as XML but that may mess up other XML entities.

ZZ Coder