Fixing errors returned by the W3C Validator article By Adrian Rayfield
Last edited: 25.11.2006
W3C validation made easy
How many of you have decided “Right! I'm going to validate my pages with the Markup Validation Service from the W3C?” You head off to http://validator.w3.org/, type in your URL and wait for the returned results.....
You think you may have one or two errors, but wait, here come the results, Over 300 errors on a page that only has 150 lines of code! You take a deep breath and start to read the error list. Now you have a choice.
1) Do you think this will take too long to fix and aren't that bothered!
Or do you
2) Decide to tackle the errors and have a valid compliant page?
If the answer is 1, then you maybe should leave now (but don't as you may find the rest of this article interesting) if your answer is 2, then you have made the correct, wise and sensible choice.
Many people have gone through the scenario above and made a choice; well even I did a few years back. Fear not, those 300 plus errors will vanish before your eyes in no time. Trust me.
I know you're thinking , 'How can they disappear?' Well you'll be amazed! Firstly take a look through the errors; you may spot a simple error you can fix right now, then once you've done that, re-validate, how many errors have gone now, just the one, or more?
I have in the past validated a page I thought was valid XHTML 1.0 strict only to find it failed validation, I was amazed but fixed the first error on the list as it was a simple error of a missed closing tag, I re-validated and hey presto, it passed!
What had happened was this one error had a knock on effect on the remaining code that came after it . Fixing this error removed the 50 or so errors.
So the moral of this story is, don't get put off by the results, work through them and re-validate regularly as by fixing one error may fix several or all of them.
I know that when you validate a page and get a report back in can seem very daunting, but persevere with it, you will get there!
The new interface of the W3C validator not only shows the errors, it also shows warnings and information, it now also sports a new colour scheme to make things even clearer.
Happy validating!
Don't forget to validate your CSS also - CSS Validator.
Article written and copyright held by Adrian Rayfield of Rayfields Accessibility © 2006.
Did you find this article / tutorial useful, please give us your comments.
For more information on Rayfields Accessibility Consultancy and Web Development Services please contact us by telephone on 0845 0037 508 or email : accessibility@rayfields.co.uk.