title: getElementsByTagName not working javascript, XML, google maps
body: <p>I cant get the data from the xml file using getElementsByTagName. What should I be using?</p>
  
  <p>here is the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;markers&gt;
      &lt;marker&gt;
          &lt;lat&gt;37.427770&lt;/lat&gt; 
          &lt;lng&gt;-122.144841&lt;/lng&gt;
          &lt;name&gt;Jackie&lt;/name&gt;
      &lt;/marker&gt;
      &lt;marker&gt;
          &lt;lat&gt;37.413320&lt;/lat&gt; 
          &lt;lng&gt;-122.125604&lt;/lng&gt;
          &lt;name&gt;Peter&lt;/name&gt;
      &lt;/marker&gt;
  &lt;/markers&gt;
  </code></pre>
  
  <p>Whole HTML file:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"/&gt;
  &lt;title&gt;Google Maps JavaScript API v3 Example: Common Loader&lt;/title&gt;
  &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;
    &lt;/script&gt;
   &lt;script type="text/javascript" src="util.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  var infowindow;
  var map;
  
  function initialize() {
  var myLatlng = new google.maps.LatLng(37.4419, -122.1419);
  var myOptions = {
    zoom: 13,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  downloadUrl("moredata.xml", function(data) {
    var markers = data.documentElement.getElementsByTagName("marker");
    for (var i = 0; i &lt; markers.length; i++) {
      var latlng = new 
  google.maps.LatLng(parseFloat(markers[i].getElementsByTagName("lat")),
                                  parseFloat(markers[i].getElementsByTagName("lng")));
      var marker = createMarker(markers[i].getElementsByTagName("name"), latlng);
     }
   });
  }
  
   function createMarker(name, latlng) {
   var marker = new google.maps.Marker({position: latlng, map: map});
   google.maps.event.addListener(marker, "click", function() {
    if (infowindow) infowindow.close();
    infowindow = new google.maps.InfoWindow({content: name});
    infowindow.open(map, marker);
  });
  return marker;
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="initialize()"&gt;
  &lt;div id="map_canvas" style="width:400px; height:300px"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The file is an edited version of <a href="http://gmaps-samples-v3.googlecode.com/svn/trunk/xmlparsing/downloadurl_info.html" rel="nofollow">http://gmaps-samples-v3.googlecode.com/svn/trunk/xmlparsing/downloadurl_info.html</a></p>
  
  <p>Im trying to get the data without using attributes </p>