Take a look at http://kart.uit.no/ and http://kart.uit.no/uit_markers.php

There are some problems rendering the html. It comes out as plain
text, not html...

I wonder if there is a problem with the xml?

This is the code from the php that generates the xml:

<?php
require("uit_connect.php");

function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','&lt;',$htmlStr);
$xmlStr=str_replace('>','&gt;',$xmlStr);
$xmlStr=str_replace('"','&quot;',$xmlStr);
$xmlStr=str_replace("'",'&#39;',$xmlStr);
$xmlStr=str_replace('&','&amp;',$xmlStr);
$xmlStr=str_replace('æ','&aelig;',$xmlStr);
$xmlStr=str_replace('ø','&oslash;',$xmlStr);
$xmlStr=str_replace('å','&aring;',$xmlStr);

return $xmlStr;
}

// Opens a connection to a MySQL server
$connection=mysql_connect ($host, $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
// Start XML file, echo parent node
echo '<markers>';

// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  echo '<marker ';
  echo 'lat="' . $row['lat'] . '" ';
  echo 'lng="' . $row['lng'] . '" ';
  echo 'content="' . parseToXML($row['content']) . '" ';
  echo 'label="' . parseToXML($row['label']) . '" ';
  echo 'tittel="' . parseToXML($row['tittel']) . '" ';
  echo 'img="' . parseToXML($row['img']) . '" ';
  echo 'adresse="' . parseToXML($row['adresse']) . '" ';
  echo '/>';
}

// End XML file
echo '</markers>';

?>

Any idea what I am doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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.

Reply via email to