Re: html5 syntax - why not use xml syntax?

Hii Phillip,


On Jul 7, 2007, at 7:16 AM, Robert Burns wrote:

>
>
> On Jul 7, 2007, at 7:04 AM, Philip TAYLOR wrote:
>> Ben Boyle wrote:
>>
>>>  Isn't it possible to have compatible syntax already?
>>>  Is there any XHTML syntax that is invalid in a HTML document?
>>>
>>>  Do any of these cause problems in HTML? Is this valid?
>>>  <input type="radio" name="foo" value="bar" checked="checked"/>
>>
>> The slash ("/") terminates the tag [1], and
>> the following close-angle-bracket (">")
>> becomes character data.  No browser of which
>> I am aware displays the close-angle-bracket,
>> but all should if the document is served
>> as text/html.  Even worse is that the
>> character data implicitly closes the
>> <head> element if it is used therein,
>> and thus if (for example) the following
>> occurs in the <head> region :
>>
>> 	<link ... />
>> 	<script ...>
>>
>> the <script element> is treated as the
>> start of <body> matter.
>>
>> [1] http://www.thewebcreator.net/2007/04/16/why-you-should-be- 
>> using-html-401-instead-of-xhtml/#net
>
> I don't think that's correct. What UA are you testing this in? I  
> don't find those types of problems in the DOM when serialized from  
> text/html.
>
> I've tried WebKit and Gecko and neither of them exhibit these  
> problems. There has been a lot of confusion floating around that  
> SGML parsers referencing a particular DTD might exhibit these  
> problems. However, as  others have said already, web browsers and  
> most other HTML UAs are not SGML based applications.

I hadn't followed the link when I replied earlier. That article is  
one of those articles I was talking about, that contribute to the  
confusion (xhtml syntax wants to kill you and everyone you care  
about! hear the details at 11!). The mistake is thinking that HTML is  
SGML the / solidus (/) can potentially serve as an element terminus  
in SGML, if the DTD allows for it. However, HTML UAs do not follow  
SGML strictly. If they did, the solidus termination would still  
depend on the HTML DTD: including a potential HTML5 DTD, if we  
changed gears and went with an SGML serialization. There's no reason  
our DTD couldn't ensure the solidus was not treated as a element  
terminator if we went that route.

Take care,
Rob

Received on Saturday, 7 July 2007 12:33:14 UTC