This is a list of markup changes I would make to languages on the web, if I were all-powerful and able to push them through, and backwards compatibility weren’t an issue:
- Specs would be written so their content models ignored elements from other namespaces. For example, when html 4 says
<!ELEMENT UL - - (LI)+ -- unordered list -->, I can do<ul><foo:bar><li>blah</li></foo:bar></ul>and all is good and well and valid. - Forms would be a separate namespace from documents. See my previous post.
- Navigation/branding/other template-type things would be their own namespace. See again my previous post.
insanddelwould have their own namespace.- New namespaces would be easy to generate, and it would be easy to make machines (partially) understand them, without needing those machines to be updated at all. See my post on this topic.
More to come… this post was mostly inspired by the ins/del thing.
Reading back over the first item… is that really what I want? And just say if authors do something like <html:em><grammar:paragraph>text text</grammar:paragraph></html:em> it’s their problem? Or do I really just want some way to say “this element doesn’t affect content models”?
You would allow namespaces in HTML 4? Interesting.
Well, no, not as such.
Namespaces are a great concept, they allow all sorts of things that wouldn’t otherwise be possible. But I’m not sure they’d work in a language like HTML.
Take for example this:
<html:p>some text <edit:ins><html:p>more text
Is the
edit:insa child or a sibling of the firsthtml:p? No way to tell. The HTML and EDIT specs say nothing about each other, because HTML came first, and EDIT fits in so many places that defining its interaction with them all would be impossible. So it’s undefined. And even if the EDIT spec saysedit:insneeds a closing tag, it requires more than one pass through (and I bet someone could come up with an example where there’s no way at all to tell).So you need some sort of meta-language. So all my languages would probably be based on XML. ;)