W3C home > Mailing lists > Public > www-validator@w3.org > November 2005

Re: [VE][62] Error Message Feedback

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 01 Dec 2005 02:27:51 +1100
Message-ID: <438DC4F7.7070906@lachy.id.au>
To: swenis@communitywebdesign.com
CC: www-validator <www-validator@w3.org>

Wenis wrote:
> Validating http://www.communitywebdesign.com/Error [62]: "X invalid:
> only S separators and TAGC allowed here" [
> 
> If you can open a tag with a CLASS or ID selector, why can't you 
> close it with a CLASS or ID selector as well?

Because it's not defined in the formal syntax rules for HTML and XML 
documents and the validator follows those rules as closely as possible.

> I have trouble discriminating one </DIV> from another </DIV>.  To 
> avoid this, I integrated the CLASS or ID selector into the tag 
> closer, for example: </DIV> </DIV> becomes... </DIV 
> CLASS="main_content"> </DIV CLASS="frame">.

Although that might make sense to you from an authoring point of view 
when you're looking at the source code, what would it possibly mean for 
an XML or HTML parser?

> Unfortunately, the HTML 4.01 Strict validator does not agree with 
> that coding.  The alternative is to use </DIV><!-- main_content --> 
> and </DIV><!-- frame -->.

That is one alternative.  Other alternatives include:

* Reduce the number of div elements in your document.  Overuse of
   them is a common bad authoring practice among beginners and is
   often referred to as div-mania, divitis, etc.
* Use an editor that highlights matching start- and end-tags for you.
* Use an editor that will collapse fragments of markup to remove
   clutter from the screen.
* Use appropriate indentation to clearly show the nesting level.

> However, I think </DIV CLASS="main_content"> is a much more elegant solution.

I don't agree and you're the first one I've ever heard of making this 
request; but there's nothing that can be done about it anyway.

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Wednesday, 30 November 2005 15:30:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:20 GMT