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 from Bing Chat—Our First Encounter With Manipulative AI - 19th November 2024
- Project: Civic Band - scraping and searching PDF meeting minutes from hundreds of municipalities - 16th November 2024
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024