Re: html5 syntax - why not use xml syntax?

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.

Philip Taylor

[1] http://www.thewebcreator.net/2007/04/16/why-you-should-be-using-html-401-instead-of-xhtml/#net
--------
> 
> What about <?xml prolog, @xmlns, @xml:lang?
> 
> I have noticed the W3C HTML validator is confused by <link ... /> and
> <meta ... /> empty tags, but had assumed it to be a valiator bug.
> 
> 
> 
> On 7/7/07, Robert Burns <rob@robburns.com> wrote:
>>
>>
>> On Jul 7, 2007, at 3:59 AM, Mynthon Gmail wrote:
>> > My idea is to have compatible syntax, but xhtml is xhtml with its
>> > own parse and html is html with its own parser. Only syntax is
>> > unified.
>>
>> That does seem like the right thing to do for authoring conformance.
>> I have a hard tim thinking of any cons for that. Of course there
>> would still be HTML 4.0,1 HTML 4, HTML 3.2, etc. — all handled by the
>> same HTML parser — along with HTML5. But its hard for me to think of
>> downsides to just requiring of authors a very XML-like syntax for
>> HTML5's non-SGML / non-XML serialization. We would still need to deal
>> with issues of implied elements (e.g., <colgroup> and <tbody>) and
>> perhaps some escaping issues when moving between XML and HTML5
>> serializations.
>>
>> What do other think about this proposal?
>>
>> Take care,
>> Rob
>>

Received on Saturday, 7 July 2007 12:04:47 UTC