Java Reference
In-Depth Information
LISTING 21.13
The full text of sportsfilter.rss
1: <rss version=”2.0”>
2: <channel>
3: <title>SportsFilter</title>
4: <link>http://www.sportsfilter.com/</link>
5: <docs>http://www.rssboard.org/rss-specification</docs>
6: <item>
7: <title>Babe Ruth used steriods?</</title>
8: <link>http://sports.espn.go.com/mlb/news/story?id=1745899</link>
9: <description>Houston Astros second baseman Jeff Kent said the
10: steroids controversy is an embarrassment to baseball and that the
11: public needs to rethink whether sports heroes of yore abstained
12: from illegal performance-enhancing drugs.</description>
13: </item>
14: <item>
15: <title>Phoenix sports fans shell out the bucks</title>
16: <link>http://washpost.com/wp-dyn/articles/A10394-2007Feb26.html</link>
17: <description>Phoenix-area taxpayers have invested $700 million
18: in new stadiums for their pro baseball, basketball, football, and
19: hockey franchises, a world record for governmental sports support,
20: as described in today's Washington Post.</description>
21: </item>
22: <item>
23: <title>Just buy it</title>
24: <link>http://www.nike.com/nikebiz/news/pressrelease.jhtml</link>
25: <description>Marion Jones competing in floor gymnastics, Randy
26: Johnson bowling, Lance Armstrong in the boxing ring, Andre Agassi
27: fielding 2B for the Red Sox. Nike rolls out their spring campaign
28: asking in some rather creatively edited commercial spots starting
29: tonight.</description>
30: </item>
31: </channel>
32: </rss>
SportsFilter, a popular sports community weblog at http://www.sportsfilter.com, shares
the latest news in an RSS 2.0 feed. The XML data from the feed can be read into a vari-
able using the c:import action from the core library and parsed with the x:parse action
from the XML library.
The parsed data can be examined, filtered, transformed, and displayed. Listing 21.14
contains a JSP application that uses simple XPath statements to extract and display parts
of the XML data.
 
Search WWH ::




Custom Search