</>
Skip to content
XML lessons (20/29)

XML — RSS

What is RSS?

RSS (Really Simple Syndication) is an XML-based format for sharing content.

RSS Feed Structure

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
    <channel>
        <title>My Blog</title>
        <link>https://example.com</link>
        <description>A blog about technology</description>
        <item>
            <title>First Post</title>
            <link>https://example.com/post1</link>
            <description>This is my first post</description>
            <pubDate>Mon, 01 Jan 2025 12:00:00 GMT</pubDate>
        </item>
        <item>
            <title>Second Post</title>
            <link>https://example.com/post2</link>
            <description>This is my second post</description>
            <pubDate>Tue, 02 Jan 2025 12:00:00 GMT</pubDate>
        </item>
    </channel>
</rss>

RSS Elements

ElementDescription
channelFeed container
titleFeed/channel title
linkURL to website
descriptionFeed description
itemIndividual entry
pubDatePublication date

Parsing RSS

fetch("feed.xml")
    .then(res => res.text())
    .then(str => new DOMParser().parseFromString(str, "text/xml"))
    .then(xml => {
        xml.querySelectorAll("item").forEach(item => {
            console.log(item.querySelector("title").textContent);
        });
    });

Atom vs RSS

FeatureRSSAtom
Version2.01.0
NamespaceNoYes
ContentDescription onlyFull content
Feed IDNoRequired

Mini Practice

  1. Create an RSS feed
  2. Add multiple items
  3. Parse an RSS feed
  4. Display feed content in HTML

Up Next

Continue with SOAP — Simple Object Access Protocol.

Related Topics

Frequently Asked Questions about RSS

What is RSS in XML?

RSS is a fundamental concept in XML. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn RSS?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn RSS.

Why is RSS important in XML?

RSS is essential for XML development. Understanding this concept will help you write better code and solve real-world problems more effectively.