http://qs321.pair.com?node_id=164576


in reply to Re: Re: (YA) Perl XML parser
in thread (YA) Perl XML-like parser

If I spent time debugging all the pseudo-xml parsers I come accross I would not have much time left for real work. That said you are right, your thing handles nested tags just fine. It does not handle mixed content though.

The problem is not which specific feature your code does or does not handle, it is that you have no idea what portion of the XML spec it covers. As you said the XML spec is complex and hard to read. It includes a grammar though, and that's how you should tackle writing a parser: extract the grammar (Ways to Rome will give you 11 ways to do this) and work from there. Do not pretend that code that parses "stuff with pointy brackets" is an XML parser.

There have been numerous discussions about this on this forum (parse the "Other Users XML Ticker" with index and substr being a recent one, On XML parsing giving you a bunch of features that make parsing difficult). It boils down to "do what you want at home, but please don't spread improper code".

Now if you had worked on XML::RSS to get it to work with XML::SAX::PurePerl, now you would have written something useful for you (minimal dependance for an RSS parser) and for the rest of the World.