Invalid "self-closing element not allowed" JavaDoc error

David M. Lloyd david.lloyd at redhat.com
Fri Jul 26 13:49:59 UTC 2013


On 07/26/2013 08:23 AM, Stephen Colebourne wrote:
> On 26 July 2013 13:58, David M. Lloyd <david.lloyd at redhat.com> wrote:
>> On 07/26/2013 04:39 AM, Stephen Colebourne wrote:
>>>
>>> Its websites and
>>> browsers that define what should be accepted as HTML, not standards.
>>
>> This is the craziest thing I've read all week.
>
> What percentage of the worlds websites contain valid HTML/XHTML
> according to the DOCTYPE/validator?
>
> I'd be amazed if its more than 1%.
>
> The Oracle home page, java.net, java.com and J2SE download page all
> fail validation. Yet all are perfactly usable websites.
> RedHat:
> http://validator.w3.org/check?uri=http%3A%2F%2Fredhat.com&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices
> JBoss:
> http://validator.w3.org/check?uri=https%3A%2F%2Fwww.jboss.org%2Foverview%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices
>
> Tim Berners Lee said in the linked article: "Some things are clearer
> with hindsight of several years. It is necessary to evolve HTML
> incrementally. The attempt to get the world to switch to XML,
> including quotes around attribute values and slashes in empty tags and
> namespaces all at once didn't work".
>
> This isn't Java EE. HTML is a space where standards are a *guide*. I
> absolutely stand by my statement.

You took one step outside of logic, in my opinion.  Yes, the spec is a 
guide, in practice.  But to use that to justify not even trying to 
conform or not encouraging people to conform is crazy.  Without the 
spec, the HTML world would be even more insane than it is now, by orders 
of magnitude.

It is very likely that browsers will accept spec-compliant HTML.  It is 
also very *unlikely* that your average user will be arsed to test their 
HTML on every browser on the planet before they publish their JavaDoc. 
It is also unlikely for your average Java developer to know or 
understand *any* of these issues; you're giving them way too much credit 
IMO by assuming that they're simply imposing some kind of rational 
style, rather than simply not knowing how HTML works.

In the end I think it does far less harm to bark at people who are not 
writing spec-compliant HTML than it does to assume they know what 
they're doing and what the implications are.  If doclint doesn't enforce 
this kind of strictness, then what will?
-- 
- DML



More information about the core-libs-dev mailing list