RSS items order, does it matter?
Asked Answered
T

2

8

I created an RSS feed with Java Rome lib. The project is near the end. But I found strange behavior in some RSS clients.

I think it's more of an RSS clients' problem, but I want to make sure.

Rome holds items in a List, so the latest items are at the end of the list. I opened my feed in my RSS clients (Firefox and RSS Bandit) and I found they are in reversed order (technically it's chronological, but reversed compared to the order I used).

I thought it's an RSS client bug (I usually use Google Reader), but I checked some feeds on the Internet and saw that reason that they display correctly is they have reverse ordered items (oldest on the top).

But XML parsers shouldn't rely on item order. Why do RSS clients use item order instead of dates for sorting items?

And, most importantly, should I reorder my items list?

Edit: I found an easy solution:

     entries.add(0,entry); // :-)

But the question about "correct" client behavior remains.

Trakas answered 2/12, 2009 at 4:3 Comment(2)
General XML parsers should definitely rely on node order. See for example the DOM's firstChild.Shaman
Right. I was wrong when it comes to XML parsers. So there was no question. Only comment that Rome's design in this aspect is poor. They have the same bug in tutorial.Trakas
D
10

One of the underlying problems of RSS is that there really isn't a single standard whose field usage is well-defined. I would worry much more about what clients and servers actually seem to do, not what you think a spec theoretically tells them to do...

Durbin answered 2/12, 2009 at 9:19 Comment(0)
C
0

I have a question: doesn't its a client issue, and are you publishing the date properly for each item. Ideally the clients should sort using the Pub Date and each item should have a GUID for the clients to identify it properly.

Coalition answered 2/12, 2009 at 9:23 Comment(4)
I checked few feeds on the Internet all are revers sorted. I think clients ignore dates. this is my node: <entry> <title>Utworzono nową grupę</title> <author> <name /> </author> <updated>2009-12-02T09:29:59Z</updated> <published>2009-12-02T09:29:59Z</published> <summary type="text">Obserwuję teraz grupę: a</summary> <dc:date>2009-12-02T09:29:59Z</dc:date> </entry> I think date is in correct format (I think Rome lib works correct). Revers sorting items solved problem.Trakas
I disagree, the stackoverflow is not reverse sorted, nor do many sites: stackoverflow.com/feeds/question/1830580Coalition
to me reverse sorting looks like a workaround, not a solutionCoalition
ok I checked it again. I think This is really very little difference. Notifications fill be work in both cases (i think this is done withe simple diff). Only difference is order in Firefox feed preview (but nobody use it anyway).Trakas

© 2022 - 2024 — McMap. All rights reserved.