Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3241058
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:09:19+00:00 2026-05-17T18:09:19+00:00

I am writing an RSS parser. Is there any way to find if the

  • 0

I am writing an RSS parser. Is there any way to find if the given URL is RSS or atom using Java?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:09:20+00:00Added an answer on May 17, 2026 at 6:09 pm

    You could use ROME (I suggest that first) for parsing RSS and Atom Feeds. Alternatively, you’ll have to use a SAX parser or create a DOM tree and do the following:

    For RSS:

    In RSS, you will have to check that there’s a rss element, and it’s child must contain a channel element. There can be 0 or more item in RSS (I might be wrong).

    Example:

    <?xml version="1.0" encoding="UTF-8" ?>
    <rss version="2.0">
    <channel>
        <title>RSS Title</title>
        <description>This is an example of an RSS feed</description>
        <link>http://www.someexamplerssdomain.com/main.html</link>
        <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
        <pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
    
        <item>
            <title>Example entry</title>
            <description>Here is some text containing an interesting description of the thing to be described.</description>
            <link>http://www.wikipedia.org/</link>
            <guid>unique string per item</guid>
            <pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
        </item>
    
    </channel>
    </rss>
    

    For Atom:

    In Atom, you will have to check that there’s a feed element. There can be 0 or more entry in Atom. (I might be wrong).

    Example:

    <?xml version="1.0" encoding="utf-8"?>
    <feed xmlns="http://www.w3.org/2005/Atom">
    
        <title>Example Feed</title>
        <subtitle>A subtitle.</subtitle>
        <link href="http://example.org/feed/" rel="self" />
        <link href="http://example.org/" />
        <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
        <updated>2003-12-13T18:30:02Z</updated>
        <author>
            <name>John Doe</name>
            <email>johndoe@example.com</email>
        </author>
    
        <entry>
            <title>Atom-Powered Robots Run Amok</title>
            <link href="http://example.org/2003/12/13/atom03" />
            <link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
            <link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
            <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
            <updated>2003-12-13T18:30:02Z</updated>
            <summary>Some text.</summary>
        </entry>
    
    </feed>
    

    PS: I don’t know which RSS version or Atom version you want to implement, but follow their guidelines.

    • RSS
    • Atom
    • RSS 2.0 and Atom 1.0 compared
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a rss feed parser with java and I've encountered a problem while
i'm writing a small script that parse an rss using xmllint. Now i fetch
i spent time writing a rss feed aggregator and have come to find out
i spent time writing a rss feed aggregator and have come to find out
I'm writing a jQuery plugin for work which pulls in RSS feed data using
I'm writing an RSS to JSON parser and as a part of that, I
What is the best approach to writing a super simple RSS parser in Google
I'm writing an app the gets information off an RSS feed, parses it using
I was writing a generic class to read RSS feed from various source and
I'm writing a script to check RSS feeds on regular intervals and need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.