… to no surprise, actually ;) My patch from the other day to allow parsing of non-well-formed XML documents in PHP 5.1 seemed to cause some disagreement, if that should be done at all (see the comments). Ian Eure and David Hay think, it
should be removed completely, for Tim Bray it’s shooting yourself in the foot (at least if you use this in business critical applications) and Daniel Veillard insists on fixing the other side instead of using this feature.
I agree with Tim and Daniel completely. Don’t use this feature on a regular basis or even by default. Fix the other side if you can or simply just reject it. But if you use it, use it carefully and only when you really know what you are doing. And validate the XML after it was “recovered”.
To Ian and David: It’s not enabled by default and PHP still throws a bunch of warnings for each error. I think, it should be the desicion of the PHP application developer, if he wants to use this feature and not the desicion by PHP, if such a tool should be provided at all. Nothing is forced upon anyone and the default behaviour is still rejecting
such documents. And you should discuss this with Daniel and ask him to remove that feature from libxml2 in the first place ;)
By the way, I enabled this feature, because I had a little application, which parsed RSS feeds with constantly non well formed HTML code in it (not properly escaped et al.). I couldn’t fix the other side, so I had to deal with HTML tagsoup embedded in XML and this looked like an easy way to go.
Update: Nice discussion as well at Phil Ringnalda’s Blog and a nice quote: “If there’s one thing that the RSS Draconian Wars taught us, it’s that you don’t want to be involved in any discussion of XML and error handling.” I should have maybe known that before ;)