Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Validating weblog entries

webgraphics have an interesting discussion running about the need for a weblog entry XHTML validator. Dave Lindquist suggests using his JavaScript XML Parser to perform validation on the client side, which seems like an excellent solution. I already use PHP’s XML parsing functions on this blog to check my entries are valid XML when I post them (and extract links for use with my pingback client) but additional client side validation would save the round trip to the server. The discussion also covers the idea of using the W3C’s validator to check entries—as soon as they finalise their XML interface (as used by my validator web service) I can see a lot of interest forming in this kind of automated validation.

This is Validating weblog entries by Simon Willison, posted on 7th November 2002.

View blog reactions

Next: Javascript XML parser

Previous: aqTree 3

4 comments

  1. How exactly do you validate entries? Do you stick html,head,body tags around the entry and validate the resulting source, or do you make an internal preview of the entry in its template and then validate that preview source?

    michel v - 7th November 2002 23:37 - #

  2. At the moment I'm only checking for XML well-formedness - in my experience almost all validation errors come from forgetting to close a tag as the XHTML I use in post entries is simple enough for other DTD related errors not to come in to the equation. The method you describe is the one that is being discussed for full-on W3C validation - a temporary page would be generated with just the entry in a simple document framework and the web service / Validator XML interface would be queried to check for validity. For the moment though XML validation works just fine.

    Simon Willison - 8th November 2002 11:35 - #

  3. Isn't the "JavaScript XML Parser" supposed to link to something more, er, parserish? Like, for example, http://gazingus.org/js/?id=104 ? ;o)

    Friday Shot - 8th November 2002 19:24 - #

  4. Ooops :) Thanks for that, I've fixed the link now.

    Simon Willison - 10th November 2002 14:20 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2002/11/07/validatingWeblogEntries

A django site