I have created a number of Web sites and have for years believed that it was worth going the "extra mile" to write code to the highest standard possible. I believed this to be the standard for "XHTML 1.0 Strict." My DOCTYPE is:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
I put all my pages through the W3 Validator and receive this result:
"This document was successfully checked as XHTML 1.0 Strict!"
Recently I was engaged in a conversation on another forum that primarily deals with webmaster coding issues. A particular coding solution to a question I raised was recommended, and I pointed out that, although it would work, it would not pass the Validator as XHTML Strict. One respondent made some rather degrading comments about my attempt to write strict XHTML code:
*All browsers* ignore your XHTML doctype and parse your pages as HTML, not just Firefox.
What you could do is direct your efforts towards things that actually benefit your users, rather than investing time in publishing web pages that almost, but not quite, work as XHTML--and so have to be parsed as HTML anyway.
You're using undeclared entities in your pages, which isn't a problem when they're parsed as HTML, but is when they're parsed as X(HT)ML. But since no one will ever parse your pages as X(HT)ML it doesn't really matter. XHTML is a) hard to get right and b) mostly pointless. It's not an accomplishment to publish sort-of-XHTML pages that have to be parsed as HTML to actually work.
What my "undeclared entities" are was left undefined. Also, it's difficult to see how my code will "almost, but not quite, work as XHTML" and is just "sort-of-XHTML pages" when the Validator passes them as "XHTML 1.0 Strict" with no errors or warnings.
But here's my Firefox question: was he right about Firefox and "all browsers"? Does Firefox ignore my DOCTYPE and just go ahead a parse my pages as HTML 4 or 5?
Also, any comments you might have about my writing code to XHTML Strict standards would be most appreciated.
Thanks so much.
Ken