View Full Version : Quirks Mode, Doctype, Namespaces and extensions
NotesSensei
02-18-2005, 04:35 AM
Hi there,
we need to add custom tags/attributes to an web application. Being good boys we use our own namespace:
<cal:dlcalendar xmlns:cal="http://www.me.org/schema/calendar">12 Jan 2003</cal:dlcalendar>
<input type="text" cal:validation="tt/mm/yyyy required" id="orderdate" />
At the top of the document we declared the doctype to make sure that modern browsers go into Standards Mode rather than QUIRKS mode (had enough headache with that one :eek: ):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Now the validator fails complaining that there is no such thing as <cal:...>. I can wrap my own DTD around XHTML and declare my own doctype. However all the Browsers jump to quirks mode again. :confused:
So my question:
How to I introduce my own elements/attributes properly into xhtml and make the browser play nice in Standard mode.
:-? stw
rmedek
02-18-2005, 05:20 AM
This is a loaded question :D.
There was an article on ALA not too long ago about custom doctypes, the discussion that followed brought up several interesting points on your situation:
http://www.alistapart.com/discuss/customdtd/2/
Apparently the only browser that jumps into Quirks mode when confronted by a custom DTD is Internet Explorer. Which is reading tag soup anyway (XHTML), so it might be argued that it would be better to drop the custom DTD and live with validation errors, assuming the document is well formed.
NotesSensei
02-18-2005, 06:06 AM
This is a loaded question :D.
That's for sure :(
Apparently the only browser that jumps into Quirks mode when confronted by a custom DTD is Internet Explorer. Which is reading tag soup anyway (XHTML), so it might be argued that it would be better to drop the custom DTD and live with validation errors, assuming the document is well formed.
Kind of. When previewing local html files firefox also jumps to quirx mode. Luckily you can teach tidy your won tags, so I have to create my own validator then.
Thx for the link and reply.
;-) stw
Alex Vincent
02-18-2005, 08:12 AM
<!DOCTYPE PUBLIC public-name system-name
[
insert <!ELEMENT cal:foo> and <!ATTLIST cal:foo> declarations here
]>
NotesSensei
02-18-2005, 11:31 AM
<!DOCTYPE PUBLIC public-name system-name
[
insert <!ELEMENT cal:foo> and <!ATTLIST cal:foo> declarations here
]>
Hi Alex,
cool, thanx a lot. Dumb question. Could I instead of listing all the Elements/Attributes point to an external definition. Some kind of include?
:-) stw
Alex Vincent
02-19-2005, 05:22 AM
Yes you can, although I'm not sure if this is canonical:
http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/navigator.xul#54
NotesSensei
02-19-2005, 06:02 PM
Yes you can, although I'm not sure if this is canonical:
http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/navigator.xul#54
Sounds right, however when I type:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
[
<!ENTITY % u4extensions SYSTEM "http://www.umsys.de/schema/u4extensions.dtd" >
%u4extensions;
]>
IE and Firefox show both %u4extensions as first thing in the page.
So my conclusion is: define your own schema. Include the (x)html elements there. So the only question remaining is the namespace (which DTD doesn't support istn't it?). How to get html and cal:calendar properly defined.
;-) stw
Alex Vincent
02-19-2005, 06:30 PM
Well, it might be an internal-DTD's only thing. Every one of them referred to (or came from, I'm not sure which is significant) a chrome:// URL, and chrome:// stuff has special privileges in Mozilla.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.