SlideShare a Scribd company logo
1 of 18
Download to read offline
1
Enabling Live
Newsfeeds using RSS,
Servlets and
Transformations
Russell Castagnaro
Russell@4charity.com
Introduction
Presenter
? Russell Castagnaro
? Chief Mentor
? 4Charity.com
? SyncTank Solutions, Inc
? russell@4charity.com
? Experience
2
Introduction
4Charity.com
? Application Service Provider for the Non-
Profit industry
? Pure Java development
? Http://www.4charity.com
? Locations:
? San Francisco,CA (HQ)
? Honolulu, HI (Tech Team)
Goals?
Leverage the Servlet 2.2 API
Employ XML for data and configuration
Use Resource Definition Format for
content data
Format XML using XSL Transformation
Eliminate hard-coding values
3
What’s the deal?
Newsfeeds are becoming a requirement
for portal sites.
Easy integration with existing web
services is a key requirement?
How can we avoid writing custom code
for information providers?
Can we avoid applets!!?
Background
In 1999 I wrote an information portal
application.
Live newsfeeds seemed like a good idea
I wrote custom parsers and employed an
open-source tool called Cocoon
Every time the html changed, I had to
recode!
4
Code Example
Needed different ‘ParsSpec’for each
content provider
URLToXMLConsumer.java
SpaceProducer.java
These worked great for 2 months...
‘ParseSpec’
#HeadlineEntry
cacheTime=6000
HeadlineEntry=start=n,end=<p>,attributes=Link,URL,Headline,Source,Date
HeadlineEntry.Link=start=<a href=",end=">
HeadlineEntry.Headline=start=">,end=</a>
HeadlineEntry.Source=start=<font size="-1">,end=</font>
#HeadlineEntry.Description=start=<br>,end=<br>
HeadlineEntry.Date=start=- <i>,end=</i>
HeadlineEntry.DTD="http://space.synctank.com/dtds/newsfeed.dtd "
HeadlineEntry.Doctype=Newsfeed
HeadlineEntry.URL=http://search.news.yahoo.com/search/news?p=space+aerospace&n=
HeadlineEntry.QTY=10
HeadlineEntry.XML=version="1.0"
HeadlineEntry.Header=
<?xml-stylesheet href="http://space.synctank.com/xsl/spacenews.xsl" type="text/xsl"?>n
<?cocoon-process type="xslt"?>n
<!-- ============================================================ -->n
<!-- spacenews.xml -->n
<!-- Simple XML file that uses the Newsfeed DTD. -->n
<!-- Author: XML Loader Russell Castagnaro Thu Nov 18 22:59:07 HST 1999 ->n
<!-- ============================================================ -->n
5
Java Code
URLToXMLProducer.xml and subclasses
Nice Features
All search providers content was
converted to one XML document type
Once the XML was created all search
engines results were handled easily
with XSLT
6
Document Type Definition
<?xml version="1.0" encoding="US-ASCII" ?>
<!-- Newsfeed.dtd -->
<!-- Simple DTD that defines a grammar for news Feeds. -->
<!-- Author: Russell Castagnaro Nov 15 1999 -->
<!ELEMENT Newsfeed (HeadlineEntry)+>
<!ELEMENT HeadlineEntry (Link, Headline, Source, Description, Date)>
<!ELEMENT Link (#PCDATA)>
<!ELEMENT Headline (#PCDATA)>
<!ELEMENT Source (#PCDATA)>
<!ELEMENT Description (#PCDATA)>
<!ELEMENT Date (#PCDATA)>
NewsFeed Content (XML)
<?xml version="1.0"?>
<?xml-stylesheet href="spacenews.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<Newsfeed>
<HeadlineEntry>
<Link>http://dailynews.yahoo.com/h/ap/19991222/sc/space_shuttle_77.html</Link>
<Headline>Shuttle Astronauts Begin <b>Space</b>walk</Headline>
<Source>(Associated Press)</Source>
<Date>Dec 22 6:08 PM EST</Date>
</HeadlineEntry>
<HeadlineEntry>
<Link>http://biz.yahoo.com/rf/991222/xr.html</Link>
<Headline>RESEARCH ALERT - Boeing raised to buy</Headline>
<Source>(Reuters)</Source>
<Date>Dec 22 12:03 PM EST</Date>
</HeadlineEntry>
</Newsfeed>
7
Transforming the
Newsfeed
Make the news feed human readable:
? Create a Stylesheet using the XML
DOCTYPE rules
? Transform the XML Document Using the XSL
Document
* Specifics on transformations coming soon!
The StyleSheet
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="no"/>
<xsl:template match="/">
<TABLE width="100%" cellpadding="0" cellspacing="0" border="0">
<TR><TD bgcolor="#3366CC" align="left" valign="middle">
<font face="helvetica, arial" size="2" color="#FFFFFF">
<nobr><b>News</b></nobr></font>
</TD><TD align="right" bgcolor="#3366CC" valign="top" >
<a href="/space/news/spacenews.xml">
<font face="helvetica, arial" size="1" color="#FFFFFF">View</font></a>
<IMG SRC="/space/images/spacer2.gif" BORDER="0" WIDTH="5" HEIGHT="2"/>
</TD></TR>
<TR><TD>
<font size="2" face="Arial, Helvetica, sans-serif">
<b>Space and Aerospace News</b></font><BR/>
<xsl:apply-templates/>
</TD></TR></TABLE>
</xsl:template>
<xsl:template match="HeadlineEntry">
<B><FONT face="helvetica, arial" size="1">
<A HREF="{Link}"><xsl:value-of select="Headline"/></A>
</FONT></B> - <I>
<FONT size="-2" face="Arial, Helvetica, sans-serif">
<xsl:value-of select="Source"/></FONT></I><BR/>
</xsl:template>
</xsl:stylesheet>
8
HTML Content
Then the Display Format
Changed
Simple changes in the format from any
site required significant changes
Changing the parsing rules was not
trivial
Eventually this became boring and
tiresome
9
Interesting Points
I was not interested in manipulating XML
documents within Java*
I did not want to deal with DOM or SAX
I was interested in displaying data in a
clean, efficient manner
The producer code I created was a bit
embarrassing
*I was not lazy. I had a very full schedule at the time… . Sheesh!
Time Warp (Oct 2000)
None of my parsing instructions still
worked ?
I had no interest in using the old code
There had to be a better way
I heard about O’reilly’s merkat project…
10
Enter RDF Site Summary
Preliminary format was v .91 from
Netscape (remember them?)
Resource Definition Format Summary
(RSS .91) http://my.netscape.com/publish/formats/rss-0.91.dtd
Eliminates the need to parse through
HTML for content.
Standard - now WC3 has recommended
version 1.0
RSS Example<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
"http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
<channel>
<title> Space science news</title> <link>http://www.moreover.com</link>
<description>Space science news - news headlines from around the web, refreshed every 15
minutes</description> <language>en-us</language>
<image>
<title>moreover...</title> <url>http://i.moreover.com/pics/rss.gif</url>
<link>http://www.moreover.com</link> <width>144</width> <height>16</height>
<description>News headlines from more than 1,800 sources, harvested every 15
minutes...</description>
</image>
<item>
<title>NASA releases space station crew logs</title>
<link>http://c.moreover.com/click/here.pl?r16768175</link>
<description>floridatoday.com Mar 22 2001 12:20AM ET</description>
</item> <item>
<title>Tough love but support for space by George W. Bushs team</title>
<link>http://c.moreover.com/click/here.pl?r16768185</link>
<description>floridatoday.com Mar 22 2001 12:20AM ET</description>
</item>
</channel>
</rss>
C:developmentCastagnarospacespace-moreover.xml
11
RSS Stylesheet Example
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="rss">
<Foo bar="{version}"> <xsl:apply-templates/> </Foo>
</xsl:template>
<xsl:template match="channel">
<TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR>
<TH align="left" bgcolor="#3366CC" valign="top" >
<a alt="{description}" href="{link}"><font face="helvetica, arial" size="2"
color="#FFFFFF"><nobr><xsl:value-of select="title"/></nobr></font></a></TH> </TR>
<xsl:apply-templates select="image"/>
<xsl:apply-templates select="item"/>
</TABLE>
</xsl:template>
<xsl:template match="image">
<TR><TD align="right"><a href="{link}">
<IMG SRC="{url}" BORDER="0" WIDTH="{width}" HEIGHT="{height}"/></a></TD></TR>
</xsl:template>
<xsl:template match="item">
<TR><TD colspan="2"><B><FONT face="helvetica, arial" size="1">
<A HREF="{link}"><xsl:value-of select="title"/></A></FONT></B> - <I>
<FONT size="-2" face="Arial, Helvetica, sans-serif"><xsl:value-of
select="description"/></FONT></I></TD></TR>
</xsl:template>
</xsl:stylesheet>
Newsfeed HTML
12
Access to RSS Feeds
Where do you find providers???
Directory of open RSS providers:
? http://www.superopendirectory.com/directory/4/standards/rss/sources
RSS Providers
? 10.am
? http://10.am/search/-rss?search=<your term here>
? List of topics: http://10.am/extra/ocsdirectory.xml
? echofactor
? http://www.echofactor.com/feed_categories.html?format=RSS
? MoreOver
? http://w.moreover.com/categories/category_list.html
Now we need to make this content readable!
Transforming
XML to HTML
We have many options on performing XSL
Transformations:
? Depend on the client’s browser to transform the XML
? Write a Servlet to handle the transformation
? Use software that is widely available and standards based
Issues:
? IE 5.x is one of the few browsers that support XSL
transformations
? Publicly available software has many merits too
? Servlets are easy enough. Transformations can be done in
< 10 lines
13
Transformation in a
Servletpublic void service(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
PrintWriter out = res.getWriter();
res.setContentType("text/html");
File xmlFile = new File(sourcePath, req.getParameter("XML"));
File xslFile = new File(sourcePath, req.getParameter("XSL"));
try {
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process(new XSLTInputSource(new FileReader(xmlFile)),
new XSLTInputSource(new FileReader(xslFile)),
new XSLTResultTarget(out));
} catch (Exception e) {
out.println("Error: " + e.getMessage());
}
out.flush();
}
One Problem
We have to get the XML (RSS) file from
the content provider!
Use the networking classes to access the
URL
Be considerate of your provider!
14
New Codepublic void doGet(HttpServletRequest req, HttpServletResponse res) {
try {
PrintWriter out = res.getWriter(); res.setContentType("text/html");
URLConnection con; DataInputStream in;
URL url = new URL(sourceURL); con = url.openConnection();
con.connect(); String type = null;
in = new DataInputStream(con.getInputStream());
FileReader fr = new FileReader(xslsrc);
try {
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process(new XSLTInputSource(in), new XSLTInputSource(fr),
new XSLTResultTarget(out));
} catch (Exception e) { log("Error: " + e.getMessage());
} finally { in.close(); fr.close(); }
out.flush();
} catch (Exception e) { …
}
XSLT Model
Request
Response
Servlet
URL Loaded
XML
XSLT
Processor
XSL
Document
HTML
NewsFeed
15
Setting up your servlet
Most Appservers or Webservers
support WAR’s and Deployment
Descriptors
You create a WebApp which has
servlets, parameters and servlet
mappings
Deployment Descriptor
<web-app>
<servlet>
<servlet-name>newsServlet</servlet-name>
<servlet-class>com.synctank.http.servlets.RSSServlet</servlet-class>
<init-param>
<param-name>ERROR_URL</param-name>
<param-value>/error.jsp</param-value>
<description>The error page for this app.</description>
</init-param>
<init-param>
<param-name>SOURCE_SERVLET_URI</param-name>
<param-value>http://www.moreover.com/cgi-
local/page?o=rss&c=Space%20science%20news</param-value>
<description>An absolute url that points to your XML</description>
</init-param>
16
Deployment Descriptor
<init-param>
<param-name>STYLESHEET</param-name>
<param-value>/xsl/rss.xsl</param-value>
<description>The Stylesheet for presentation of the headlines. Should be a
subdirectory of the war. The default is /xsl/rss.xsl </description>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>newsServlet</servlet-name>
<url-pattern>/newsy</url-pattern>
</servlet-mapping> <welcome-file-list>
<welcome-file>/foo/news.html</welcome-file>
</welcome-file-list>
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
</web-app>
War directory structure
Root
? WEB-INF
? Web.xml
? classes
? comsynctankhttpservletsRSSServlet.class
? xsl
? rss.xsl
? docs
? Index.html
? error.jsp
17
Moving Forward
RSS version 1.0 has been
recommended by the w3c
1.0 Uses has more flexibility
Once more providers support
Review
Don’t do the time!
Leverage RSS and open content providers
Use XSL to transform XML content to your
format of choice
Cache requests to content providers (keep
them free!)
18
Finally
Thanks for attending
Source Code Available
? http://www.synctank.com/xmldevcon
? russell@4charity.com
Aloha

More Related Content

Similar to 2001: Bridging the Gap between RSS and Java Old School Style

IWMW 2001: XML and XSLT
IWMW 2001: XML and XSLT IWMW 2001: XML and XSLT
IWMW 2001: XML and XSLT IWMW
 
Transforming xml with XSLT
Transforming  xml with XSLTTransforming  xml with XSLT
Transforming xml with XSLTMalintha Adikari
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xsltTUSHAR VARSHNEY
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCjimfuller2009
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Jamie Matthews
 
Documentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-timeDocumentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-timelykhinin
 
Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIRoselin Mary S
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Estelle Weyl
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)Pat Patterson
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucksTim Wright
 
Surviving the Zombie Apocalpyse of Connected Devices
Surviving the Zombie Apocalpyse of Connected DevicesSurviving the Zombie Apocalpyse of Connected Devices
Surviving the Zombie Apocalpyse of Connected DevicesGustaf Nilsson Kotte
 
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...Allison Jai O'Dell
 
Base HTML & CSS
Base HTML & CSSBase HTML & CSS
Base HTML & CSSNick Chan
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Wahyu Putra
 

Similar to 2001: Bridging the Gap between RSS and Java Old School Style (20)

xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
Xhtml Basics
Xhtml BasicsXhtml Basics
Xhtml Basics
 
Xhtml Basics
Xhtml BasicsXhtml Basics
Xhtml Basics
 
IWMW 2001: XML and XSLT
IWMW 2001: XML and XSLT IWMW 2001: XML and XSLT
IWMW 2001: XML and XSLT
 
Transforming xml with XSLT
Transforming  xml with XSLTTransforming  xml with XSLT
Transforming xml with XSLT
 
Introduction of xml and xslt
Introduction of xml and xsltIntroduction of xml and xslt
Introduction of xml and xslt
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoC
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Documentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-timeDocumentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-time
 
Service Oriented Architecture - Unit II
Service Oriented Architecture - Unit IIService Oriented Architecture - Unit II
Service Oriented Architecture - Unit II
 
Seo cheat-sheet
Seo cheat-sheetSeo cheat-sheet
Seo cheat-sheet
 
Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0Moving from Web 1.0 to Web 2.0
Moving from Web 1.0 to Web 2.0
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Surviving the Zombie Apocalpyse of Connected Devices
Surviving the Zombie Apocalpyse of Connected DevicesSurviving the Zombie Apocalpyse of Connected Devices
Surviving the Zombie Apocalpyse of Connected Devices
 
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
Notes from the Library Juice Academy courses on XPath, XSLT, and XQuery: Univ...
 
Base HTML & CSS
Base HTML & CSSBase HTML & CSS
Base HTML & CSS
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3
 

More from Russell Castagnaro

The Commerce We Deserve: Cryptocomerce
The Commerce We Deserve: CryptocomerceThe Commerce We Deserve: Cryptocomerce
The Commerce We Deserve: CryptocomerceRussell Castagnaro
 
HICSS-50: Are smart cities to fragile
HICSS-50: Are smart cities to fragileHICSS-50: Are smart cities to fragile
HICSS-50: Are smart cities to fragileRussell Castagnaro
 
2014 Introduction to eHawaii.gov
2014 Introduction to eHawaii.gov2014 Introduction to eHawaii.gov
2014 Introduction to eHawaii.govRussell Castagnaro
 
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.govRussell Castagnaro
 
Love, Death and Elevators: An undercover look at eGovernment Services in Hawaii
Love, Death and Elevators: An undercover look at eGovernment Services in HawaiiLove, Death and Elevators: An undercover look at eGovernment Services in Hawaii
Love, Death and Elevators: An undercover look at eGovernment Services in HawaiiRussell Castagnaro
 
Russell Castagnaro Hawaii Digital Government Summit 2013
Russell Castagnaro Hawaii Digital Government Summit 2013Russell Castagnaro Hawaii Digital Government Summit 2013
Russell Castagnaro Hawaii Digital Government Summit 2013Russell Castagnaro
 
HICSS 2012 eHawaii.gov : eGovernment in Practice
HICSS 2012 eHawaii.gov : eGovernment in PracticeHICSS 2012 eHawaii.gov : eGovernment in Practice
HICSS 2012 eHawaii.gov : eGovernment in PracticeRussell Castagnaro
 
eTax services in Hawaii: Lessons Learned
eTax services in Hawaii: Lessons LearnedeTax services in Hawaii: Lessons Learned
eTax services in Hawaii: Lessons LearnedRussell Castagnaro
 
2009 eBench Warrants presentation
2009 eBench Warrants presentation2009 eBench Warrants presentation
2009 eBench Warrants presentationRussell Castagnaro
 
Hawaii International Conference on Systems Science 2013
Hawaii International Conference on Systems Science 2013Hawaii International Conference on Systems Science 2013
Hawaii International Conference on Systems Science 2013Russell Castagnaro
 
2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the ContextRussell Castagnaro
 
2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EERussell Castagnaro
 

More from Russell Castagnaro (15)

The Commerce We Deserve: Cryptocomerce
The Commerce We Deserve: CryptocomerceThe Commerce We Deserve: Cryptocomerce
The Commerce We Deserve: Cryptocomerce
 
Blockchain Introduction
Blockchain IntroductionBlockchain Introduction
Blockchain Introduction
 
Wampum Introduction Deck
Wampum Introduction DeckWampum Introduction Deck
Wampum Introduction Deck
 
HICSS-50: Are smart cities to fragile
HICSS-50: Are smart cities to fragileHICSS-50: Are smart cities to fragile
HICSS-50: Are smart cities to fragile
 
2014 Introduction to eHawaii.gov
2014 Introduction to eHawaii.gov2014 Introduction to eHawaii.gov
2014 Introduction to eHawaii.gov
 
2014 Access Hawaii Report
2014 Access Hawaii Report2014 Access Hawaii Report
2014 Access Hawaii Report
 
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov
2014 Hawaii Digital Government Summit : Department of Health and eHawaii.gov
 
Love, Death and Elevators: An undercover look at eGovernment Services in Hawaii
Love, Death and Elevators: An undercover look at eGovernment Services in HawaiiLove, Death and Elevators: An undercover look at eGovernment Services in Hawaii
Love, Death and Elevators: An undercover look at eGovernment Services in Hawaii
 
Russell Castagnaro Hawaii Digital Government Summit 2013
Russell Castagnaro Hawaii Digital Government Summit 2013Russell Castagnaro Hawaii Digital Government Summit 2013
Russell Castagnaro Hawaii Digital Government Summit 2013
 
HICSS 2012 eHawaii.gov : eGovernment in Practice
HICSS 2012 eHawaii.gov : eGovernment in PracticeHICSS 2012 eHawaii.gov : eGovernment in Practice
HICSS 2012 eHawaii.gov : eGovernment in Practice
 
eTax services in Hawaii: Lessons Learned
eTax services in Hawaii: Lessons LearnedeTax services in Hawaii: Lessons Learned
eTax services in Hawaii: Lessons Learned
 
2009 eBench Warrants presentation
2009 eBench Warrants presentation2009 eBench Warrants presentation
2009 eBench Warrants presentation
 
Hawaii International Conference on Systems Science 2013
Hawaii International Conference on Systems Science 2013Hawaii International Conference on Systems Science 2013
Hawaii International Conference on Systems Science 2013
 
2001: JNDI Its all in the Context
2001:  JNDI Its all in the Context2001:  JNDI Its all in the Context
2001: JNDI Its all in the Context
 
2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE
 

Recently uploaded

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

2001: Bridging the Gap between RSS and Java Old School Style

  • 1. 1 Enabling Live Newsfeeds using RSS, Servlets and Transformations Russell Castagnaro Russell@4charity.com Introduction Presenter ? Russell Castagnaro ? Chief Mentor ? 4Charity.com ? SyncTank Solutions, Inc ? russell@4charity.com ? Experience
  • 2. 2 Introduction 4Charity.com ? Application Service Provider for the Non- Profit industry ? Pure Java development ? Http://www.4charity.com ? Locations: ? San Francisco,CA (HQ) ? Honolulu, HI (Tech Team) Goals? Leverage the Servlet 2.2 API Employ XML for data and configuration Use Resource Definition Format for content data Format XML using XSL Transformation Eliminate hard-coding values
  • 3. 3 What’s the deal? Newsfeeds are becoming a requirement for portal sites. Easy integration with existing web services is a key requirement? How can we avoid writing custom code for information providers? Can we avoid applets!!? Background In 1999 I wrote an information portal application. Live newsfeeds seemed like a good idea I wrote custom parsers and employed an open-source tool called Cocoon Every time the html changed, I had to recode!
  • 4. 4 Code Example Needed different ‘ParsSpec’for each content provider URLToXMLConsumer.java SpaceProducer.java These worked great for 2 months... ‘ParseSpec’ #HeadlineEntry cacheTime=6000 HeadlineEntry=start=n,end=<p>,attributes=Link,URL,Headline,Source,Date HeadlineEntry.Link=start=<a href=",end="> HeadlineEntry.Headline=start=">,end=</a> HeadlineEntry.Source=start=<font size="-1">,end=</font> #HeadlineEntry.Description=start=<br>,end=<br> HeadlineEntry.Date=start=- <i>,end=</i> HeadlineEntry.DTD="http://space.synctank.com/dtds/newsfeed.dtd " HeadlineEntry.Doctype=Newsfeed HeadlineEntry.URL=http://search.news.yahoo.com/search/news?p=space+aerospace&n= HeadlineEntry.QTY=10 HeadlineEntry.XML=version="1.0" HeadlineEntry.Header= <?xml-stylesheet href="http://space.synctank.com/xsl/spacenews.xsl" type="text/xsl"?>n <?cocoon-process type="xslt"?>n <!-- ============================================================ -->n <!-- spacenews.xml -->n <!-- Simple XML file that uses the Newsfeed DTD. -->n <!-- Author: XML Loader Russell Castagnaro Thu Nov 18 22:59:07 HST 1999 ->n <!-- ============================================================ -->n
  • 5. 5 Java Code URLToXMLProducer.xml and subclasses Nice Features All search providers content was converted to one XML document type Once the XML was created all search engines results were handled easily with XSLT
  • 6. 6 Document Type Definition <?xml version="1.0" encoding="US-ASCII" ?> <!-- Newsfeed.dtd --> <!-- Simple DTD that defines a grammar for news Feeds. --> <!-- Author: Russell Castagnaro Nov 15 1999 --> <!ELEMENT Newsfeed (HeadlineEntry)+> <!ELEMENT HeadlineEntry (Link, Headline, Source, Description, Date)> <!ELEMENT Link (#PCDATA)> <!ELEMENT Headline (#PCDATA)> <!ELEMENT Source (#PCDATA)> <!ELEMENT Description (#PCDATA)> <!ELEMENT Date (#PCDATA)> NewsFeed Content (XML) <?xml version="1.0"?> <?xml-stylesheet href="spacenews.xsl" type="text/xsl"?> <?cocoon-process type="xslt"?> <Newsfeed> <HeadlineEntry> <Link>http://dailynews.yahoo.com/h/ap/19991222/sc/space_shuttle_77.html</Link> <Headline>Shuttle Astronauts Begin <b>Space</b>walk</Headline> <Source>(Associated Press)</Source> <Date>Dec 22 6:08 PM EST</Date> </HeadlineEntry> <HeadlineEntry> <Link>http://biz.yahoo.com/rf/991222/xr.html</Link> <Headline>RESEARCH ALERT - Boeing raised to buy</Headline> <Source>(Reuters)</Source> <Date>Dec 22 12:03 PM EST</Date> </HeadlineEntry> </Newsfeed>
  • 7. 7 Transforming the Newsfeed Make the news feed human readable: ? Create a Stylesheet using the XML DOCTYPE rules ? Transform the XML Document Using the XSL Document * Specifics on transformations coming soon! The StyleSheet <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="no"/> <xsl:template match="/"> <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR><TD bgcolor="#3366CC" align="left" valign="middle"> <font face="helvetica, arial" size="2" color="#FFFFFF"> <nobr><b>News</b></nobr></font> </TD><TD align="right" bgcolor="#3366CC" valign="top" > <a href="/space/news/spacenews.xml"> <font face="helvetica, arial" size="1" color="#FFFFFF">View</font></a> <IMG SRC="/space/images/spacer2.gif" BORDER="0" WIDTH="5" HEIGHT="2"/> </TD></TR> <TR><TD> <font size="2" face="Arial, Helvetica, sans-serif"> <b>Space and Aerospace News</b></font><BR/> <xsl:apply-templates/> </TD></TR></TABLE> </xsl:template> <xsl:template match="HeadlineEntry"> <B><FONT face="helvetica, arial" size="1"> <A HREF="{Link}"><xsl:value-of select="Headline"/></A> </FONT></B> - <I> <FONT size="-2" face="Arial, Helvetica, sans-serif"> <xsl:value-of select="Source"/></FONT></I><BR/> </xsl:template> </xsl:stylesheet>
  • 8. 8 HTML Content Then the Display Format Changed Simple changes in the format from any site required significant changes Changing the parsing rules was not trivial Eventually this became boring and tiresome
  • 9. 9 Interesting Points I was not interested in manipulating XML documents within Java* I did not want to deal with DOM or SAX I was interested in displaying data in a clean, efficient manner The producer code I created was a bit embarrassing *I was not lazy. I had a very full schedule at the time… . Sheesh! Time Warp (Oct 2000) None of my parsing instructions still worked ? I had no interest in using the old code There had to be a better way I heard about O’reilly’s merkat project…
  • 10. 10 Enter RDF Site Summary Preliminary format was v .91 from Netscape (remember them?) Resource Definition Format Summary (RSS .91) http://my.netscape.com/publish/formats/rss-0.91.dtd Eliminates the need to parse through HTML for content. Standard - now WC3 has recommended version 1.0 RSS Example<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> <channel> <title> Space science news</title> <link>http://www.moreover.com</link> <description>Space science news - news headlines from around the web, refreshed every 15 minutes</description> <language>en-us</language> <image> <title>moreover...</title> <url>http://i.moreover.com/pics/rss.gif</url> <link>http://www.moreover.com</link> <width>144</width> <height>16</height> <description>News headlines from more than 1,800 sources, harvested every 15 minutes...</description> </image> <item> <title>NASA releases space station crew logs</title> <link>http://c.moreover.com/click/here.pl?r16768175</link> <description>floridatoday.com Mar 22 2001 12:20AM ET</description> </item> <item> <title>Tough love but support for space by George W. Bushs team</title> <link>http://c.moreover.com/click/here.pl?r16768185</link> <description>floridatoday.com Mar 22 2001 12:20AM ET</description> </item> </channel> </rss> C:developmentCastagnarospacespace-moreover.xml
  • 11. 11 RSS Stylesheet Example <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="rss"> <Foo bar="{version}"> <xsl:apply-templates/> </Foo> </xsl:template> <xsl:template match="channel"> <TABLE width="100%" cellpadding="0" cellspacing="0" border="0"> <TR> <TH align="left" bgcolor="#3366CC" valign="top" > <a alt="{description}" href="{link}"><font face="helvetica, arial" size="2" color="#FFFFFF"><nobr><xsl:value-of select="title"/></nobr></font></a></TH> </TR> <xsl:apply-templates select="image"/> <xsl:apply-templates select="item"/> </TABLE> </xsl:template> <xsl:template match="image"> <TR><TD align="right"><a href="{link}"> <IMG SRC="{url}" BORDER="0" WIDTH="{width}" HEIGHT="{height}"/></a></TD></TR> </xsl:template> <xsl:template match="item"> <TR><TD colspan="2"><B><FONT face="helvetica, arial" size="1"> <A HREF="{link}"><xsl:value-of select="title"/></A></FONT></B> - <I> <FONT size="-2" face="Arial, Helvetica, sans-serif"><xsl:value-of select="description"/></FONT></I></TD></TR> </xsl:template> </xsl:stylesheet> Newsfeed HTML
  • 12. 12 Access to RSS Feeds Where do you find providers??? Directory of open RSS providers: ? http://www.superopendirectory.com/directory/4/standards/rss/sources RSS Providers ? 10.am ? http://10.am/search/-rss?search=<your term here> ? List of topics: http://10.am/extra/ocsdirectory.xml ? echofactor ? http://www.echofactor.com/feed_categories.html?format=RSS ? MoreOver ? http://w.moreover.com/categories/category_list.html Now we need to make this content readable! Transforming XML to HTML We have many options on performing XSL Transformations: ? Depend on the client’s browser to transform the XML ? Write a Servlet to handle the transformation ? Use software that is widely available and standards based Issues: ? IE 5.x is one of the few browsers that support XSL transformations ? Publicly available software has many merits too ? Servlets are easy enough. Transformations can be done in < 10 lines
  • 13. 13 Transformation in a Servletpublic void service(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { PrintWriter out = res.getWriter(); res.setContentType("text/html"); File xmlFile = new File(sourcePath, req.getParameter("XML")); File xslFile = new File(sourcePath, req.getParameter("XSL")); try { XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); processor.process(new XSLTInputSource(new FileReader(xmlFile)), new XSLTInputSource(new FileReader(xslFile)), new XSLTResultTarget(out)); } catch (Exception e) { out.println("Error: " + e.getMessage()); } out.flush(); } One Problem We have to get the XML (RSS) file from the content provider! Use the networking classes to access the URL Be considerate of your provider!
  • 14. 14 New Codepublic void doGet(HttpServletRequest req, HttpServletResponse res) { try { PrintWriter out = res.getWriter(); res.setContentType("text/html"); URLConnection con; DataInputStream in; URL url = new URL(sourceURL); con = url.openConnection(); con.connect(); String type = null; in = new DataInputStream(con.getInputStream()); FileReader fr = new FileReader(xslsrc); try { XSLTProcessor processor = XSLTProcessorFactory.getProcessor(); processor.process(new XSLTInputSource(in), new XSLTInputSource(fr), new XSLTResultTarget(out)); } catch (Exception e) { log("Error: " + e.getMessage()); } finally { in.close(); fr.close(); } out.flush(); } catch (Exception e) { … } XSLT Model Request Response Servlet URL Loaded XML XSLT Processor XSL Document HTML NewsFeed
  • 15. 15 Setting up your servlet Most Appservers or Webservers support WAR’s and Deployment Descriptors You create a WebApp which has servlets, parameters and servlet mappings Deployment Descriptor <web-app> <servlet> <servlet-name>newsServlet</servlet-name> <servlet-class>com.synctank.http.servlets.RSSServlet</servlet-class> <init-param> <param-name>ERROR_URL</param-name> <param-value>/error.jsp</param-value> <description>The error page for this app.</description> </init-param> <init-param> <param-name>SOURCE_SERVLET_URI</param-name> <param-value>http://www.moreover.com/cgi- local/page?o=rss&c=Space%20science%20news</param-value> <description>An absolute url that points to your XML</description> </init-param>
  • 16. 16 Deployment Descriptor <init-param> <param-name>STYLESHEET</param-name> <param-value>/xsl/rss.xsl</param-value> <description>The Stylesheet for presentation of the headlines. Should be a subdirectory of the war. The default is /xsl/rss.xsl </description> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>newsServlet</servlet-name> <url-pattern>/newsy</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/foo/news.html</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page> </web-app> War directory structure Root ? WEB-INF ? Web.xml ? classes ? comsynctankhttpservletsRSSServlet.class ? xsl ? rss.xsl ? docs ? Index.html ? error.jsp
  • 17. 17 Moving Forward RSS version 1.0 has been recommended by the w3c 1.0 Uses has more flexibility Once more providers support Review Don’t do the time! Leverage RSS and open content providers Use XSL to transform XML content to your format of choice Cache requests to content providers (keep them free!)
  • 18. 18 Finally Thanks for attending Source Code Available ? http://www.synctank.com/xmldevcon ? russell@4charity.com Aloha