android - Handle SAX parserexception -


i have problem sax xml parser. want parse xml file not valid (i expatparser$parseexception: @ line 5, column 169: not well-formed (invalid token)). know wrong, xml file ist not created me...so cant change it.

now want handle error in defaulthandler. neither error() nor fatalerror() nor warning() invoked...

can somehow interrupt parsing process, tell parser piece of invalid xml , continue parsing???

thanks, jpm

i guess saxparseexception fatal error sax parser cannot recover from. in case need fix bad tag before trying parse (as robert suggests in comment).

you might want using java regex fix known badness in xml, e.g.
regex quoting unquoted xml attributes

for record, not advocating using regex parse xml!


Comments