Forum Moderators: open

Message Too Old, No Replies

Validate for which version?

do I have a choice? which one should I go for?

         

shasan

3:30 am on Oct 3, 2003 (gmt 0)

10+ Year Member



I searched for an answer to this, but couldn't find one. apologies if this is a redundant topic.

Being new to the whole validation thing, I decided to validate one page on my site. 116 errors. Great. Ok, that was for HTML 4.01 Transitional.

For kicks I switched the option over to XHTML 1.0 Transitional and and it came up with a very-much-celestial 865 errors.

I would assume that I should try validating for the version with the least amount of errors? Am I looking at this the wrong way?

tedster

4:14 am on Oct 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You wrote your code with a particular version of HTML in mind, whether you were fully aware of it or not. Most of us who've been on the web for a while were doing something like a hacked up street version of HTML 3.2.

4.01 transitional is the "everyman" version of HTML today. Understand what the errors are and fix them from the top down. You'll find that errors "cascade" and if you fix the top five, 30 other error reports can vanish -- so you probably won't have 116 separate fixes.

If you wrote XHTML you would know it -- it's a very different kind of code with tags like <br />, no uppercase tags, and so on.

Similarly, I wouldn't suggest trying 4.01 strict until you can easily make a 4.01 transitional page validate.

Your first attempt was the right one -- you just need to roll up your sleeves and climb the learning curve. My experience is that I'm very glad I'm doing it.

shasan

5:42 am on Oct 3, 2003 (gmt 0)

10+ Year Member



sounds good to me. thanks for clearing that up, it was getting a little confusing. At least I'm on the right track.

Right then, time for some fall cleaning of code. :)

DrDoc

5:42 pm on Oct 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And, you should include a doctype in your document stating which version you're using ;)
That way the validator will know, and it won't even prompt you to choose.

Mohamed_E

6:33 pm on Oct 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Two more points:

The DOCTYPE should be complete, see Declaring a doctype [webmasterworld.com].

Also it will help to declare your character set, either with a meta tag:

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

or in your .htaccess file:

AddType 'text/html; charset=ISO-8859-1' html

shasan

8:30 pm on Oct 4, 2003 (gmt 0)

10+ Year Member



Dr. Doc,

I use Dreamweaver, so the doctype gets declared automatically when I open a new file, but the validator said something like "All document types will be overridden". *shrug* other than that it seemed to work ok.

glengara

8:37 pm on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I'd love to know who and why would choose "strict", when "transitional" seems so much easier.
Is it down to more browsers showing the same rendering?

g1smd

8:29 pm on Oct 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How did you get on?

Did you manage to fix all of the errors?

I help out on some other design forum somewhere else on the Net, and I have found that there are only about 20 common errors that people make with code, about 20 more that occasionally appear, and a few more that have been "one-offs" in thousands of websites reviewed. Learn the major 20 and you'll be validating all of your new pages within minutes, you'll stumble across some of the other errors from time to time thereafter.

tedster

8:41 pm on Oct 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I'd love to know who and why would choose "strict", when "transitional" seems so much easier.
Is it down to more browsers showing the same rendering?

Yes, that's a big part of it -- especially the "emerging" user agents on hand helds, etc. (although quirks mode vs standards mode is more important in that regard.)

Another big part of it for me is "future-proofing" my HTML. The shift from transitional to strict is a bigger deal than going from HTML (transitional) to XHTML (transitional), and the learning involved in making that transition has had amazing repurcussions for me in many areas of site building.

Right now I use both transitional and strict - transitional for the more ephemeral, hurry-hurry jobs and strict for development that is planned to be more long-term.

I've only changed over one legacy site to strict, however, and that was a bear. I'm still very glad it's done. Site maintenance is a lot easier now -- and whether it's part of the HTML version shift, or just the generally improved coding, SE traffic to the site has gone up about 40%.

4serendipity

8:07 am on Oct 17, 2003 (gmt 0)

10+ Year Member



Even if you decide to markup your sites with transitional HTML, it's still a good idea to meddle around on some "test" pages with HTML that validates to a strict DTD. It's a great exercise that'll make you a better developer.