Wednesday, April 23, 2003 1:28 AM
The logic (or lack thereof) behind xhtml:body
When Sam started a small revolution last month by using
<xhtml:body> in his rss-feed, he said this was because it was "more bandwidth and xpath friendly". I can see it's more xpath friendly (though I'm not sure why anyone would want to xpath into the description of an item), but bandwidth friendly? All you're saving in comparison with
<content:encoded> is "
<![CDATA[" and "
]]>", big deal.
On top of that, it seems like every rss feed that uses xhtml:body, uses tags like
<body xmlns="http://www.w3.org/1999/xhtml"> for every item, instead of declaring the namespace once at the top of the rss document, and using (the more bandwidth friendly)
<xhtml:body>. Anybody care to explain the logic behind this?
TrackBack URL for this entry: http://www.hutteman.com/scgi-bin/mt/mt-tb.cgi/39
a.) If they use an XHTML prefix then they'd have to explicitly prefix all XHTML tags and no one likes writing verbose crap like xhtml:p, xhtml:br or xhtml:b in their documents.
b.) If they made XHTML the default namespace at the root of their document that would effectively be placing all the RSS items in the XHTML namespace unless they undeclared the default namespace for each item but then they'd have to redeclare it each xhtml:body thus making the top level declaration pointless.
It's all quite logical when you think about it.
Ah that explains it... and shows my ignorance regarding xhtml ;-)
I still don't see how this is more bandwidth friendly than content:encoded btw...
I don't see how it's more bandwidth friendly either.
Also using <xhtml:body> instead of <body xmlns="..."> would probably break some of the RSS aggregators out there, as many are a bit "dumb" about the XML, using the Tag-Name instead of the element's local-name() to find content.
Of course, you could declare it with a prefix of "x", assuming people are using smart aggregators, since they never really care what prefix you use for a namespace, just what namespace that prefix points to. This would still require <x:body> <x:p> <x:table> etc, and on a post of any reasonable size would probably use more bandwidth than using the default namespace declaration, so there's no real benefit gained.
Oh, and I agree that it doesn't seem more bandwidth friendly.
Ack! my last post had all the <tags> stripped out!
Who wrote this buggy comments page? :)
I edited Tim's first comment and replaced all <'s with <'s to make the tags show. This should make it a bit more legible ;-)
I guess I should follow phil's suggestion and put some info here as to allowed tags etc.
nice page. ga zo verder.hopelijk alles goed bij jullie.groetjes en veel liefs voor jullie allen.
paps en mams.
The bandwidth issue looks like a red herring I think. I mentioned these on my site the other week, where Sam said
"All in all, RSS usage is a bit loose, and the specs are best guidelines. Given how valuable this technology is to me, I'd like to nudge it towards being more consistent, well formed, and valid." - source
I think this, along with his recent ghosts and "it's not just for syndication anymore" post, is a pretty reasonable argument for supporting xhtml:body.