Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=ISO-8859-1" />
<title>Test</title><style type="text/css">
* { COLOR: #00f; }
billy { DISPLAY: block; COLOR: #f00; }
frogs { DISPLAY: block; TEXT-DECORATION: underline; }
spaghetti { DISPLAY: block; FONT-WEIGHT: bold; }
</style>
</head><body>
<billy>This is a test.</billy>
<frogs>This is a test.</frogs>
<spaghetti>This is a test.</spaghetti>
</body>
</html>
But of course it didn't validate. That it rendered correctly in FF was a shocker.
The bottom line question is: How do you make it work? How do you "extend" the html?
Thanks,
Lance
IMHO the X in XHTML is partly marketing-bloat by the W3C. The major difference with HTML is that XHTML documents should be well formed. XHTML 1.x uses the same elements as HTML, and won't let you define your own stuff.
Marketing hype, huh?
eXtremely
Hyped but
Totally
Mediocre
Language
Yeah, maybe...
The above links give an overview of how XHTML is being modularized - which is the basis of extending XHTML for yourself.
You can use standard XHTML notation, and add a custom namespace for your unique tags, and you can also build your own custom DTD or combine XHTML with other languages such as MathML or SVG.
One important caveat, however: don't expect things to work in IE without a certain amount of work. One way of managing it is to serve
application/xhtml+xml to Mozilla/Opera, and text/xml to IE and use it as XML. But on the whole, the extensibility is considerably reduced due to browser limitations. Try this example of XHTML plus MathML plus SVG [w3.org]:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"[
<!ENTITY % MATHML.pref.prefixed "INCLUDE" >
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:pref="http://www.w3.org/2002/Math/preference"
pref:renderer="css">
<head> ... </head>
<body> ... </body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns:customtag xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=ISO-8859-1" />
<title>Test</title><style type="text/css">
@media all {
* { COLOR: #00f; }
customtag\:billy { DISPLAY: block; COLOR: #f00; }
customtag\:frogs { DISPLAY: block; TEXT-DECORATION: underline; }
customtag\:spaghetti { DISPLAY: block; FONT-WEIGHT: bold; }
}
</style></head>
<body>
<customtag:billy>This is a test.</customtag:billy>
<customtag:frogs>This is a test.</customtag:frogs>
<customtag:spaghetti>This is a test.</customtag:spaghetti></body>
</html>
Now if there were just some way to get it to validate...
This quest started when I wanted to define an "<ak>" tag to be used for accesskey since the W3C decided to take <u> away from us. And <span class="accesskey"> seems like a real waste of space for trying to do something so simple.