Forum Moderators: open

Message Too Old, No Replies

Doctype and validation

         

Visit Thailand

2:31 am on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK so we know that errors make the code invalid but does it actually affect anything ?

Even the BBC does not have <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> at the top of all its pages.

What actual difference do these errors make to a viewer ?

Brett_Tabke

7:37 am on Jul 5, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Split off from:

[webmasterworld.com...]

IE reads doc type and adjusts some things in the display based on the doc type.

Nick_W

7:51 am on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, if you don't have a doctype IE will go into 'quirks mode' and display your css incorrectly.

Also, as the v7 realases get closer (and some v6 browsers) you'll notice that they pay attention to the doctype and display accordingly.

The quick answer is: Not much.

The longer answer is: As browsers become more standards compliant the type of document will affect how the browser renders the page and in some cases this may mean that your css/html will not render porperly unless you specify what kind of dtd it conforms too.

Nick

Visit Thailand

9:19 am on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks you mean something as small as the &amp thing could have an effect on how the page is displayed ?

Nick_W

9:23 am on Jul 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



er...what?

Don't know where you got the &amp; thing from. What do you mean?

Nick

Visit Thailand

2:37 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry did not explain myself properly. You know that in html you should not just put & it should be written as &amp

If you do not this would come up as an error during validation.

What I am asking is how far and important is all this validation. Above someone mentions the v7 browsers that will require more valid html.

This goes beyond my understanding as from what I see the browsers are becoming more lenient and allowing for more errors of the basic type.

But lets say they are becoming more "validated code" orientated then what happens to all those billions of pages out there that are not being updated.

Or just take any big website that has thousands of pages, is the author supposed to go back and revalidate all his pages to make them valid.

Like I mentioned above I did not even know that <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> was needed just to validate a page. What am I supposed to do return to all my old pages which still contain valid info and update every one ? There are thousands and this is why I do not follow the validation discussion.

martinibuster

2:48 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Actually, I think that the browsers are becoming more sensitive, not lenient. For example, the IE for Mac is stricter than IE 5.5 (not sure for 6). And Netscape 6.2 I find is stricter than IE 5.5 and 6. Stricter in the sense that it won't let you get away with any code funkiness while IE will understand what you're trying to do and render it.
However, I have found, that finding that code funkiness and fixing it can be hard, even when your code validates per cse html validator and the online w3c code validator (forgot the name of it). In that case, I left off the DTD and NS 6.2 was happy. Go figure.

Nick_W

9:09 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can get away with rubbish html of course, browsers will still display it. But, why would you want to? Valid code is very easy to write and you get clean results across all browsers (nn4 excepted)

Nick

Visit Thailand

9:38 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I agree Nick _W but does this mean it is wiser to go back and redo thousands of old pages ? What if in the future code changes again.

This is really my concern, the older pages. New pages we create every day are created to validate but the old ones ?

As for NS 4 we disregard it completely, a mistake perhaps but a decision made non the less.

Nick_W

9:42 am on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, if really is 'thousands?' I'd leave them for the time being. But then if they are template driven, edit the template or if there are just 'quite alot' why not make a point of doing 5 a day?

Nick

rewboss

2:42 pm on Jul 6, 2002 (gmt 0)

10+ Year Member



You should really be re-vamping your website on a regular basis anyway; partly to keep up with browser trends, partly also to keep your site looking fresh. Perhaps every couple of years or so.

If you have a site that runs into the hundreds or thousands of pages, you have to find a way to make this task easier -- i.e. use templates of one sort or another. As CSS continues to develop, it will in future become easier to separate design from content, and this is a text-book example of why this separation is necessary. Together with includes (SSI, PHP or whatever) and whatever tools you care to invest in that allow you to do things like global search-and-replace, you need to design a site of that size in a way that it can be easily maintained and updated.

So yes, you should make those changes wisely, and now, before you get to the 10,000 stage and suddenly all those deprecated tags cease to be supported at all.

Nick_W

3:32 pm on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Agreed!

I think templates are just the coolest thing. You create a header, footer, navigaiton in seperate files and then just use them on every page. Then you only need worry about the actuall content you put in them in terms of updating.

Anything else can be changed global across thousands of pages in the time it takes to edit one page ;)

Curreintly I use PHPLib but will be moving to Smarty with the next big project...

Nick

Reno

7:50 pm on Jul 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"Or just take any big website that has thousands of pages, is the author supposed to go back and revalidate all his pages to make them valid."

Isn't there a way to use a "search + replace" utility to do all this very quickly?

For example, you'd tell it to search every page in a folder for:

<html>
<head>

And replace it with:

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

If this would work as easily as I describe (admittedly I've never tried this), then it would be considerably less time consuming, and could possibly make a difference in how the pages are rendered. It is my understanding that there are "search + replace" freeware utilities available for such a project - might be worth checking out...