Let’s say you’ve been writing HTML and XHTML for years. Being a standards activist, you always write well formed, valid markup. You meticulously validate every document you write. Not only that, but you’ve installed the web developer toolbar in Firefox or Mozilla and, as a hobby, you run the validator on every site you visit. With years of experience under your belt, you think you can handle any error the validator throws at you, and you’re confident you can fix whatever it is in under a minute.
If that description fits you, then I hereby challenge you to find the one and only real validation error within the following sample HTML or XHTML document (I’m not telling you which, you figure it out). Do you think the validator will help? Go ahead and test it! I’ve exploited some known bugs in the validator to ensure you can’t cheat quite so easily. The validator will, in its current state, issue 80 errors; none of which are real!
There is one, and only one, true validation error within this document. The first person to comment with the correct answer and explanation will be featured in a follow up post to them give some recognition for their hard work. Feel free to discuss and ask questions here in the comments (or wherever else you like). This is designed to be a fun exercise for you to realise just how much you really don’t know about HTML and/or XHTML.
Do you think you’re ready to take the quiz? Do you think this will be a walk in the park, and you’ll be the first across the line with the right answer? Ok, here it is, and remember, have fun!
Assume the HTTP headers contain:
<?xml version="1.0" comment="Find the Error!" ?> <!-- -- --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- -- --> <!doctype html public "-//W3C//DTD HTML 4.01//EN" [ <!ENTITY smile CDATA "☺" -- U+263A WHITE SMILING FACE --> ]> <html lang="en"> <title/validation quiz/ </head> <p>In this document, there ∃s a single validation error. It makes use of some <strong<em/very/</strong> uncommon & unsupported markup techiques designed to fool the faint hearted. <>This exploits some known bugs in <a href=http://validator.w3.org/ to both help prevent cheaters and confuse even the most experienced authors.</> <form method="get" action="http://validator.w3.org/check" <table <tr <td<input text checked id=uri name=uri size=40/> <><label for=uri>Is this test too hard?</label></> <><td<button button>Don't Cheat!</> </tbody ></table> <ul/ <li><![CDATA[ <li Oops<!-- ?]]> --> <li>There are < 2 validation errors in this document</li> <?hello comment="What's this doing here?"?> <!--- Found the error yet? ----> <blink>I'll bet this is “annoying”!</blink> <p align="right">Remeber, it's a Strict DOCTYPE! <!-- ------ Don't give up now! ----- > <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <p>Is the error here --><li>?/ <p/>The question is: Is this<br>HTML or<br/>XHTML served as text/html? &smile</></></>