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
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 -----
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 -----