Re: [VE][62] Error Message Feedback

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 UTC