[libxml-devel] XML namespace issues

Keith Fahlgren keith at oreilly.com
Wed Feb 20 15:21:44 EST 2008


On 2/15/08 6:44 PM, pahlke at gmail.com wrote:
> Hey everyone,
> I've been working on parsing rss feeds with libxml-ruby, and
> everything seemed to be working great until I ran across files without
> namespaces defined.  For example, if I try to parse this semi-valid
> xml file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <rss version="2.0" >
> <channel>
>   <media:thumbnail url="http://nowhere.com/test.jpg"/>
> </channel>
> </rss>
> 
> libxml strips the media namespace out of media:thumbnail.  Is there a
> way to make libxml be less strict about namespaces?

Hi,

Frankly, the answer is, I believe, and should be, "no." The reason XML works is
that it sets a minimum standard and doesn't deviate. There is no such thing as a
"semi-valid XML file."

Who is generating this bogus feed?

Sorry,
Keith


More information about the libxml-devel mailing list