That question hitted me yesterday...
A bit of explanation...
I'm currently designing a demo site build around an XML+XSL framework I've been working a bit lately.
As I love (and really love, not just like) javascript and DOM scripting, I thought to myself that it would be really cool, if we could separate javascript as we could do with css.
I mean, no <script> elements anywhere else than defining the source files in the header.
For that, I decided to tag my HTML elements with specific attributes.
My different JS objects are then scanning the dom tree, to detect which elements are tagged, and applies them specific behaviors, and sometimes even totally rewrite them.
For exemple, I've wrote an js object, that will fetch every div's with an js:tab="name of tab" attribute, and it will create a tabbed composant with every div's tagged like that.
It don't just add an tabbed header, it re-create an tabbed structure, while deleting the original elements from the DOM tree.
It works perfect, it's clean in the HTML source and it degrade very well, as someone without JS enabled will just have a series of div on screen.
You can see it live there:
http://dating.webalis.com/signup.php
Quote:
I know, the html is not valid, but it's because when I force the server to transform XML+XSL in HTML, it don't follow the specified doctype.
If anyone have infos about how you can force the PHP5 XSLT engine to XHTML rather than HTML output mode is welcome...
|
But, of course, I have now a HTML source that is no more w3c compliant, because js:tag is not a recognized attribute.
So, even if for myself my mind is well set on that subject, I'm curious to hear about yours.
If you could integrate something like that in your pages, would you mind loosing w3c compliance for the benefit of this ?