Bonjour,

Je veux lire la météo de ma ville http://xml.weather.yahoo.com/forecastrss?p=SZXX0035&u=c. Voici le fichier xml que je reçois :
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
 <channel>
 <title>Yahoo! Weather - Sion, SZ</title>
 <link>http://us.rd.yahoo.com/dailynews/rss/weather/Sion__SZ/*http://weather.yahoo.com/forecast/SZXX0035_c.html</link>
 <description>Yahoo! Weather for Sion, SZ</description>
 <language>en-us</language>
 <lastBuildDate>Sun, 14 Oct 2007 5:00 am CEST</lastBuildDate>
 
 <ttl>60</ttl>
 <yweather:location city="Sion" region="" country="SZ" />
 <yweather:units temperature="C" distance="km" pressure="mb" speed="kph" />
 <yweather:wind chill="6" direction="240" speed="2" />
 <yweather:atmosphere humidity="97" visibility="10" pressure="1024" rising="0" />
  <yweather:astronomy sunrise="7:47 am" sunset="6:45 pm" />
  <image>
 <title>Yahoo! Weather</title>
 
 <width>142</width>
 <height>18</height>
 <link>http://weather.yahoo.com/</link>
 <url>http://l.yimg.com/us.yimg.com/i/us/nws/th/main_142b.gif</url>
 </image>
 <item>
 <title>Conditions for Sion, SZ at 5:00 am CEST</title>
 
  <geo:lat>46.22</geo:lat>
 <geo:long>7.33</geo:long>
  <link>http://us.rd.yahoo.com/dailynews/rss/weather/Sion__SZ/*http://weather.yahoo.com/forecast/SZXX0035_c.html</link>
 <pubDate>Sun, 14 Oct 2007 5:00 am CEST</pubDate>
 <yweather:condition text="Fog" code="20" temp="6" date="Sun, 14 Oct 2007 5:00 am CEST" />
 <description><![CDATA[
<img src="http://l.yimg.com/us.yimg.com/i/us/we/52/20.gif" /><br />
 <b>Current Conditions:</b><br />
 Fog, 6 C<BR /><BR />
 <b>Forecast:</b><BR />
  Sun - Sunny. High: 20 Low: 8<br />
  Mon - Sunny. High: 18 Low: 7<br />
 <br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Sion__SZ/*http://weather.yahoo.com/forecast/SZXX0035_c.html">Full Forecast at Yahoo! Weather</a><BR/>
 (provided by The Weather Channel)<br/>
 ]]></description>
	<yweather:forecast day="Sun" date="14 Oct 2007" low="8" high="20" text="Sunny" code="32">a</yweather:forecast>
	<yweather:forecast day="Mon" date="15 Oct 2007" low="7" high="18" text="Sunny" code="32">b</yweather:forecast>
  <guid isPermaLink="false">SZXX0035_2007_10_14_5_0_CEST</guid>
 </item>
</channel>
</rss><!-- p2.weather.re3.yahoo.com compressed/chunked Sun Oct 14 22:54:56 PDT 2007 -->

Je veux récupérer les 2 balise <yweather:forecast> ET LIRE leurs attributs. J'ai essayé via DOM ou parse_xml. J'accède facilement aux attributs des balises <img> ou <a> du document mais pas moyen d'accèder aux attributs des balises contenant des ":" comme <yweather:location> ou <yweather:forecast>.

Je fais mes test sur un serveur apache 2.* avec php5.

D'avance merci pour vos réponses et si possible exemple concret :-)

Cordialement,
Greg