Simon Willison’s Weblog


Sunday, 11th August 2002

One for Paul

This one’s for Paul from Uni: Tales of the Plush Cthulhu

[... 107 words]

Benefits of XHTML

Phil Ringnalda is questioning the point of XHTML. The single, huge advantage it has over HTML is that XHTML can be parsed by anything (or any language) with an XML parser. As an example, a few weeks ago I was asked to write a script to grab links from a bunch of HTML pages and insert them in to a database. I solved the problem with a combination of PHP’s strip_tags() function and XML parsing abilities, by killing off every tag that wasn’t an <a> tag and slapping on a start and end element to turn the document in to valid XML—a step that would not have been necessary had the page used XHTML in the first place.

[... 190 words]

2002 » August