November 2000
Intermediate to advanced
1152 pages
23h 32m
English
One of the attractions of XHTML is that you can extend it with your own elements because it's based on XML. The way you actually do this is has changed in the various XHTML working drafts over time; the current working draft on this topic is at http://www.w3.org/TR/xhtml-building/.
Here's an example. As you know, XHTML documents have <head> and <body> elements. Here, I'll add a <foot> element to XHTML 1.0. The W3C says that all custom XHTML elements should have their own namespace, so I'll give that element the namespace doc. I'll also create an attribute for this element, footattribute, like this in a new DTD, extend.dtd:
<!ELEMENT doc:foot (#PCDATA) >
<!ATTLIST doc:foot
footattribute CDATA #IMPLIED
>
.
.
.
You also must ...
Read now
Unlock full access