[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Merging multiple RSS feeds into one RSS feed

Subject: Re: Merging multiple RSS feeds into one RSS feed
From: Nic <nferrier@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Apr 2006 20:34:07 +0100
rss multiple channels
Robert Fidler <robert.fidler@xxxxxxxxxx> writes:

> Does any one know how I can merge multiple RSS feeds into one feed? I 
> have this code, but when I view the feed.xml in IE, it does not have any 
> of the XML formating in it, just plain text output all strong out. And 
> RSSOwl does not even read it.
>
> feed.xml:
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="merge-rss.xsl"?>
> <feeds>
>     <link href="http://digg.com/rss/index.xml"/>
>     <link href="http://www.osnews.com/files/recent.xml"/>
> </feeds>
>
> merge-rss.xsl:
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>     <xsl:output  method="xml" version="1.0" encoding="UTF-8" 
> indent="yes" omit-xml-declaration="no" media-type="text/xml" />
>     <xsl:template match="/">
>         <rss version="2.0">
>             <channel>
>                 <title>My Title</title>
>                 <description>My Description</description>
>                 <language>en-us</language>
>                 <link>http://mysite/rss</link>
>                 <xsl:for-each select="feeds/link/@href">
>                     <xsl:copy-of select="document(.)/rss/channel/item"/>
>                 </xsl:for-each>
>             </channel>
>         </rss>
>     </xsl:template>
> </xsl:stylesheet>


Something like:

  <xsl:for-each select="feeds/link">
    <xsl:variable name="source" select="document(@href)"/>
    <xsl:copy-of select="$source//item"/>
  </xsl:for-each>

Works for me.

Note that this is essentially what http://www.thefeedstar.net
does. This is my RSS/ATOM aggregator. It's simple but not as simple as
a single sylesheet; you can see it at:

   http://www.thefeedstar.net

you do have to register for it first.


Nic Ferrier

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.