Firefox, Atom 1.0 and namespacing
Posted in firefox Wed, 09 Aug 2006 10:16:00 GMT
It seems that Firefox's basic xml parser gets confused by xmlns and namespacing. Namely that if the feed is defined by:
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:default="http://www.w3.org/1999/xhtml"
xmlns:dc="http://purl.org/dc/elements/1.1/">
Firefox's basic XML tree renderer won't recognize the XML if the entry content is wrapped by:
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>Show submenus depending on where your users are.</p>
</div>
</content>
Basically it confuses xhtml:div with atom:div. If xmlns is removed from the div, Firefox is fine.
People don't generally use Firefox's XML tree to read Atom and the W3C Feed Validator doesn't have a problem with it so I'm wondering if this bug exists anywhere else.
This shows up when using XML::Atom because it uses XML::LibXML, which explicitly adds xmlns everywhere.
UPDATE 1: I thought it would be useful to include the following:
The Atom spec (section 4.1.3.3 Processing Model) says:
UPDATE 2: Apparently this behavior may be by design. Not very useful IMO but perhaps intentional. I think it would be more useful to have some Firefox settings that let you switch to XML tree mode or apply a default stylesheet.
Isn’t that the expected behaviour? It recognises the XHTML content’s namespace, and so it renders it as such.
Opera and Konqueror behave in the same way.
If it is, Firefox is inconsistent because it renders an XML tree when only <content type=”html”> is encountered.
It would do, because when the content is HTML, it doesn’t have an XML namespace associated with it. Also, HTML content needs to be escaped in order to remain well formed, so it wouldn’t be interpreted as markup anyway.
I’m happy as long as it looks okay in Atom readers. I’m not crazy about how Firefox displays xhtml atom:content because it doesn’t seem very human-readable and Firefox is for humans.
For example, the Planet Catalyst Atom feed isn’t really legible in Firefox. The first entry is all mashed together because the summary has line breaks that don’t get translated into <br />’s. A more general issue is that Firefox shows the entry title after the content, even when the title is is before content in the Atom xml.
I don’t think Firefox’s xhtml atom:content rendering is very useful but perhaps it’s not an issue because no one really uses it.
I agree that isn’t very legible! Then again, Atom isn’t really meant to be viewed like that.
If you want it to look good in web browsers, you could format it with XSLT. For example, my Atom feed, which is formatted by newsfeed.xsl. It also serves the purpose of providing information to people who aren’t familiar with Atom.
Very nice. Seems like stylesheets is a solution for web browser viewing. It would be nice if Firefox had a decent default stylesheet or a button to render as an XML tree to make web browser reading easy.
Just noticed that Typo (the blog engine used here) includes a CSS stylesheet for its RSS feed but the uri set by rss20_feed.rxml only works if the feed is on the same server and Typo is installed at the root uri (e.g. not /blog). I fixed the feed by hardcoding it in rss20_feed.rxml for now, another reason to move my Typo install to SVK. No stylesheet from Atom yet.
Useful, Thanks for Post[www.ve.info.ve]