On Thu, Feb 25, 2010 at 10:13:09AM -0500, [email protected] wrote:
> Does anyone know why the line(s) below would return 'null' or null?
> 
> xmlDoc.getElementsByTagName("description")[0].childNodes[0].nodeValue;

... Without your KML file? How could we know?

-- Chris

> Thanks!
> 
> ///////////////////////PARSING OUT KML 
> INFORMATION//////////////////////////////////////
> 
>                 OpenLayers.loadURL(kmlLayer.url, '', this, setKML);
> 
> /////////////////////////////////////////////////////////////////////////////////////////////
> 
> function setKML(response) {
>     if (response.responseText.indexOf('no results') == -1) {
>         alert(response.responseText);
>         var xmlDoc = response.responseXML.documentElement;
>         //var xmlDoc = response.responseText;
> 
>      var name =
>        xmlDoc.getElementsByTagName("name")[0].childNodes[0].nodeValue;
>      alert(name);
> 
>      var description =
>        xmlDoc.getElementsByTagName("description")[0].childNodes[0].nodeValue;
>      alert(description);
> 
>      var coordinates =
>        xmlDoc.getElementsByTagName("coordinates")[0].childNodes[0].nodeValue;
>      alert(coordinates);
> 
>      var content = '<table border="1" cellpadding="1" cellspacing="1">';
>      content += 
> '<tr><th>Name</th><th>Description</th><th>Coordinates</th></tr>';
>      content += 
> '<tr><td>'+name+'</td><td>'+description+'</td><td>'+coordinates+'</td></tr>';
>      content += '</table>';
> 
>      document.getElementById('content').innerHTML = content;
> 
>    }
> }
> 
> 

> _______________________________________________
> Users mailing list
> [email protected]
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to