- From: <www-validator.ttancredi@spamgourmet.com>
- Date: Thu, 12 Jan 2006 09:07:13 -0600
- To: www-validator@w3.org
I came across this old message thread. I would be interested in your critique of my views below. > in XHTML (which you have decided to use) all elements > must be explicitly closed with end tags I wish that this were true. But if it were, XHTML would not have the option that the message mentions and you expound upon use what the message calls "self-closing", i.e. use a tag that acts both as an opening and as a closing tag > The message is somewhat misleading I agree. The message does not sufficiently recognize that XHTML is an unhappy mix of XML and HTML. The message correctly cites the XML reason for rejection: unclosed element. But the message suggests a valid XML prescription, which is an invalid XHTML prescription. In XML you cannot leave an element open. You have 1 way (that applies to every element) to close an element: close the element by using an end tag. You have 1 way (that applies only to an empty element) to close an element: open and close the element by using an empty element tag. In HTML you CAN leave an element open. Not always, but most common constructs automatically close an element. You cannot close an empty element by using an end tag. Therefore, you have no way (that applies to every element) to close an element. You have 1 way (that applies only to an empty element) to close an element: open and close the element by using an empty element tag. meta is an empty element. For compatibility, XHTML retains the HTML rule that you cannot close an empty element by using an end tag. There is only way to close a meta element that is valid under both the XML rules and the HTML rules: open and close the element by using an empty element tag. The error message eventually suggests the correct prescription: the self-closing element a.k.a. the empty element. It would be nice if the validator distinguished between elements defined as empty and elements not defined as empty. Then the validator could give the best prescription for either case. > it confuses tags with elements Conceptually maybe. But in the special case of an empty element tag, the tag and the element consist of the same string of characters. Tony Tancredi
Received on Friday, 13 January 2006 01:55:13 UTC