[Bug 7059] Forking XPath

http://www.w3.org/Bugs/Public/show_bug.cgi?id=7059





--- Comment #31 from Jonathan Robie <jonathan.robie@redhat.com>  2009-09-10 14:54:48 ---
(In reply to comment #29)

> Isn't that what any delta spec does?

HTML5 should not be a delta spec for XPath 1.0. If it were, that would be
forking XPath.

> I disagree. I think the way the spec is currently worded requires the least
> amount of thought on the behalf of the implementor who is hacking the delta to
> an existing XPath 1.0 implementation. After all, what's in the spec in the
> implementation delta that is needed (with or without the edit from rev 3765).
> If even you can't immediately see if your wording matches this delta, your
> wording isn't obvious enough.
> 
> Invoking the concept of "default namespace" doesn't make sense, because it is
> an XPath 2.0 concept and HTML5 is specifying a delta on top of XPath 1.0.

The advantage of invoking the concept of a default element namespace is that
XPath 2.0 - which is the successor of XPath 1.0, not a private fork - already
uses this concept to provide the functionality you want to provide using a
different concept.

I think there are some issues with your current wording, and it is easier to
adopt wording like what I suggested in comment 18 than to fix this - let me try
to explain.

* The name expression has no namespace.

There is no such thing as a "name expression", you mean a NameTest. I think you
mean to say "The NameTest has no prefix".

* The name expression has local name that is a match for local.

I think you mean to say that the local part of the NameTest matches the local
name 'local'.

* The expression is being tested against an element node.

I would describe this in terms of what the NameTest specifies - the default
element namespace is used for an unprefixed QName appearing in a position where
an element name is expected.


If I make those changes to both bullet lists in your spec, then the first
bullet list says that unprefixed NameTests for elements in an HTML document
must match elements in the HTML namespace, and the second bullet list says that
unprefixed Nametests for elements in an HTML document must not match elements
that have no namespace. 

And in that case, this is equivalent to my language in comment #18, except that
I forgot to mention this is true only for HTML documents:

"In XPath 1.0, if a NameTest has no prefix, then the namespace URI is null. In
the context of document.evaluate(), HTML5 specifies a default element namespace
<add>for HTML documents</add>: if a NameTest has no prefix and the  rinciple
node type of the NameTest is element, the namespace URI is 
http://www.w3.org/1999/xhtml; if a NameTest has no prefix and the principle
node type of the NameTest is not element, the namespace URI is null."

If you want to be clear that default element namespaces were added in XPath
2.0, you could state that in a NOTE.


-- 
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 Thursday, 10 September 2009 14:54:57 UTC