Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i am trying to create the following feed:
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<channel>
<title>The Springfield Shopper</title>
<link>http://example.com/</link>
<description>
Your daily source for local Springfield news, sports, and weather
</description>
<language>en-us</language>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
<item>
<title>Squirrel Resembling Abraham Lincoln Found</title>
<link>http://example.com/1992/01/09/squirrel-resembling-abraham-lincoln-found</link>
<guid>2fd4e1c67a2d28fced849ee1bb76e7391b93eb12</guid>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<dc:creator>Ralph Wiggum</dc:creator>
<georss:point>45.256 -71.92</georss:point>
<description><![CDATA[
A local Springfield man has restored pride to Springfield by finding a squirrel
that resembles Abraham Lincoln. Authorities are on the lookout for any rodents
bearing resemblance to John Wilkes Booth.
]]></description>
<content:encoded><![CDATA[
<p>Full content of the article <em>goes here</em>.</p>
]]></content:encoded>
<media:content url="http://media.example.com/1992/01/09/squirrel.jpg"
type="image/jpeg" medium="image" width="1200" height="900">
<media:description type="html"><![CDATA[
This squirrel bares a strong resemblance to <strong>Abraham Lincoln</strong>
]]></media:description>
<media:copyright>Carl Carlson</media:copyright>
</media:content>
<media:content url="http://media.example.com/1992/01/09/squirrel-lincoln.mp4"
type="video/mp4" media="video" width="1200" height="900" lang="en">
<media:description type="plain">
Kent Brockman interviews the squirrel on location
</media:description>
<media:copyright>Carl Carlson</media:copyright>
</media:content>
</item>
<item>
<title>Burns Pays City 3 Mil!</title>
<link>http://example.com/1993/01/14/burns-pays-city-3-mil</link>
<guid>de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3</guid>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<dc:creator>Todd Flanders</dc:creator>
<georss:point>45.256 -71.92</georss:point>
<description><![CDATA[
Wealthy resident Montgomery Burns was fined three million dollars after
being caught dumping nuclear waste in the Springfield city park.
]]></description>
<content:encoded><![CDATA[
<p>Full content of the article <em>goes here</em>.</p>
]]></content:encoded>
</item>
</channel>
</rss>
i have added xml header as this:
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
the closest i can get seems to be this (different data example than above):
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<channel>
<item>
<title><![CDATA[Europe Urged To Halt Work on ‘Dead End&#039; Ariane 6 Design]]></title>
<link><![CDATA[http://qa.spacenews.com/node/35546]]></link>
<pubDate><![CDATA[Thursday, May 30, 2013 - 07:01]]></pubDate>
<dc:creator><![CDATA[Brian Berger]]></dc:creator>
<description><![CDATA[PARIS — Europe’s Air & Space Academy says the French and European space agencies are moving in the wrong direction on the future Ariane 6 rocket and should delay development in favor of a]]></description>
</item>
<item>
<title><![CDATA[Sri Lanka Paying China Great Wall $215M To Build, Launch SupremeSAT-2]]></title>
<link><![CDATA[http://qa.spacenews.com/node/35545]]></link>
<pubDate><![CDATA[Thursday, May 30, 2013 - 06:38]]></pubDate>
<dc:creator><![CDATA[Brian Berger]]></dc:creator>
<description><![CDATA[PARIS — Sri Lanka’s new government-backed telecommunications satellite operator, SupremeSAT, on May 30 said it had signed a $215 million contract with China’s commercial satellite and rocket sales]]></description>
</item>
</channel>
the issues i seem to have are these:
- can enable CDATA to be wrapped around data elements; but then it wraps around all elements
- xml tag is added at the top
- no way to add root element content (i.e. the content that goes with channel)
- need to add closing RSS tag - there is a patch to this module to allow adding a footer which should work
have i gotten this as close as i should expect without writing code?
Comments
Comment #1
dgtlmoon CreditAttribution: dgtlmoon commenteddid you ever find a solution?
update -> try views_rss+views_schema
Comment #2
cloudbull CreditAttribution: cloudbull commentedsame question here
or it need try https://www.drupal.org/project/views_rss_media ?
Comment #3
anthonylindsay CreditAttribution: anthonylindsay at Annertech commentedI would say you've gotten as close as you're going to.
But I have to wonder why you can't use the RSS feed display that comes with Views? Views Datasource seems like a poor choice when Views does a good job all by itself, and as mentioned above, there are other RSS-specific extensions for Views that should better cater for the specifics you're looking for, e.g. views_rss.
Closing this.