Jump to content

How Critical Is Validating For Html/xhtml?


Web Weenie
 Share

Recommended Posts

I just tried to validate some of my finished web pages. While I fixed a whole lot of issues I can't seem to squash all the validation hiccups, so no validation... I've validated my CSS and all went well for those.I've tested my pages in all browsers that I care about... My site is Mac centric so I really don't care how it looks in IE as there is nothing for PC users there. Should I try to resolve these last issued and pass validation or just call it good enough. I'm guessing the hard core coders out there will say I must, but I'm not sure there is any value in chasing down the balance of the problems.Am I wrong? or is this a must... Please provide good reasons for getting my pages to validate, if there are any.Keep in mind if the answer is yes validate, then I might be back for assistance in the more stubborn ones.Thank you in advance...

Link to comment
Share on other sites

What are the validation errors?
hey student101, I really appreciate your tenacity...I fixed many of the 150+ errors from the validation log. Some were warnings. Others were missing <img> alt tags and the such. There were no missing closing tags or Table elements missing, added or out of order. The remaining ones just didn't make sense, like the closing bracket of a <form> tag even though it was clearly there... I think it is related to a previous error and the validation offset code went off the rails.I decided to take my most complicated page and run it through Tidy. It stripped out every graphic that I had used as a background table or table cell image. It took me several hours to reconstruct the tidied page with the images in my css file.Oddly enough this fixed several minor layout problems, but also caused a major layout problem. Since this page has the same header and navigation bar, plus the footer area in common with all the other pages, fixing the rest of my pages shouldn't be too much effort (I'm really hoping on this). I haven't fixed the layout problem yet and I'm done for the evening.I may be seeing what I want to see so I'm not 100% sure on this, but I think the page loads quicker now. The true test is uploading to my server and flushing my browsers cache to see how long it takes to load from scratch. I'll post my results when I know.I'm teaching tomorrow so I would have time to work on this till after 6mp psd.
Link to comment
Share on other sites

Well, you'll probably find you have less layout problems if you get your page validating. Remember, validation isn't some sort of magic - there are certain rules that you have to follow, and that's it!

Link to comment
Share on other sites

Well one rule that I just learned the hard way is don't screw with it after its working... 'F' validation! I've spent over 12 hours trying to fix things after tidy hosed a vary complex page and it produced more validation errors that before. My only resort left is to start all over as I have nothing but a mess that I can't fix now.While there may be rules to follow, rules were meant to be broken. I will never try to validate or care about validation again... This has set me back about a week now. I can't believe I fell for this... Guess I answered my own question.

Link to comment
Share on other sites

Well one rule that I just learned the hard way is don't screw with it after its working... 'F' validation! I've spent over 12 hours trying to fix things after tidy hosed a vary complex page and it produced more validation errors that before. My only resort left is to start all over as I have nothing but a mess that I can't fix now.While there may be rules to follow, rules were meant to be broken. I will never try to validate or care about validation again... This has set me back about a week now. I can't believe I fell for this... Guess I answered my own question.
One thing I learned is never let a validator try to fix a page for you. :) Look over the errors it gives you and try to fix them yourself. And you should care (at least a little) about validating your page because it will make it that much more cross browser friendly. Edited by jkloth
Link to comment
Share on other sites

Why haven't you already tried giving us a link to the page? Surely, we'll be able to show you what to fix.

Please provide good reasons for getting my pages to validate, if there are any.
Interoperability a.k.a. cross browser compatibility. Validation doesn't make your site interoperable on its own (you still need to squash browser bugs), but it is basically a must for it to happen.Arguably, the same compatability can be achieved with no DTD and no validation at all (i.e. in Quirks mode), since browsers try their best to parse old pages in the same way. However, if later you encouter a browser incompatibility (and you WILL), trying to fix the bug will be nearly impossible, as among all the known browser bugs, you'll also have to add the possibility of a parsing difference (which is impossible to detect), caused by the invalid code or a browser specific behaviour in quirks mode (which is not officially documented). Also, most browsers disable newer CSS and JavaScript stuff, again in order to keep compatibility to its maximum. Want querySelectorAll()? Forget it! Want :hover on all elements? Only on some browsers. min/max-width/height? No!
Link to comment
Share on other sites

