Jump to content

XHTML validation


jose_mpereira

Recommended Posts

I made a simple XHTML page with XHTML strict DTD. In this page, I have put force some XHTML erros, like unclosed tags, attributes without quotes. When I open this page in a browser like IE or Firefox, they doesn't show any errors. Is it ok?? If it is, what are the porpose of XHTML validation?

Link to comment
Share on other sites

Browsers have always been made to try and ignore errors and display what they "think" you mean. But it doesn't mean the page is correct. This is the main reason why some pages look fine on IE, and look broken everywhere else. It is best to write code that validates because it will remain portable into the future. Also, it's just not a good practice to get in the habit of writing invalid code, be it HTML or XHTML.

Link to comment
Share on other sites

All browsers are build upon HTML, which is all forgiving. This way, using Xhtml strict is only nice in use and neat, but it is not strict for the browser, even if you leave the root element, or all the body structure, it would still not cause any errors. It should stay that way, for backwards compatibility, when someone wants to use yet still html. :)There is no purpose in Xhtml for the browser itself, it works the same. The only difference is for the user, who receives neat Xhtml source code, easier to read than html. That is what I think of it, there may be actual purposes, I don't know everything :)

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
×
×
  • Create New...