Click to See Complete Forum and Search --> : Adding custom attibute to html dtd.


davidmal
03-04-2007, 01:33 PM
I trying to add an attribute to the <input> element called 'group'. I downloaded the XHTML 1.0 Transitional dtd and tried adding 'group CDATA #IMPLIED' to the <!ATTLIST block for the <!ELEMENT input EMPTY> section and tried appending '<!ATTLIST input group CDATA #IMPLIED>' at the end of the custom dtd.
Uploaded the dtd to the same directory as the html page.(http://www.nm156-eol.com/xhtml1-custom.dtd)

The head of my HTML page is:
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.nm156-eol.com/xhtml1-custom.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Grouping Mut Ex Checkboxes</title>
...

The W3C validator still says 'group' not valid attirbute.

Obviously I'm a total rookie to DTDs, please help.

mrhoo
03-04-2007, 08:23 PM
You need to serve the page as xml, not html, to use custom dtds.

Major Payne
03-14-2007, 12:45 AM
Have fun with DTDs, but read what some have to say about them.

Don't Use "Custom" DTDs! (http://www.w3.org/Style/customdtd)
More About Custom DTDs (http://alistapart.com/articles/customdtds2/)

These are two of many. Might also try this type:

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

Be interested to know if you got it working and solution.

Ron

zeno
09-14-2007, 03:10 AM
For those might interested:

This article mention how to add new element in the DOCTYPE:
http://www.alistapart.com/articles/customdtd/

And this article explain how to eliminate the weird `]>` on screen (work with IE & FF)
http://www.quirksmode.org/bugreports/archives/2005/02/custom_dtds_int_1.html

Major Payne
09-14-2007, 04:09 AM
Page no longer exists at the OP's link. This thread is about 5+ months old.

Ron