MartyConnelly
martyconnelly at shaw.ca
Fri Dec 10 22:07:03 CST 2004
You could try code like this in asp or in access
Sub test()
Dim srcTree As Object
Dim xsltTree As Object
Set srcTree = CreateObject("Msxml2.DOMDocument.4.0")
srcTree.async = False
srcTree.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/technology/rss091.xml")
Set xsltTree = CreateObject("Msxml2.DOMDOCUMENT.4.0")
xsltTree.async = False
xsltTree.Load ("http://www5.brinkster.com/mconnelly/newsfeed.xsl")
Debug.Print srcTree.transformNode(xsltTree)
End Sub
The newsfeed.xsl file to transform the rss xml to an html table
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="iso-8859-1"
omit-xml-declaration="yes" indent="yes" />
<xsl:template match="*">
<table border="1" width="600" align="center">
<tr>
<td valign="top" align="center" class="title" bgcolor="silver">
<a>
<xsl:attribute name="href">
<xsl:value-of
select="*[local-name()='channel']/*[local-name()='link']" />
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of
select="*[local-name()='channel']/*[local-name()='title']"
disable-output-escaping="yes" />
</a>
<xsl:text disable-output-escaping="yes">
</xsl:text>
<xsl:value-of
select="*[local-name()='channel']/*[local-name()='lastBuildDate']" />
</td>
</tr>
<tr>
<td valign="top" bgcolor="ghostwhite" class="headlines">
<ul>
<xsl:for-each select="//*[local-name()='item']">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']" />
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']"
disable-output-escaping="yes" />
</a>
<xsl:text disable-output-escaping="yes"></xsl:text>
<xsl:value-of select="*[local-name()='description']"
disable-output-escaping="yes" />
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
Mitsules, Mark wrote:
>OK...I used an online RSS URL generator to come up with this:
>
>http://news.search.yahoo.com/news/rss?p=Submarine
>
>Using Firefox with the Sage extension (RSS Viewer), I end up with a nicely
>formatted HTML page. I know I can do a manual cut-n-paste straight from
>that HTML into my page, but I'm trying to take this XML suggestion to heart.
>Given the result from above, what is the next step? One thing I see already
>is that Yahoo! takes the original story URL and reformats it through them.
>While we're going through this process, is it possible to strip all that
>stuff out? Basically I want to take this (watch for wrap):
>
>- <item>
>- <title>
>- <![CDATA[ Submarine returning to Connecticut (WFSB 3)
> ]]>
> </title>
>
><link>http://us.rd.yahoo.com/dailynews/rss/search/Submarine/SIG=11vpdtklm/*h
>ttp%3A//www.wfsb.com/Global/story.asp?S=2675298&nav=1VGmU3Gv</link>
> <guid
>isPermaLink="false">http://us.rd.yahoo.com/dailynews/rss/search/Submarine/SI
>G=11vpdtklm/*http%3A//www.wfsb.com/Global/story.asp?S=2675298&nav=1VGmU3Gv</
>guid>
> <pubDate>Fri, 10 Dec 2004 12:48:31 GMT</pubDate>
>- <description>
>- <![CDATA[ NEW LONDON -- The USS A lexandria is returning home to
>Connecticut Friday. The attack sub will be coming into New London Harbor to
>the submarine base at 12:30 p.m.
> ]]>
> </description>
> </item>
>
>
>
>...and turn it into this (watch for wrap):
>
>
><div class="item">
> <h2 class="item-title">
> <a
>href="http://www.wfsb.com/Global/story.asp?S=2675298&nav=1VGmU3Gv">
> Submarine returning to Connecticut (WFSB 3)
> </a>
> </h2>
> <div class="item-desc">
> NEW LONDON -- The USS A lexandria is returning home to
> Connecticut Friday. The attack sub will be coming into
> New London Harbor to the submarine base at 12:30 p.m.
> </div>
> <div class="item-pubDate">
> Fri, Dec 10, 2004 7:48
> </div>
></div>
>
>
>I'd love to hear from anyone who has done this.
>
>
>Mark
>
>
>-----Original Message-----
>From: Haslett, Andrew [mailto:andrew.haslett at ilc.gov.au]
>Sent: Wednesday, December 08, 2004 8:13 PM
>To: Discussion of Hardware and Software issues
>Subject: RE: [dba-Tech] Google Alerts
>
>
>Mark
>
>This is exactly what RSS was designed for.. An easy to consume, format and
>display - live feed of information. If you vist all the news sites on the
>net, you'll see they offer RSS Feeds. You just need something to consume
>it.
>
>What sort of system is your Intranet using? What coding language ? Any CMS?
>Most these days will have some sort of module that can consume an RSS feed.
>If not, they're not overly difficult to implement yourself.
>
>If you do this 'server-side', ie in the intranet back-end code subscribes to
>the RSS feed, then everyone who views your intranet page will see it, and
>you won't have to worry about every workstation implementing some type of
>RSS Reader.
>
>Cheers,
>Andrew
>_______________________________________________
>dba-Tech mailing list
>dba-Tech at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/dba-tech
>Website: http://www.databaseadvisors.com
>
>
>
--
Marty Connelly
Victoria, B.C.
Canada