XML.com: XML From the Inside Out

oreilly.comSafari Bookshelf.Conferences.
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Never Mind the Namespaces: An XSLT RSS Client
Subject: RSS xslt, not quite so simple
Date: 2003-01-08 00:09:59
From: bryan rasmussen


Although I agree that local-name() is a help when dealing with the whole RSS mess, this stylesheet just scratches the surface, this is no doubt it's purpose, but as a surface scratcher it doesn't seem to me that you can note how little code it took when there is quite a bit more to be done.


For example, when you do an if test="dc:date" under item, if you actually wanted to check about the date you would have to support pubDate in RSS 2.0, dc:date in RSS 1.0 and it looks like nothing in the earlier versions.
I suppose the best thing would be choose, when dc:date use dc:date otherwise use pubDate.
That's a quibble I suppose but the fact that your strategy here depends on skipping the description of an item can be seen as an indication of where XSLT is going to have problems, since description in certain RSS versions can have escaped html inside of it.


As can be seen here:
http://static.userland.com/gems/backend/rssTwoExample2.xml


most of the time, as in the example above this is to put in a link so it would be possible, if tedious, to parse out the a tags as text and create actual links from them, however in some RSS feeds, I'm thinking of that of Jon Udell, description is filled with so much variant html it's pretty much inconceivable that one should want to work with it.


As you indicated people can use the RSS as they want, but once one gets beyond the tagset you have chosen to work with here RSS is something that quickly can cause an increase in xslt code, despite the relative simplicity of any individual RSS spec.


No Previous Message Previous Message   Next Message Next Message

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938