XHTML validation problem with vml namespace

G

Greg N.

I'm incorporating GoogleMaps in one of my pages
http://hothaus.de/greg-tour-2006/route.htm
This requires XHTML to work properly on IE. Also, it requires an <html>
tag like this:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">

I'm not quite sure about the syntax of this, but I have copied this from
Google's boilerplate code. Anyway, it's required, and the page works.
That HTML tag does not validate, though. The error message says:

"Error Line 4 column 51: there is no attribute "xmlns:v"."

Can I do anything about it? Should I ignore it?
 
C

cwdjrxyz

I'm incorporating GoogleMaps in one of my pageshttp://hothaus.de/greg-tour-2006/route.htm
This requires XHTML to work properly on IE. Also, it requires an <html>
tag like this:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">

Your page is being served as text/html and not with the correct mime
type for xhtml which is application/xhtml+xml or application/xml. If
you had served the page properly as xhtml, it could not be viewed by
any IE browser, including IE6 and IE7. IE does not support correctly
served xhtml, period. If you do not serve proper xhtml, then you would
be better off serving html 4.01, since use of xhtml code for a page
that is just served as text/html serves no useful purpose.
,
 
G

Greg N.

cwdjrxyz said:
... you would be better off
serving html 4.01, since use of xhtml code for a page
that is just served as text/html serves no useful purpose.

I've heard that argument frequently, but my tests suggest this is the
only way to make Google Maps work on IE. Whether you consider that a
useful purpose is up to your taste :)

Thanks anyway. I conclude there is no other way (right?), and I have to
live with that validation error.
 
D

dorayme

"Greg N. said:
I'm incorporating GoogleMaps in one of my pages
http://hothaus.de/greg-tour-2006/route.htm

The dynamic map works well in Safari but not in FF on Mac. In
iCab there is not even the static jpg, and iCab mentions:

JavaScript Error:"load": Invalid reference
(function/object/variable not defined?)
http://hothaus.de/greg-tour-2006/route2006.js
JavaScript Error:"ï": Invalid character

I don't know if any of this is useful to you?

I like the use you make of the map and if I could be convinced of
its cross browser solidity, I would be greatly interested in
doing similar for one or two sites under my control. Not at all
keen on using anything but 4.01 so your remarks re xhtml being
needed in this case are a bit of a worry.
 
B

BootNic

Greg N. said:
[email protected]
I'm incorporating GoogleMaps in one of my pages
http://hothaus.de/greg-tour-2006/route.htm
This requires XHTML to work properly on IE. Also, it requires an
<html> tag like this:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">

I'm not quite sure about the syntax of this, but I have copied this
from Google's boilerplate code. Anyway, it's required, and the page
works. That HTML tag does not validate, though. The error message
says:

"Error Line 4 column 51: there is no attribute "xmlns:v"."

Can I do anything about it? Should I ignore it?

Conditional comments may pacify a validity check.

<!--[if IE]>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v=
"urn:schemas-microsoft-com:vml">
<![endif]-->
<!--[if !IE]> <-->
<html xmlns="http://www.w3.org/1999/xhtml">
<!--> <![endif]-->
 
D

dorayme

A

Andy Dingley

I'm incorporating GoogleMaps in one of my pageshttp://hothaus.de/greg-tour-2006/route.htm
This requires XHTML to work properly on IE. Also, it requires an <html>
tag like this:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">

It can't "require XHTML to work properly on IE" as IE just doesn't
work properly with XHTML anyway. I'm also puzzled as to just why it
requires the vml namespace to be declared. This content looks like
SVG, not VML ! It doesn't appear to make any use of it.

In practical terms you just can't do this, exactly as described. It's
easy to describe what you need to do to do it perfectly (including
serving it under an XHTML-as-XML content type), but it will then fail
under IE. As it obviously "works", then there's clearly some leeway
in just how valid you need to be to make things work.

I suggest simply ditching the vml namespace. It's not necessary to use
it -- even if Google did require and impose it, it would be possible
for a pure-XML approach to add it to child elements of the page, not
necessarily the <head>. I even doubt it's appropriate to use this, let
alone required. Obviously you'd need to test this on a few browsers.

You might even get this page into plain old HTML 4.01 Strict, rather
than fiddling about with pseudo-XHTML under Appendix C.

I strongly suspect that practical support of Google's embedded maps
and the SVG features they use will work just as well embedded into
HTML as they do in XHTML with problematic VML namespaces dotted around
the place.
 
G

Greg N.

Andy said:
It can't "require XHTML...
I'm also puzzled...
I even doubt...
You might even...
I strongly suspect...

Well; I admit I don't understand much of what you said here.

But I've tested it. I've tested it with plain HTML 4 strict. It works
under FF, but not IE. With the XHTML and VML incantations as suggested
by Google, it works under IE, too.
 
D

dorayme

"Greg N. said:
Well; I admit I don't understand much of what you said here.

But I've tested it. I've tested it with plain HTML 4 strict. It works
under FF, but not IE. With the XHTML and VML incantations as suggested
by Google, it works under IE, too.

How about it AD, making a demo for 4.01 Strict and it working
reasonably well all over the show? Trust me, there will be many
eyes and ears ready to gobble up and use the result. If how to do
a google map well in 4.01 is handed on a platter, well then, who
would not be interested?

(One of the things I liked about Greg N's map is that I was able
to stray in concentration from his motorbike and trips and see
into the past. For example, the giant gum tree that was recently
cut down next door to me.[1]. This led to me suggesting to the
next door neighbour that he tease the team that cut it down by
complaining that they failed completely in spite of appearances.)

[1] The satellite pics are nowhere near daily updated
 
A

Andy Dingley

With the XHTML and VML incantations as suggested
by Google, it works under IE, too.

VML is IE-only (when I last looked, years ago) SVG is standards based
and cross browser.

I suspect that Google's client-side JavaScript sniffs browser type and
serves one or the other accordingly. With the poor XML compliance of
older M$oft tools, it might even be essential to put it on the root
element.

If it's important to have this namespace, and it doesn't break anythign
(spare unrecognised attributes don't) then I'd leave it in place and
stop worrying about perfect validity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top