[whatwg] Empty elements

Simon Pieters simonp at opera.com
Mon Aug 29 03:10:03 PDT 2011


On Mon, 29 Aug 2011 12:02:49 +0200, Jukka K. Korpela <jkorpela at cs.tut.fi>  
wrote:

> 29.8.2011 12:24, Simon Pieters wrote:
>
>> <p></p> is an empty element since it has no content, but p is not a void
>> element.
>
> All previous HTML and XML specs have used the term "empty element" tp  
> denote an element for which the syntax allows no content. So what's the  
> compelling reason for changing that?
>
>> Maybe void isn't a great term, but empty isn't either.
>
> In which way is "void" better than "empty"?

The sentence "<p></p> is an empty element since it has no content, but p  
is not an empty element." is more confusing.


>>> Is there any way to tell validator.nu or the W3C Validator in HTML5
>>> mode to apply XHTML rules when submitting a document via a text field
>>> or via file upload?
>>
>> In http://validator.nu/ you can choose "XML" or "HTML" under Parser.
>
> Oh I see. Still, I'm still confused. Having selected "Preset" as  
> "HTML5", I can choose between different parsers, like HTML 4.01  
> Transitional and HTML 4.01 Strict. I would have expected a simple menu  
> with two options "HTML" and "XML", maybe with the latter divided into  
> with/without external entities.

http://bugzilla.validator.nu/

>>> Is there any requirement on such a distinction?
>>
>> About what?
>
> About a validator - as HTML5 sets requirements on them, it would appear  
> to be natural to require that they allow a document to be validated  
> either as HTML-serialized or as XML-serialized.

I don't think the spec has such requirements.


>>> When validating via URL, the W3C Validator (in HTML5 mode) indeed
>>> accepts <p /> when Content-Type: application/xhtml+xml. However,
>>> validator.nu responds:
>>> IO Error: Non-HTML Content-Type: application/xhtml+xml.
>>>
>>> This is getting rather confusing...
>>
>> I guess you chose the "HTML5" parser in validator.nu,
>
> Yes, that's what I must've done. I wonder how one is supposed to guess  
> that "HTML5" here means HTML serialization - isn't HTML5 defined to be  
> something that has two serializations? And I'm used to seeing "IO Error"  
> as relating to failures in data transfer, like broken Internet  
> connection or disk failure, not to higher-level protocols.

http://bugzilla.validator.nu/ :-)

-- 
Simon Pieters
Opera Software



More information about the whatwg mailing list