- Package:
- libxml-parser-perl
- Source:
- libxml-parser-perl
- Description:
- Perl module for parsing XML files
- Submitter:
- Joey Hess
- Date:
- 2011-12-03 16:51:34 UTC
- Severity:
- wishlist
XML::Parser is not robust enough to handle all the broken rss feeds out there. The most common breakage that it fails on is a feed that contains an invalid utf-8 sequence: not well-formed (invalid token) at line 86, column 165, byte 4698 at /usr/lib/perl5/XML/Parser.pm line 187 I've attached a copy of this feed. The approach taken in other languages XML parsers, such as python's feedparser, is to attempt to be as robust as possible, to be forgiving in what is accepted. They also set a bozo bit if a feed is not well-formed, so that tools that care can detect this.
severity 420636 wishlist thanks Such a lax xml parser is not an xml parser. This bug is therefore a wishlist bug. Mike
Mike Hommey wrote: Not being able to parse as many xml feeds out in the wild as other language's parsers is not a bug?
The fact is they are *not* xml feeds. Mike
Mike Hommey wrote: The fact is that they are out there in the wild and tools are needed to parse them. Do you read Planet Debian? I'll guarantee you that at least one feed currently on there is not valid xml. It seems that you are more interested in arguing semantics than actually fixing the problem? (Which I've worked around in my code now anyway by calling Encode::decode_utf8 on the feed if XML::Feed crashes.)
And this is exactly how you should be dealing with the "problem". There are requirements from XML parsers in the XML specifications. If you want an XML parser to parse something else than valid XML data, you should make your own steps so that your data becomes valid XML data. This is because of the existence of tools that torerate invalid XML that there are still invalid XML files around. Mike
tag 420636 +wontfix thanks Not quite sure if I agree with the conclusions but reading the bug report, looking at the Debian and upstream bug reports I think it best to mark this as wontfix.