W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2009

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

From: <bugzilla@wiggum.w3.org>
Date: Mon, 06 Apr 2009 15:35:04 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Lqqqm-0006o6-8p@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=6777





--- Comment #14 from Michael Kay <mike@saxonica.com>  2009-04-06 15:35:03 ---
>What would be the best way to approximate the behavior of an XPath 2.0 processor with the http://www.w3.org/1999/xhtml namespace as its default namespace and with the Compatibility Mode set to true in a processor that is otherwise only an XPath 1.0 processor?

You can't. XPath 1.0 says that an unprefixed QName in the XPath expression
matches only elements that are in no namespace. That is, //p guarantees to
return a set of elements having local-name()='p', namespace-uri()=''. That's a
fundamental invariant of XPath 1.0 and can't be changed in a conformant
implementation. If you want to change that invariant, then you are inventing a
language that is not XPath 1.0.

It's of course high time that browsers and the DOM moved forward to XPath 2.0,
in which case they could take advantage of new facilities in XPath 2.0, like
the ability to define a default namespace for unprefixed element names. That
still wouldn't achieve compatibility of course - the only way to ensure that
the expression //p[namespace-uri()=''] continues to return the same result that
it does now is to map your HTML5 DOM to an XDM instance (or the XPath 1.0
equivalent) in which the p elements are in no namespace. Since you're so
concerned about compatibility, I can't see why you are so reluctant to do that.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 6 April 2009 15:35:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:27 UTC