On Wed, May 22, 2013 at 5:17 AM, Vladimir Mihailenco
<
vladimi...@gmail.com> wrote:
> I have a huge amount of malformed XML that was previously accepted and
> parsed by Ruby. Now I have to reparse it using Go. What are you using to
> parse invalid/malformed/incomplete XML?
>
> Most popular errors I see are:
> - <a><b></b> - missing tag
encoding/xml can handle these. See the docs for Decoder:
http://golang.org/pkg/encoding/xml#Decoder
> - <a><b></b - truncated XML
> - <foo-bar></foo_bar> - miss-spelled closing tag
These feel wildly broken. The encoding/xml package could possibly
ignore the bogus end tag, but it'd be pretty hard to get sensible
behavior out of it.
gustavo @
http://niemeyer.net