PDA

View Full Version : validation error message


fasttempo123
06-21-2006, 09:15 AM
I got below message when validate my html page:

The tag: "img" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.

Any idea why and how to fix it?

dthomsen8
06-21-2006, 10:53 AM
I got below message when validate my html page:

The tag: "img" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.

Any idea why and how to fix it?

Apparently you have a DOCTYPE specifying HTML 4.01, and somewhere you have an "img" tag in a line with incorrect syntax. It might be a line ending in "/>" in XHTML syntax, but that is only a wild guess. It also might be that you have an incorrect DOCTYPE.

Without a URL or the code, it is impossible to say anything more. At least you are attempting validation, and trying to learn from the messages.

fasttempo123
06-22-2006, 10:49 AM
I got below message when validate my html page:

The tag: "img" has an XML style closing syntax for an empty element even though version: "HTML4" is not an XML tag language.

Any idea why and how to fix it?

Apparently you have a DOCTYPE specifying HTML 4.01, and somewhere you have an "img" tag in a line with incorrect syntax. It might be a line ending in "/>" in XHTML syntax, but that is only a wild guess. It also might be that you have an incorrect DOCTYPE.

Without a URL or the code, it is impossible to say anything more. At least you are attempting validation, and trying to learn from the messages.

You are very right that "/>" is causing the error message as I validate my page, that is created as transitional XTHML, against HTML4.0. I change the validation setting to transitional XTHML and all errors are gone now. Not sure this is the right thing to do though.

Thanks for your help.

dthomsen8
06-22-2006, 11:38 AM
[
You are very right that "/>" is causing the error message as I validate my page, that is created as transitional XTHML, against HTML4.0. I change the validation setting to transitional XTHML and all errors are gone now. Not sure this is the right thing to do though.

The right thing to do is to be consistent. Develope with XHTML and use it as the DOCTYPE and you will be fine, and the purists who insist on being on the latest thing will applaud you. Millions of web sites are now in HTML 4.01 in various flavors, and that works just fine if it is valid code, even if it is to an obsolete standard.