tags:

views:

430

answers:

2

I feel stupid... my desire is to write HTML5 using XML and I can't get ANYTHING to work, for instance:

<!DOCTYPE html>
<html>
<head><title>ABC</title></head>
<body>DEF</body>
</html>

actually shows ABC on the browser canvas!

What am I doing wrong? (using FireFox 3.5.8)

+2  A: 

You need to declare a namespace on the root element. For HTML that is http://www.w3.org/1999/xhtml. A DOCTYPE is not needed in XML.

Anne
But a doctype may be needed to trigger HTML5 mode in some browsers.
Konrad Rudolph
And standards mode in other browsers, cough Internet Explorer cough.
Paul D. Waite
There is no concept of versioning for HTML or XHTML. Browsers are automatically in latest-edition-of-HTML-that-is-implemented mode.There is also no concept of quirks mode in XML. Internet Explorer does not support XML in the way the topic starter seems to care about it so that is not relevant either.
Anne
A: 

I’m on Firefox 3.5.2. I saved the code in your question as a file (abc.html) and opened it in Firefox. “ABC” didn’t show on the browser canvas.

What mimetype are you serving it with? What file extension?

Paul D. Waite
I'm actually prototyping from the file system, so it's coming right form C:\prototype directory. No mime type.
Pete Alvin
Huh, that’s weird. What’s your filename? Is it something.xml?
Paul D. Waite