16

A typical xml file for an RSS feed starts with an "rss" element on the outermost level, and usually has a single "channel" element within it that represents the "feed" or "channel." Is there ever a situation where it is appropriate to use multiple channels within an element, like the following?

<rss>
    <channel>
         ...
         <item> ... </item>
    </channel>
    <channel>
         ...
    </channel>
</rss>
1
  • The term you were looking for is "element", not "block".
    – Joey
    Sep 26, 2010 at 17:08

1 Answer 1

29

From here:

Subordinate to the <rss> element is a single <channel> element, which contains information about the channel (metadata) and its contents.

So there not only is no use case for that – it isn't even allowed.

4
  • 4
    That brings about the confusion then - why even have a channel tag in the standard? Why not just add the RSS metadata and contents within the "rss" block? Or am I missing something, conceptually?
    – aoeu
    Sep 26, 2010 at 17:11
  • 2
    Well, that's because the RSS spec isn't the cleanest out there :) I would recommend using Atom! Sep 26, 2010 at 17:31
  • 2
    Why have an explicit <body> tag in HTML instead of defining everything that isn't in the <head> to be in the <body>? Several formats have such things :)
    – Joey
    Sep 26, 2010 at 21:04
  • 2
    @Joey - The difference being that HTML requires one head element and one body element. If HTML required one body element that all other elements exist inside of, then it would be similarly pointless as the rss required channel. Like if it was designed like <html><stuff><head/><body/></stuff></html>, there is no clear reason why <stuff> is there rather than just having <head/></body> at that first level.
    – Anthony
    Feb 7, 2018 at 21:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.