A little context: HTML is made up of elements: a, b, u, blockquote, div, etc. In XHTML 1.1, these elements are arranged into modules: Text, Hypertext, Lists, etc.
The XHTML 1.1 modularization of HTML is great. It makes it extremely simple to mix and match functionality based on your needs: use basic text elements and not tables or lists. Use tables and lists, but no forms or inline scripting. But sometimes, a user wants to just be able to say: "I want p, b, i and a allowed." Then you run into problems.
XHTML 1.1 is not designed to allow this sort of granularity in picking which tags you want to allow. To get the desired effect, you'd have to roll a custom XML Schema or DTD with the elements you want: not the most pleasant task. So, I want to work around this limitation: let the user mix and match elements and modules to get what they want: p, b, i and the Hypertext module.
But where does the software get the p tag from? The Text module, of course, but how does it know that? As of right now, I've solved this problem by loading every module possible for a particular doctype and then registering it to an element lookup array. Element to module, a many to one relationship.
Well, not really. Here's the tricky part: XHTML Modularization allows for the redefinition of elements. So your blockquote tag might actually be influenced by the Text module AND the Legacy module. Furthermore, modules may have global effects: the Bi-directional text module, in addition to defining the bdo tag, registers the dir attribute to all elements.
At this point, I am totally at loss to what a good structure for organizing these internals should be. Any thoughts?
Organizing HTML's elements
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: