'giorno...
sto tentando di leggere un file xml:
http://xml.weather.yahoo.com/forecastrss?p=ITXX0113&u=c
in particolare, avrei bisogno di ottenere i valori di
<yweather:condition text="Partly Cloudy" code="30" temp="30" date="Mon, 04 Aug 2008 4:50 pm CEST" />
<yweather:forecast day="Mon" date="4 Aug 2008" low="21" high="31" text="Mostly Clear" code="33" />
<yweather:forecast day="Tue" date="5 Aug 2008" low="22" high="31" text="Mostly Sunny" code="34" />
tutto il resto non mi interessa
ho provato con simplexml, ma sembra che mi estrapoli solo una parte dell'xml.. e nemmeno quella che mi interessa:
vorrei evitare espressioni regolari et similia, mi piacerebbe prendere le stringhe utilizzando un parser xml... come posso fare?codice:SimpleXMLElement Object ( [@attributes] => Array ( [version] => 2.0 ) [channel] => SimpleXMLElement Object ( [title] => Yahoo! Weather - Cuneo, IT [link] => http://us.rd.yahoo.com/dailynews/rss...TXX0113_c.html [description] => Yahoo! Weather for Cuneo, IT [language] => en-us [lastBuildDate] => Mon, 04 Aug 2008 4:50 pm CEST [ttl] => 60 [image] => SimpleXMLElement Object ( [title] => Yahoo! Weather [width] => 142 [height] => 18 [link] => http://weather.yahoo.com [url] => http://l.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif ) [item] => SimpleXMLElement Object ( [title] => Conditions for Cuneo, IT at 4:50 pm CEST [link] => http://us.rd.yahoo.com/dailynews/rss...TXX0113_c.html [pubDate] => Mon, 04 Aug 2008 4:50 pm CEST [description] => SimpleXMLElement Object ( ) [guid] => ITXX0113_2008_08_04_16_50_CEST ) ) )
![]()