HI,
ive been working on some google maps work. Its taken a while to get it
to this point as i will explain. This is my adapted code from the
tutorial so far, very similar to Googles working with PHP mysql and
google maps:
Line number On/Off | Expand/Contract | Select all
<?php
Require 'connect.php';
// Start XML file, create parent node
$doc = new DOMDocument('1.0');
$node = $doc->createElement('markers');
$parnode = $doc->appendChild($node);
// Select all rows in markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
die ('Invalid query: ' . mysql_error());
}
header('Content-type: text/xml');
// Iterate through the rows, addind xml nodes for each
while ($row = mysql_fetch_assoc($result)) {
// Add to XML document node
$node = $doc->createElement('marker');
$newnode = $parnode->appendChild($node);
$newnode->setAttribute ('name', $row['name']);
$newnode->setAttribute ('address', $row['address']);
$newnode->setAttribute ('lat', $row['lat']);
$newnode->setAttribute ('lng', $row['lng']);
$newnode->setAttribute ('type', $row['type']);
}
$xmlfile = $doc->dump_mem(true);
echo $xmlfile;
?>
My page was failing at line one because on the Google doumentation
they had
Line number On/Off | Expand/Contract | Select all
'create_element'
Line number On/Off | Expand/Contract | Select all
'append_child'
&
Line number On/Off | Expand/Contract | Select all
'set_attribute'
I was getting a fatal error message. After reading around I found
that
Line number On/Off | Expand/Contract | Select all
$doc = domxml_new_doc('1.0');
should be
Line number On/Off | Expand/Contract | Select all
$doc = new DOMDocument('1.0');
, looking on php.net I also changed the above mentioned nodes to
Line number On/Off | Expand/Contract | Select all
'createElement'
etc. So i changed this through out the code. I hoped it would work,
but now i am getting this error:
<b>Call to undefined method DOMDocument::dump_mem() </b>
So I again had a look at php.net but i cant see why this isn't working
however i did notice that they use
Line number On/Off | Expand/Contract | Select all
create_element
but on the createElement page they use it like this
Line number On/Off | Expand/Contract | Select all
<?php
$dom = new DOMDocument('1.0', 'utf-8');
$element = $dom->createElement('test', 'This is the root element!');
// We insert the new element as root (child of the document)
$dom->appendChild($element);
echo $dom->saveXML();
?>
would anyone know what the problem is? my local host runs PHP/5.3.1
mod_apreq2-20090110 and the DOM: DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.6
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
Thanks if anyone can help 
Thanks to anyone who helps me out!
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.