W3C home > Mailing lists > Public > www-validator@w3.org > May 2009

Re: 1 element becomes 2

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 20 May 2009 20:54:58 +0300
Message-ID: <983FD90B8874414DA80659CBCE7CFAF3@JukanPC>
To: "Hannes Kirsman" <hkirsman@gmail.com>, <www-validator@w3.org>
Hannes Kirsman wrote:

> is this a bug of firefox or w3c validator?

No, it's an error in your document. Technically, it might not be an error 
(impossible to say without a URL), but in that case it's a matter of your 
misunderstanding.

> I have <a href="" /> tag

Why?

You should not use XHTML in the first place, unless you really know what you 
are doing, and 99% of XHTMLers don't.

Even if you use XHTML, you should not use self-closing tags for anything but 
elements with EMPTY declared content, as both XML and XHTML specs say. If 
you didn't understand this, you _surely_ should not use XHTML!

> and firefox shows 2 a tags.

It internally parses the tag as equivalent to <a href=""></a>, which is the 
correct parse (and, as an element, makes no sense under any normal 
conditions - a link with empty link text).

> W3C validator says all is ok.

That's because it's still basically a validator and only reports violations 
of formalized syntax rules. It says "ok" for a large variety of documents 
that violate HTML specifications, or are poorly written, or just don't make 
sense. That's because its "ok" is just a statement about lack of reportable 
markup errors.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Wednesday, 20 May 2009 17:56:45 GMT

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