Well thanks everybody... but I'm not getting anywhere near that quicksand again. I've tested my pages in Safari, Firefox, Chrome, and Opera. I'm happy with what I had. After I rewrite my hosed page, I also check with those browsers again but I don't give a damn about validating... I've done more harm than good by trying. All pages are local and I'v not posted them to a server yet, hence no link to show you. I'll be licking my wounds for a while before I can continue to move forward on this project.

Link to comment
Share on other sites

that's how we learn. For your next project, do as jkloth recommended and start validating from the beginning. I would bet that's what most of the people around here do.

Link to comment
Share on other sites

Why did you overwrite your only copy with the result of some machine transformation in the first place? Backups are always a good idea. And anyway, shouldn't you be trying to learn the basics before taking on complex time-bound projects?Reasons for validation? Also accessibility, speed (because browsers don't have to try to figure out WTH you mean), and search engine friendliness (so they can tell what your pages actually say), DOM compatibility for scripting.

Link to comment
Share on other sites

There has been some good albeit obvious advice posted here. First I'll admit I did some stupid and amateurish mistakes in this whole mess, and frankly I'm not as dumb as probably look regarding this post.This project is a cluster 'F' of many issues. Most obvious is my inexperience in validating issues. The validator did alert several alt's missing from img tags, but it also spawned over 100 false and nonsensical errors such as a & character where there was none it also complained of missing < or > in many places which were there. As far as I could see, except for the missing alt's I had no other issues. I went into panic mode and it went down hill from there.Validating is important for IE because it's a mess. Since my visitors are mostly using Safari and maybe Firefox, this is the area I focus on. I also checked with Opera and Chrome. Everything worked fine in those. I can't even test in IE...But from my perspective I will not wander off into validation land... bad and evil creatures live there and nothing good can come from it.

Link to comment
Share on other sites

But from my perspective I will not wander off into validation land... bad and evil creatures live there and nothing good can come from it.
:) I would really love to be able to see what the errors actually are. When a webpage is done well, validating should not be this big of an issue as you are making it out to be, or else none of would be espousing how beneficial it is. I wouldn't dismiss it based on you're lack of comprehension with the language or being able to diagnose simple error messages. Continue on in whatever way you want to, but validation is more than fixing missing alt tags and ampersands. Perhaps in the future it will make more sense, but the service is there for a reason, with many of those reasons being already explained. I wish you luck though. If you cannot miss the forest for more than just the trees, I guess there will never be anyway to convince you otherwise. Edited by thescientist
Link to comment
Share on other sites

Validation is not nonsensical - maybe you were just not able to understand the validator's information? And validation is definitely not for just "making it look good in IE" - unless you want a non-accessible non-ranked slow buggy un-script-able and very very hard to maintain web page, I seriously suggest actually trying to learn and understand the concept of validation, before dismissing it as "nothing good" based on your, well, inexperience.

Link to comment
Share on other sites

It would also be worth pointing out that most people on the board are slightly hesitant to assist with pages that are full of validation errors.

Link to comment
Share on other sites

It would also be worth pointing out that most people on the board are slightly hesitant to assist with pages that are full of validation errors.
"slightly" he says :) (and that applies to pretty much any board BTW, not just this one)For the ampersand error, I think I know the kind of error you're talking about... the error shows you the position on the line where it expected ";" (a.k.a. the REFC delimiter), but didn't found one... seems unrelated, but once you get to learn XML (and XML entities in particular), you may understand. For now, just take that, for example:
<a href="?var=value&another=anotherValue">...
Must instead be
<a href="?var=value&another=anotherValue">...
Assuming this erronous element started at column 1, the validator should output
Line XX, Column 21: cannot generate system identifier for general entity "another"

