Validation sustained
A mere 13.5 months after Jacques overruled my objection to serving a blog as application/xhtml+xml
by twisting Alexei Kosut’s MTValidate plugin into a “you will submit valid XHTML comments!” plugin, I’ve finally caught most of the way back up (yeah, I still need to start serving the right Content-type:
. Soon.).
For reasons beyond the ken of mortal man, my NightmareHost doesn’t actually include a copy of the oh-so-standard OpenSP SGML parser, and my last bout with compiling it lead to lots of screaming and no working binary, but it seems that 1.5.1 is delighted to compile in user-space with a simple
./configure --prefix=$HOME/OpenSP
make
make install
cd ~/OpenSP/bin
./onsgmls -h
which gave me (along with much delight) Usage: ./onsgmls [OPTION] SYSID…: a working onsgmls!
Then, with Jacques’ helpful advice which turned out not to be quite enough to overcome the demons of perl -MCPAN -e shell in user-space, and a package of the Perl modules I was missing which was, all I had to do was drop his patched MTValidate in my plugins directory, and learn the horrors of Perl’s $0
, which is the full path and name of the currently running script on the machine your developer uses, but only the name of the script on your machine, leading to vast confusion until you finally just put PluginPath /home/you/there/mt/plugins/
in your mt.cfg so you can use my $vdir = File::Spec->catfile(MT::ConfigMgr->instance->PluginPath, 'validator');
for an absolute path to the directory in plugins (thank you, bloody Config::General and your Apache-style Includes and your bloody IncludeRelative), and be done with it. A little “borrowed” template code for the Comment Preview template, a little patching up of the entry preview code in CMS.pm, and now when I preview an entry with my usual botched nested lists, my local copy of the validator will tell me about it, before I have to show it in public.
What do you have to do now, to comment? Nothing different, really. I’m still forcing previews, just like I have for months, and if you just type and don’t use any HTML, the preview will pat you on the back, say “You’re valid!” and give you a Post button. If you use HTML, poorly, or slip in an unencoded ampersand, it will do its best to tell you just what’s wrong, and give you a Preview button to see how your fixing went.
What do I still have to do? Check a bunch of pages with Trackbacks, and with old comments that had interesting characters in them, to make sure that Alexei’s UTF-8 Hack plugin is really doing the job of turning random characters in random charsets into something that’s at least valid UTF-8, if not correct, then turn on Content-type: application/xhtml+xml
for those browsers brave enough to ask for it, and then find something to make use of it: there was a time when I understood enough math to make some use of MathML, but that time’s long past. Meanwhile, I’ll just keep previewing my entries, and being told “Valid!” (and yes, I do enjoy using a debit card, since the “Approved” may be my only approval of the day).
Oh, yeah, and I upgraded to MT 3.0D. A word of advice: if you are using Sean Willson’s rebuild type mod, so that your values for whether or not to automatically rebuild index templates don’t make sense to MT, after you upgrade be sure to run through the templates checking the now-unchecked boxes to rebuild, before you start to panic thinking you’ve broken something because you don’t get any indexes built.
Great! I hope you can switch to ”real” XHTML soon.