[whatwg] Empty elements

On Sun, 28 Aug 2011 19:45:50 +0200, Jukka K. Korpela <jkorpela at cs.tut.fi>  
wrote:

> 28.8.2011 17:52, Aryeh Gregor wrote:
>
>> "Void" is correct:
>>
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#void-elements
>
> I see. What a pointless and confusing change (from HTML tradition and  
> SGML usage). "Empty" is descriptive (an element that has no content, or  
> has empty content), whereas "void" suggests associations like "null and  
> void" or "void pointer". This is about elements that are very real and  
> meaningful, instead of being "void" in any normal meaning - they just  
> express everything they can express by their name and attributes

<p></p> is an empty element since it has no content, but p is not a void  
element.

Maybe void isn't a great term, but empty isn't either.


>> Documents served with a text/html MIME type must obey the HTML syntax
>> rules, not XHTML.  I couldn't find where the spec says this
>> normatively, but there's an informative note at the top of the HTML
>> syntax and XHTML syntax sections.
>
> So does this mean that the rules are, after all, different for HTML  
> serialization than for XHTML serialization?

After all? They have always been different...


>> If you're serving a document with an XML MIME type,<foo></foo>  is
>> equivalent to <foo />  for any value of foo.  The validator won't
>> distinguish and neither will UAs, so use whichever you please.
>> They're entirely different with an HTML MIME type, and that cannot be
>> changed at this point due to compatibility.
>
> 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.

> Is there any requirement on such a distinction?

About what?

> 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, which will not  
accept an XML MIME type (you need the XML parser for XML). I think the W3C  
validator doesn't have a way to choose between XML and HTML in "HTML5  
mode", it will decide from the MIME type (dunno what it does for file  
upload).

-- 
Simon Pieters
Opera Software

Received on Monday, 29 August 2011 02:24:06 UTC