voila mon code XML:
Code XML :
<description><![CDATA[
<img src="http://l.yimg.com/a/i/us/we/52/33.gif"/><br />
<b>Current Conditions:</b><br />
Fair, 54 F<BR />
<BR /><b>Forecast:</b><BR />
Tue - Mostly Sunny. High: 78 Low: 51<br />
Wed - Partly Cloudy. High: 83 Low: 57<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Lincoln__NE/*http://weather.yahoo.com/forecast/USNE0283_f.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]>
</description>
je veux lire le contenu de balise img.src or puisque cette balise ce trouve dans une commentaire (traiter comme un text)et ce fichier xml est inchengeable alors j'était bloqué :S .. bon
j'ai essayé ce code mais il na pas fonctionner
Code Javascript :
var valeurdunoeud = xml.documentElement.getElementsByTagName('description')[1].firstChild.nodeValue;
var divTmp = document.createElement('div');
divTmp.innerHTML = valeurdunoeud;
var src = divTmp.getElementsByTagName('img')[0].src;