House of Fusion
Home of the ColdFusion Community

Search cf-talk

October 07, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Problem with using xml from RSS

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phill B
05/09/2008 10:57 AM

I am trying to use the Yahoo Weather RSS feed but CF doesn't like the node <yweather:condition>. How do I get around this? RSS Link http://tinyurl.com/6pvxmk RSS Weather docs http://tinyurl.com/kon6q Thanks -- Phil

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
05/09/2008 12:32 PM

You can use XmlSearch and XPath to easily get at the data you want. The following gets a forecast for the current day from the xml: <cfset weatherXml = XmlParse('http://weather.yahooapis.com/forecastrss?p=90210')>; <cfset aForecasts = XmlSearch(oXml, '//yweather:forecast[@date="#DateFormat(Now(),'d mmm yyyy')#"]')> <cfdump var="#aForecasts#"> This search gets you an array of all the elements with the yweather prefix: <cfset weatherXml = XmlParse('http://weather.yahooapis.com/forecastrss?p=90210')>; <cfset aForecasts = XmlSearch(weatherXml, '//yweather:*')> <cfdump var="#aForecasts#"> etc, HTH Dominic 2008/5/9 Phill B <philthylabwrk@gmail.com>: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phill B
05/09/2008 01:25 PM

Thanks Dominic. That was just what I needed! On Fri, May 9, 2008 at 11:31 AM, Dominic Watson < watson.dominic@googlemail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists