Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

ROME in a Day: Parse and Publish Feeds in Java

O'Reilly XML.com

$1>$1>$1>

By Mark Woodman

$1>$1>$1>

February 22, 2006

$1>$1>

Ready to parse and publish RSS and Atom feeds in Java? In this step-by-step tutorial, we'll show you how to pull in an existing feed, add your own content, and publish the results in a new format, all in 100 lines of code. (200 lines with whitespace and comments.)

$1>$1>$1>

Knowing that RSS and Atom feeds are "just" XML, you might think that parsing and creating syndicated feeds in Java should be a snap. Pick any one type of RSS, and you might be right. Unfortunately, there are at least ten flavors of RSS and Atom out there: RSS 0.90, RSS 0.91 Netscape, RSS 0.91 Userland, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, and the newest addition to the bunch, Atom 1.0. Then there are all the namespace modules, like Dublin Core, Media, and so on. It's all messy enough to make a grown programmer cry. Wipe those tears, Java developers, and say hello to ROME.

$1>$1>$1>$1>$1>$1>

 

When in ROME


In this tutorial, we'll be using ROME to do all the heavy lifting. ROME is an open source (Apache licensed) Java library which is designed to make it easy for you to parse and create syndicated feeds, regardless of format. In fact, all of the variants of RSS and Atom mentioned earlier are supported by ROME.

$1>

ROME doesn't just come with features, it also has a proven track record on sites like My AOL, CNET Networks, and Edmunds.com. The Powered By ROME wiki page describes how ROME is being used in these and other applications.

$1>$1>

The basic approach of ROME is to parse any RSS or Atom feed item into a canonical bean interface. This lets you as a developer manage fairly homogeneous item beans regardless of their original format. Even better, ROME makes it easy to create a new RSS or Atom feed, using those very same beans. This tutorial is going to show you how to do just that.

$1>$1>$1>$1>

(To read the rest of this article, please click on the link in this blog post's title above.)

$1>$1>$1>$1>$1>$1>$1>$1>


This post first appeared on You Need RSS, Atom And ROR Codes On Your Website!, please read the originial post: here

Share the post

ROME in a Day: Parse and Publish Feeds in Java

×

Subscribe to You Need Rss, Atom And Ror Codes On Your Website!

Get updates delivered right to your inbox!

Thank you for your subscription

×