Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-07-2011, 05:25 PM   PM User | #1
rookiecoder
New Coder

 
Join Date: May 2009
Posts: 16
Thanks: 3
Thanked 0 Times in 0 Posts
rookiecoder is an unknown quantity at this point
Parsing RSS Feeds in Coldfusion 8

I am using Coldfusion 8, and having some trouble in parsing the RSS feed that needs to be displayed on my company's Intranet. The legacy code was iterating through items in XmlChildren, however it has hardcoded the type to the each position. And this is where the problem comes.

Code:
    <cfloop index="itms" from="1" to="#ArrayLen(XMLRoot.channel[1].XmlChildren)#">
    <cfset theItem = XMLRoot.channel[1].XmlChildren[itms]>
    <cfset tmp_item = theItem.XMLChildren>
    <!--- Retrieve the item data --->
    <cfset item_title = tmp_item[1].xmltext>
    <cfset item_link = tmp_item[2].xmltext>
    <cfset item_description = tmp_item[3].xmltext>
    <cfset item_date = parseDateTime(Replace(tmp_item[4].xmlText, ' GMT', ''))>
The last line is where I am getting the error. The exact error being

Code:
StackTracecoldfusion.runtime.locale.CFLocaleBase$InvalidDateTimeException: <p><img alt="irish-flag-640" src="http://www.hellenicshippingnews.com/images/stories/flags/irish-flag-640.jpg" width="120" height="100" />Ireland has received a first tranche of 3.6 billion euros ($4.9 billion) from the euro zone rescue fund, slightly more than the initial amount agreed, a fund source told Reuters on Sunday.</p> is an invalid date or time string.

Now, the exact page from which I am trying to extract the content is
http://www.hellenicshippingnews.com/...news&Itemid=97


I am quite new to this entire programming, so if you can pinpoint the changes needed then that would be really great.

Incase it helps, the RSS feed is http://www.hellenicshippingnews.com/...=feed&type=rss
rookiecoder is offline   Reply With Quote
Reply

Bookmarks

Tags
coldfusion, rss, xml

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:45 AM.


Advertisement
Log in to turn off these ads.