[OpenLayers-Users] OpenLayers broken under XHTML 1.0?

Jeff Dege jdege at korterra.com
Tue Aug 8 11:22:50 CDT 2006


I've been playing around with OpenLayers, trying to determine if it will
serve for a project we've been given.

In doing this, I've tried running things in a number of different ways.
My latest trial involved trying to build the page with Microsoft Visual
Studio 2005.  And it doesn't work.

It's not that IIS can't serve the page, or that MS's ASP Development
Server can't serve the page.  When I copy one of my earlier .html test
pages into the directory, I can access it just fine.  But the .aspx page
I've just created doesn't draw the map - the div stays blank.

By successively replacing parts of the .html page with the .aspx page, I
determined that the problem is the DOCTYPE declaration.

VS 2005 creates page templates that include the following doctype
declaration:

   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

With this declaration, the map doesn't draw.

In separate tests, I removed the declaration, and I replaced it with an
earlier one:

   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

With no declaration, or with the older declaration, the map draws just
fine.

So I went back and rang the changes, tried serving the page with IIS,
with MS's ASP Development Server, and with Apache.  And tried viewing
the page with IE, and with Firefox, and the results were consistent
regardless of combination - the OpenLayers map image remains blank if
the DOCTYPE is declared as XHTML 1.0.





More information about the Users mailing list