Jump to content

Error in XHTML tutorial.


varun

Recommended Posts

Sir,I have noticed an error, although how small it maybe, and have decided to inform about it to you. While I was reading the XHTML tutorial, I found an erroneous coding at http://www.w3schools.com/xhtml/xhtml_syntax.asp. The error was here:This is a minimum XHTML document template:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Title goes here</title></head><body>Body text goes here</body></html>I validated this template and found a silly error i.e. 1. Error Line 8 column 0: character data is not allowed here. Body text goes here You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>paragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).In a nutshell, you forgot to add a paragraph tag before the body text as it says that no text can be directly entered into the body tag.Although it was a small error but I wanted it to get into your awareness if you might consider correcting it to meet the W3C Standards.Regards,Varun

Link to comment
Share on other sites

The reason W3Schools didn't add it is because the minumum document doesn't requre exactly a paragraph. It could be any block level element. Div, h*. I think lists are also allowed.Perhaps it would be better if they use:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Title goes here</title></head><body><!--Body text goes here--></body></html>

Link to comment
Share on other sites

Perhaps it would be better if they use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Title goes here</title></head><body><!--Body text goes here--></body></html>

Yes, I suppose that would be better. Thank you for the link Jonas.
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...