I'm having a problem and it's similar to this question :
Can't get element javascript google apps script
Well , i'm parsing an xml file with the DOM
method.I didn't have any problem until i push in my xml the element <link>
. When i put a randomized link i have no problem.But if i insert one of my real links of my xml file something goes wrong.
Ι collocate you one of the real links : <link>http://www.metar.gr/index.php?option=com_jumi&fileid=12&Itemid=73&station=1483</link>
.
Any ideas what is going wrong?
Here's is my code :
downloadUrl("moredata.xml", function(data) {
var items = data.documentElement.getElementsByTagName("item");
for (var i = 0; i < items.length; i++) {
var description = items[i].getElementsByTagName("description")[0].innerHTML;
var temp = items[i].getElementsByTagName("temp")[0].innerHTML;
var title = items[i].getElementsByTagName("title")[0].innerHTML;
var windSpeed = items[i].getElementsByTagName("windSpeed")[0].innerHTML;
var dailyRain = items[i].getElementsByTagName("dailyRain")[0].innerHTML;
var latlng = new google.maps.LatLng(parseFloat(items[i].getElementsByTagName("glat")[0].innerHTML),
parseFloat(items[i].getElementsByTagName("glon")[0].innerHTML));
}
})
and the moredata.xml
file :
<item>
<description>Giannena</description>
<glat>39.62209843837158</glat>
<glon>20.89027225971222</glon>
<title>ipiros</title>
<temp>-16.9°C</temp>
<dailyRain>0.0 mm</dailyRain>
<windSpeed>10 km/hr</windSpeed>
<fire>2</fire>
<outsideHumidity>88 %</outsideHumidity>
<link>
http://this_is_the_link.com
</link>
</item>
<item>
<description>Athina</description>
<glat>38.08469095792561</glat>
<glon>23.680233657360077</glon>
<title>sterea</title>
<temp>45°C</temp>
<dailyRain>0.0 mm</dailyRain>
<windSpeed>97 km/hr</windSpeed>
<fire>3</fire>
<outsideHumidity>99 %</outsideHumidity>
<link>
http://this_is_the_other_link.com
</link>
</item>