Ver Mensaje Individual
  #6 (permalink)  
Antiguo 31/07/2013, 08:28
taoshi
 
Fecha de Ingreso: julio-2009
Mensajes: 117
Antigüedad: 14 años, 9 meses
Puntos: 0
Respuesta: Recorrer xml de gran tamaño

Responsexml funciona muy bien en todos los navegadores, pero ahora el inconveniente es el siguiente, los archivos que tengo que leer son de extensión .GPX

Los cuales parece ser que no lee, hay alguna forma de hacer que response xml lea archivos de dicha extensión?

Este es el código que utilizo.
Código:
<script>
function loadXMLDoc()
{
var xmlhttp;
var txt,x,i,j;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    xmlDoc=xmlhttp.responseXML;
    txt="";
    x=xmlDoc.getElementsByTagName("trkpt");
	document.getElementById("coordenadas").value=x.length;
    for (i=0;i<x.length;i++)
      {
      txt=txt + x[i].getAttribute('lat') + "<br>";
	  txt=txt + x[i].getAttribute('lon') + "<br>";
      }
    document.getElementById("myDiv").innerHTML=txt;
    }
  }
xmlhttp.open("GET","rutasprueba/course.gpx",true);
xmlhttp.send();
}
</script>
Gracias.