Getting “track” attribute to validate with w3 validator

So I return to our “unit” tests (which do HTML validation through a locally installed w3 validator service, ssh, it’s useful if not fast) and I find that loads of stuff isn’t validating any more. One of our custom bits of JavaScript has been responsible for liberally splashing a custom “track” attribute over a lot of our links and buttons on so-on.

Dig around the internet and I get to this useful and ancient article on A List Apart about custom DTDs.

Upshot – add this to the beginning of your page when validating – a quick check on Firefox suggests you can’t really have it on your live site. Ho hum.

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
[
<!ATTLIST a track CDATA #IMPLIED>
<!ATTLIST input track CDATA #IMPLIED>
]>
<html xmlns="http://www.w3.org/1999/xhtml">

Leave a Reply