Hi Roy,
As a basis for the web services alternative, you might want to look at Mark Pilgrim's Universal Feed Parser: http://feedparser.org/
Tom
Tom Burton-West
Senior Applications Systems Analyst
Library Information Systems
Getty Research Institute
(310)440-7410
[log in to unmask]
>>> [log in to unmask] 03/16/06 11:37 AM >>>
Thank you all for your feedback, both public and private. The
response was universal: it would be better to handle this with code
rather than XSLT, and the best method would be a web services model
where you pass in a URL for a feed and get back standard output,
letting the code handle invalid XML and all the variant forms of RSS.
This is exactly the solution I would like to use, and will continue
to advocate with the powers that be. In this particular instance, I
must be a team player and not just go and do it myself. Meanwhile, in
the short-term I decided to hand-select the appropriate stylesheet
for the specific feed rather than try to write a stylesheet that
could handle anything. That will work for now, but before long I'll
need to have an easier and less fragile method such as the ones you
suggested. Thanks,
Roy
On Mar 15, 2006, at 3:45 PM, Alexander Johannesen wrote:
> On 3/16/06, Roy Tennant <[log in to unmask]> wrote:
>> I'm looking for an XSLT that can detect which version of RSS it is
>> being handed and process it appropriately so I end up with the same
>> elements out the back no matter what RSS format it was
>
> I don't think XSLT is the way to go on this, given that RSS isn't
> always XML nor comes with guarantees of valid nor well-formedness;
> your XSLT processor will break. I'd rather do a simple snoop on the
> version number, check for well-formedness and *then* possibly send it
> to an XSLT script. Also remember that RSS:RDF is a very different
> beast to RSS 2.0 for example. My suggested way to handle this is to
> convert any RSS feed through a series of PHP/Perl/Ruby/Whatever
> scripts to a compliant Atom 1.0 feed, and handle *that* through XSLT.
>
>
> Alex
> --
> "Ultimately, all things are known because you want to believe you
> know."
> - Frank
> Herbert
> __ http://shelter.nu/
> __________________________________________________
>
|