XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

ROME in a Day: Parse and Publish Feeds in Java
by Mark Woodman | Pages: 1, 2, 3, 4, 5, 6

Try It Out

Compile FeedWarmer.java and take your new creation for a spin. The output XML should now have a footer added to each feed item or entry, as shown in Figure 2:

Figure 2
Figure 2. Our FeedWarmer class has added a footer to an RSS item. Click image for full-size screenshot.

Here is a sample of XML that has been run through the FeedWarmer. Note that the <description /> element is untouched, but the <content:encoded /> element has our footer at the end:

<div id='feedwarmer'><hr/>
   <i>Getting Warmer:</i>
   
   <a href='mailto:?subject=ROME 0.8 Released&body=Check this 
   out: http://inkblots.markwoodman.com/2006/02/02/rome-08-released/' 
   >Email this</a> | 
   
   <a href='http://del.icio.us/post/?url=http://inkblots.markwoodman.
   com/2006/02/02/rome-08-released/&title=ROME 0.8 Released'>Add to 
   delicious</a> | 
   
   <a href='http://blogsearch.google.com/blogsearch?hl=en&q=ROME 
   0.8 Released'>Blog Search this</a>
</div>

Moving On

As you can see, ROME can be a valuable way to parse and publish feeds with very little effort. It is fair to say, however, that there is much more to the library than we have covered here. ROME provides support for enclosures, podcasting, and a good deal more. If you would like to see more code examples and tutorials, be sure to visit the ROME Tutorials page.

Finally, if you get stuck and need a hand implementing ROME in your projects, the user and developer groups are always willing to lend a hand. (Full disclosure: I'm on the developer team.) Feel free to stop by the wiki site, join the mailing lists, and get involved.



1 to 4 of 4
  1. Help Needed!!
    2008-01-11 17:02:14 RajKumarSingh
  2. Minor Correction
    2006-02-28 05:25:07 kebernet
  3. Excellent article
    2006-02-24 01:48:59 babelex
  4. Very nice!
    2006-02-22 19:30:45 ericlunt
1 to 4 of 4