I'm trying to place markers on a google map based on values filed in a mysql db. When loading the xml dynamically using PHP, no markers get placed on the map due to the responseXML.DocumentElement property not getting valued. It works when I load the XML from a static file, just not when dynamically loading from a db.
Here is the page that doesn't work: http://www.thirstygolfer.com/utils/maptest2.html
Here is the page that works: http://www.thirstygolfer.com/utils/maptest1.html
This is the PHP file generating the xml: www.thirstygolfer.com/utils/xmldump3.php
Here is the PHP code from thirstygolfer.com/utils/xmldump3.php (minus the db connection info):
<?php
$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
$result=mysql_query("SELECT * FROM Main WHERE State='MA' and FirstLetter='A'");
header("Content-type: text/xml");
while ($row = mysql_fetch_assoc($result)){
$node = $dom->createElement("marker");
$newnode = $parnode->appendChild($node);
$newnode->setAttribute("id",$row['id']);
$newnode->setAttribute("lat", $row['Lat']);
$newnode->setAttribute("lng", $row['Lon']);
}
echo $dom->saveXML();
?>
Please help!!