(column 21 is the character right after the ampersand)And one other error that must appear is

Line XX, Column 28: reference not terminated by REFC delimiter

In fact, try this in the validator:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title>TEST</title></head><body><div><a href="?var=value&another=anotherValue">...</a></div></body></html>

The validator will output 3 Errors, 4 warnings, just because of this single "&". Replacing the "&" with "&" is going to make the document valid.

Link to comment
Share on other sites

Well yes, I had several of those, but I fixed them all. It was actually reporting them in lines that didn't even contain & or &... Even worse it would report a missing closing bracket or opening bracket in html tags. This is why I called them nonsensical errors.I think the problem might be my old version of Dreamweaver. It wants to constantly reformat my source files. I'll group a segment of HTML code blocks for readability. Each time I run the file to see in a browser it reformats the code. Drives me crazy! I'm thinking the line numbers are getting whacked in the validator and the stacking of html throws off the validator with respect to <'s and >'s. Either way I know it was no way near as bad a what was being reported. I'm not saying it was perfect but without an accurate way to report the errors properly it was useless to me.That's my story and I'm sticking to it. :-)

Link to comment
Share on other sites

*cough* the validator doesn't make mistakes :)Why don't you post your code, and we'll tell you what the problems really are! :)

Link to comment
Share on other sites

Although a novice, I think validating from the beginning of coding and throughout the project is best practice. Seeing, and correcting, errors is a great way of learning. I also like the "HTML Tidy" feature- even though it inserted some XML (CDATA) into my code, thoroughly confusing me because I haven't learned XML yet. Now I see how the CDATA command can help to avoid errors. I think that's why it was inserted in my CSS code...?I'll be using this validation service just about as often as I save my work; it should be routine. I do love to see that green bar.To add, a friend who is an advanced programmer told me to not use dreamweaver- that it "bloats" code. He said using a simple text editor is the best way to clean code. I chose TextMate for the Mac. Maybe Web Weenie can use the output of "HTML Tidy" and see how it runs? Worth a shot, I think.

Edited by yertle
Link to comment
Share on other sites

I'll be using this validation service just about as often as I save my work; it should be routine. I do love to see that green bar.
Indeed! :)Well said yertle. And welcome to da boards! Don't forget the Strict DTD and you're off and running! Good noob :) Edited by thescientist
Link to comment
Share on other sites

http://w3schools.invisionzone.com/index.php?showtopic=30376And there we have a person who had a cross browser issue, and fixed as soon as he validated his pages. A prime example :) .(Note: The link to the site was removed by thehappyappy himself, but since the site is commercial, that's more than OK with us, the mods.)[edit]Scratch that... I found the page from my history, and revalidated it. It's still invalid, even though the issue he talked about is fixed. Still, he has fewer errors, so that tells you parsing errors do cause incompatibilities.[/edit]
Link to comment
Share on other sites

Thanks thescientist!I have fixed it now and it gets strict DTD validation.However, after the fix, a minor layout issue was introduced. In the body, I have a blue wave graphic, followed by a paragraph with background image, followed by another blue wave graphic.After I made changes to get strict DTD validation, a very small space was introduced between the top blue wave graphic and the body paragraph (yellow background). It is a little hard to even see. My intention is to have these two elements perfectly flush, with no space in between.If anyone could help me eliminate the teeny space?It is an extremely simple page. I gutted it from it's previous incarnation and am starting again from scratch, validating all the way.http://www.djisaacm.com

Link to comment
Share on other sites

Try to explicitly give the img element(s)

padding:0;margin:0;

It seems that while there is no space between the div and the p, there may be some space between the div and the img, which is set so by default.When your pages are valid, you go into Strict rendering mode, in which you'll notice some differences if you've relied on certain browser bugs before.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...