Benefits of XHTML
11th August 2002
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.
While upgrading to XHTML may have few immediate benefits, the ease with which it can be parsed has very real benefits further down the line. Writing content in XHTML now will make it much easier to re-use that content in the future.
Update: I should have checked the date on his entry before I posted—this is from way back in December 2001
More recent articles
- Notes on the new Claude analysis JavaScript code execution tool - 24th October 2024
- Initial explorations of Anthropic's new Computer Use capability - 22nd October 2024
- Everything I built with Claude Artifacts this week - 21st October 2024