Home Blog Tech Stuff XHTML+RDFa Valid

XHTML+RDFa Valid

E-mail Print PDF

Well, I finally got around to it. Every page here is now valid XHTML+RDFa, an extension of XHTML 1.1 (strict) that allows RDF meta-information to be added directly to the XHTML markup inline. I've started trying to add some SIOC markup to the new comments plugin that I'm building; the SIOC is neither complete nor 100% correct right now, but at least I've made a start :D

I started out by trying to fix all the Joomla! code manually for XHTML strict. But that is a big job and involves changes to a great many files, and since XHTML strict compliance does not seem to be a high priority for the Joomla! devs, I think it's unlikely that I would be able to get them to push the necessary changes into the main codebase. That's one of the main reasons I've been putting off doing all this for so long; I don't relish the prospect of having to maintain all those changes with every Joomla! release.

But halfway through, I got fed up with making the same kinds of changes all over the place and decided to just cheat. I already have a small system plugin to serve Joomla! pages with the proper XHTML server headers, and what I've done is extended that to load the JResponse buffer into an XML DOM, find the most common XHTML errors with XPATH expressions and fix them automatically. It turned out to work better, faster and more reliably than I had expected.

However, that "cheat" is all well and good, except for performance. Not that I've noticed any real issue here, but no doubt on a site with high traffic volume, the demand on server resources for all that XML processing would rocket. However, having the page in an XML DOM does present a number of opportunities to do various other funky things with it that could make the overhead more palatable in view of broader, more immediate and pragmatic uses than simply achieving strict XHTML validity.

So my current plan is this:

  1. Put all the code back to standard Joomla! 1.5.14 versions and test that the new XHTML plugin can fix every page out of the box.
  2. Get the plugin to log all the errors it fixes and make a small component to use that log as a development ToDo list.
  3. Polish up the plugin a bit and add a load of new configuration parameters for the new functionality. Then I'll make an alpha release.
  4. Look into how the Joomla! caching works and see if there are any opportunities to assist that.
  5. Look into various XSLT transforms that might be useful to assist compatibility with shitty browsers like IE (e.g. to render stuff like MathML or SVG as other kinds of elements for them).
  6. See which other Joomla! plugins might work faster operating on an XML DOM instead of manipulating the response buffer with regular expressions and the like. Perhaps I could add a new trigger specifically for XML-based plugins.
  7. Investiage the possibility of XSLT-based templating in Joomla!

I'm confident that there is plenty more potential here that I haven't thought about yet, but I have to be careful not to get sidetracked from the semantic web stuff that I wanted XHTML+RDFa for in the first place. I'd be interested to hear from anybody who has tried doing something similar, particularly any quantitive experience related to the performance impact.

Last Updated on Thursday, 10 September 2009 23:16