Re: [Bug 6777] In HTML documents, no-namespace expression must match http://www.w3.org/1999/xhtml nodes

On Apr 6, 2009, at 18:31, bugzilla@wiggum.w3.org wrote:

> Just to answer a couple of your points and questions, and then let's  
> take it to
> private e-mail or whatwg or some such since a bug tracking system  
> isn't the
> right place for a debate.

CCed www-archive.

> The specific step I would like to see happen is for HTML 5 to  
> mandate namespace
> well-formedness and require draconian error handling.

That's not feasible, because any browser implementing Draconian  
handling would lose market share.

> I am simply not convinced by the numerous arguments made against  
> that simple step.

If you are not convinced by the all-encompassing mess that text/html  
is that it can't be processed in a Draconian way in the general case,  
I don't know what I could say to convince you.

> However I realize that this is not the direction the WhatWG is going  
> to go.
> Fine. Maybe you're even right. In that case, I want the WhatWg to stop
> pretending that HTML is really XML and that it can use XML-specs  
> like XPath. It
> can't. They don't work with non-namespace well-formed documents.  
> Please stop
> trying to pollute useful, relatively sensible specs like XPath 1.0  
> with ugly
> kludges to support one special case.


Pretending that the data models of XML and HTML are more different  
than they are is what caused the architectural inconsistencies in the  
first place. The trees aren't really that different, and it's silly to  
maintain gratuitous differences between the namespace and the local  
name case between the HTML and XHTML trees. And XML technologies other  
than parsers operate on the trees--not on the syntax that goes over  
the wire making those technologies applicable to trees originating  
from text/html bytes as well.

If you parse text/html into a XOM tree using the Validator.nu HTML  
Parser, you can use XPath on the tree if you write your expressions so  
that the element name expressions are in the http://www.w3.org/1999/xhtml 
  namespace. That's how I want things to work in browsers, too, in the  
future: that you can write unified http://www.w3.org/1999/xhtml-namespace 
  XPath expressions that work on both HTML and XHTML DOMs.

However, the document.evaluate() API has been out there for a long  
time. A browser that ships the document.evaluate() API must make no- 
namespace expressions match HTML nodes for compatibility with existing  
content. If document.evaluate() hadn't been shipped yet, we could  
change this, but the cat is already out of the bag.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Monday, 6 April 2009 16:33:55 UTC