## April 30, 2003

### Objection Overruled!

My, but this blog has taken a techno-geeky tilt…

Anyway, Phil Ringnalda recently objected to serving XHTML as application/xhtml+xml. He wants to serve XHTML because he uses XML-parsing tools in his back-end. But what, Phil asks, if someone posts a comment which is ill-formed XML? Mozilla won’t render it when served as application/xhtml+xml. So he wants the “safety net” that serving up text/html provides.

Never mind that ill-formed XML will cause his back-end XML parser to barf just as surely as it will Mozilla. No, the real answer to the problem of invalid XHTML in comments is, to paraphrase Ronald Reagan,

Trust, but validate!

So, with the help of a patched version of Alexei Kosut’s MTValidate plugin, we make sure that comments posted to this blog are valid XHTML before they get posted.

This won’t stop a malicious poster from sneaking invalid markup onto this blog (there are steps I could take to deal with that, but let’s just say I’d rather not go there), but it should deal pretty well with inadvertent breakage.

Next objection?

Update: Squashed a small bug, where the Validator would send invalid output (!).

Posted by distler at April 30, 2003 9:52 PM

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/151

### Re: Objection Overruled!

Ulp. You do up the ante a bit, don’t you? Bookmarked, for when I move to a box I control, since I doubt I can get the validator running on a shared host.

Posted by: Phil Ringnalda on May 5, 2003 11:19 PM | Permalink | Reply to this

### Re: Objection Overruled!

Ulp. You do up the ante a bit, don’t you?

Just getting you back for this. :-)

Bookmarked, for when I move to a box I control, since I doubt I can get the validator running on a shared host.

The “Validator” is a single CGI script, written in Perl, that Alexei has kindly wrapped as an MT plugin.

You need a bunch of Perl modules (some of which you may have to add to your extlib directory) to run it – nothing new there. And you need a binary of the SGML parser, onsgmls. If you can compile the OpenSP package from source, or grab a precompiled binary from someplace, you should be in like Flynn.

It’s really quite doable, regardless of whether you run your own box.

Posted by: Jacques Distler on May 6, 2003 12:01 AM | Permalink | Reply to this