Y. B. Normal
Ziv Caspi can't keep his mouth shut.
Click here to visit the Radio UserLand website. Subscribe to "Y. B. Normal" in Radio UserLand. Click to see the XML version of this web page. Click here to send an email to the editor of this weblog. blogchalk: Ziv/Male/31-35. Lives in Israel/Tel Aviv/Central and speaks Hebrew. Spends 20% of daytime online. Uses a Normal (56k) connection.  
Updated: 2002-09-28; 11:42:54 PM.
 

Saturday, September 28, 2002
XML Namespaces and RSS 2.0 11:28:50 PM • comment []Google It!

There's a bit of a battle going on whether the elements in RSS 2.0 should be in a namespace or not. (See, for example, Dave's comment.)

Regardless of your position on this issue, if your RSS aggregator (more correctly, its RSS/XML parser) is namespace-aware, there's a very simple scheme that you can use in the meantime until this matter settles: Grab the <rss> element (that's easy to do, as it's the document element). Ask your XML parser for the namespace of that element. If it's in no namespace, continue as for RSS 0.9x. If it's in a namespace, all the other RSS 2.0 elements (<title>, <link>, <description>, <item>, etc.) will also be in that namespace.

We've been using this algorithm in Aggie for the last few days. It's easy to implement, and until the matter resolves one way or another, it successfully reads all the RSS 2.0 feeds out there.

© Copyright 2002 Ziv Caspi.

 
September 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
Aug   Oct


About
FOAF
RSS and News Aggregators
Radio & Friends
Blogging
Daily
Monthly
Search


miniXmlCoffeeMug.gif miniXmlButton.gif BillSaysThis