title: URL: XML parsing error : not well formed
body: <p>I have this error:</p>
  
  <pre><code>XML parsing error : not well formed
  Location : http://127.0.0.1/localwebsite/map-control-event-type-criteria.php?=&amp;eP=chose&amp;tP=pub_beer&amp;aP[0]=eating&amp;aT=washington
  Number of line 1, Column 2 :
  </code></pre>
  
  <p>The source code seems to be correct: I get this:</p>
  
  <pre><code>    &lt;?xml version="1.0"?&gt;
      &lt;markers&gt;&lt;marker name="the name" address="the adress" lat="46.187424" lng="8.717437" id="1" town="washington"/&gt;&lt;/markers&gt;
  </code></pre>
  
  <p>The php code of the page looks like this:</p>
  
  <pre><code>    &lt;?php
      require 'inc/bootstrap.php';
      require_once 'inc/db.php';
  
      $db = app::getdatabase();
  
      $evtpar=$_GET['eP'];
      $typepar=$_GET['tP'];
      $critpar=$_GET['aP']; 
      $townURL=$_GET['aT'];
  
      // some php code to test the validity of URL parameters
  
      $dom = new DOMDocument("1.0");
      $node = $dom-&gt;createElement("markers");
      $parnode = $dom-&gt;appendChild($node); 
  
  
      $result=$db-&gt;query("SELECT name.....)-&gt;fetchall(); 
  
      header("Content-type: text/xml");
      $i=0;
      foreach ($result as $row)
      {
         $node = $dom-&gt;createElement("marker");
         $newnode = $parnode-&gt;appendChild($node);
         $newnode-&gt;setAttribute("name", $row-&gt;name);
         $newnode-&gt;setAttribute("address", $row-&gt;address);
         $newnode-&gt;setAttribute("lat", $row-&gt;lat);
         $newnode-&gt;setAttribute("lng", $row-&gt;lng);
         $newnode-&gt;setAttribute("id", $row-&gt;inf_id);
         $newnode-&gt;setAttribute("town", $row-&gt;town);
  
         $i++;
      }   
  
       echo $dom-&gt;saveXML();
  </code></pre>
  
  <p>How can i know where the problem comes from? </p>
  
  <p>Does <strong>Number of line 1</strong> means that the problem comes from the URL or the following code?</p>
  
  <p><strong>EDIT : Files before the code above:</strong></p>
  
  <p>Before arriving to the URL I have to previous code: </p>
  
  <pre><code>    File1 php:
      $mapDisplay='EventCritType';
  
      File2 included in File1:
  
      &lt;?php if($mapDisplay=='EventCritType'): 
      echo     $Map-&gt;mapeventcrittypeview($town,$eventparam,$typeparam,$activityparams,$lat,$lng,13); 
      endif; ?&gt;
  
      file3 = Map Class:
  
      public function mapeventcrittypeview($town,$eventparam,$typeparam,$activityparams,$lat,$lng,$zoom)
      {
  
          $evtparam=http_build_query(array('eP'=&gt;$eventparam));
          $tpparam=http_build_query(array('tP'=&gt;$typeparam));
          $actparam=http_build_query(array('aP'=&gt;$activityparams));
          $city=http_build_query(array('aT'=&gt;$town));
  
          $url="/localwebsite/map-control-event-type-criteria.php?=&amp;$evtparam&amp;$tpparam&amp;$actparam&amp;$city";
  
          include('inc/map-script.php');
  
      }
  
      File4= map-script.php
  
      script type="text/javascript"&gt;
  
      var infoWindow = new google.maps.InfoWindow;
  
      function load() {
        var map = new google.maps.Map(
          document.getElementById("map"), {
            center: new google.maps.LatLng(&lt;?= json_encode($lat); ?&gt;, &lt;?= json_encode($lng);?&gt;),
            zoom: &lt;?php echo json_encode($zoom); ?&gt;,
            mapTypeId: 'roadmap'
          });
  
        downloadUrl(&lt;?= json_encode($url); ?&gt;, function(data) {
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i &lt; markers.length; i++) {
          var name = markers[i].getAttribute("name");
          var address = markers[i].getAttribute("address");
          var id = markers[i].getAttribute("id");
          var town = markers[i].getAttribute("town").toLowerCase();
          var point = new google.maps.LatLng(
          parseFloat(markers[i].getAttribute("lat")),
          parseFloat(markers[i].getAttribute("lng")));
          var html = "&lt;b&gt;" + name + "&lt;/b&gt; &lt;br/&gt;" + address;
          createMarker(point, id, town, html, i, map);
  
        }
        });
      }
  
      ....
  
      &lt;/script&gt;
  
      File5= map-control-event-type-criteria.php
  
      &lt;?php
      require 'inc/bootstrap.php';
      require_once 'inc/db.php';
  
      $db = app::getdatabase();
      $evtpar=$_GET['eP'];
      $critpar=$_GET['aP']; 
      $townURL=$_GET['aT'];
  
      ....
  </code></pre>