9 messages in com.googlegroups.google-mashup-editorRe: Problem with extracting a few fie...| From | Sent On | Attachments |
|---|---|---|
| ben | 23 Jul 2007 03:01 | |
| Christian Muise | 23 Jul 2007 06:24 | |
| mark mclaren | 23 Jul 2007 10:40 | |
| Jason | 23 Jul 2007 14:50 | |
| ben | 23 Jul 2007 23:30 | |
| Jason | 24 Jul 2007 10:38 | |
| ben | 24 Jul 2007 21:19 | |
| Jason | 25 Jul 2007 13:26 | |
| ben | 25 Jul 2007 20:48 |
| Subject: | Re: Problem with extracting a few fields in xml file![]() |
|---|---|
| From: | mark mclaren (mark...@gmail.com) |
| Date: | 07/23/2007 10:40:06 AM |
| List: | com.googlegroups.google-mashup-editor |
Christian is absolutely correct to say that you should look at the feed in the "Feed Browser". In GME all imported RSS feeds are converted into Atom format and this is why you will not find updated or summary anywhere in the original feed. You need to reference the atom elements in GME (rather than the RSS equivalents). If you compare the original feed with the feed in the "Feed Browser" you will see that:
RSS 2.0 => Atom
description = > summary pubDate => published author => author/name
Therefore a template more like this should work:
<gm:template id="NYTItemTemplate"> <h1>NYT News Feeds</h1> <div style="margin-bottom:10px" repeat="true"> <h2 style="margin-bottom:0px"><gm:link ref="atom:link/@href" labelref="atom:title"/></h2> <p></p> <gm:textarea ref="atom:summary"/> <p></p> Posted by <b><i><gm:text ref="atom:author/atom:name"/></i></b> on <b><gm:date ref="atom:published"/></b> </div> </gm:template>
HTH
Mark
On Jul 23, 2:24 pm, "Christian Muise" <chri...@gmail.com> wrote:
Take a look at your feed in the "Feed Browser" tab of the mashups editor. I think it changes the input RSS feed into an atom feed that it can deal with...you can see that the <summary> and <updated> fields are actually there and probably those correspond to the <description> and <pubDate> of the original feed.
The author is still there though...don't know what that's not showing...
Hope this helps. Cheers.
Haz
PS. I'm pretty new to this so take any suggestions with a grain of salt ;)
On 7/23/07, ben <part...@gmail.com> wrote:
Hi:
I am using this feed from NYT
This has couple of fields labeled <author>, <description> and <pubDate>
I am using this code snipped (from the GME samples repo)
<gm:page title="New York Times News Feeds">
<gm:list id="feedDisplay" data="http://graphics8.nytimes.com/services/ xml/rss/nyt/HomePage.xml" template="NYTItemTemplate"/>
<gm:template id="NYTItemTemplate">
<h1>NYT News Feeds</h1>
<div style="margin-bottom:10px" repeat="true"> <h2 style="margin-bottom:0px"><gm:link ref="atom:link/@href" labelref="atom:title"/></h2> <p></p> <gm:textarea ref="atom:summary"/> <p></p> Posted by <b><i><gm:text ref="atom:author"/></i></b> on <b><gm:date ref="atom:updated"/></b> </div>
</gm:template>
</gm:page>
However, I am at loss to understand how to extract the <description>, <author> and <pubDate> tags. My first hunch was to use "atom:description", "atom:author" and "atom:pubDate" OR "description", "author" and "pubDate" field entries in the ref fields of the respective tags (<gm:link/>, <gm:text/> and <gm:date/>). However, none of these attempts work.
In fact, using field entries "atom:summary" and "atom:updated" entries in the respective fields actully generates results, even though there are no <updated/> or <summary/> tags anywhere in the entire xml file!!!
Any help would be appreciated!!!
Sincerely
Partho




