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>
Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
aoeu
  • 1,128
  • 2
  • 13
  • 22

1 Answers1

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.

Joey
  • 344,408
  • 85
  • 689
  • 683
  • 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 '10 at 17:11
  • 2
    Well, that's because the RSS spec isn't the cleanest out there :) I would recommend using Atom! – Julien Genestoux Sep 26 '10 at 17:31
  • 2
    Why have an explicit `` tag in HTML instead of defining everything that isn't in the `` to be in the ``? Several formats have such things :) – Joey Sep 26 '10 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 `

    `, there is no clear reason why `` is there rather than just having `` at that first level.

    – Anthony Feb 07 '18 at 21:01