Lester Burnham wrote:Why do you expect to get exceptions for those characters? XML can contain just about any character - that's not cause for any exceptions. If those characters are not supposed to be there, talk to the producer of the XML to fix that.
Lester Burnham wrote:XML can contain just about any character - that's not cause for any exceptions.
Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
balamurugan velliambalam wrote:But the producer of the xml was client we don't supposed to fix it so please provide any alternate solution to find that special character in xml file.
Peter Taucher wrote:
Lester Burnham wrote:XML can contain just about any character - that's not cause for any exceptions.
I don't fully agree with that. The parser usually is designed to read a defined encoding. In the provided example no encoding is specified. If I try to parse it as 'UTF-8' I'll get an exception and cannot read the document. If I try to parse it as 'ISO-8859-1' (because it is ANSI encoded) there's no problem at all reading the file. So specifying an xml encoding is always a good idea.
But the producer of the xml was client we don't supposed to fix it so please provide any alternate solution to find that special character in xml file.
David Newton wrote:We get lots of external files; we have a process that removes garbage from them before the XML processing itself. Sometimes this causes its own set of issues, but we can't rely on file produces to do the right thing, so we assume the risk of causing a different sort of issue ourselves. Just another option.
Don't get me started about those stupid light bulbs. |