-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default element/type namespace to XPath 1.0 #63
Comments
The test of whether a specification is useful is whether implementors take any notice of it. Since the browser vendors have been ignoring anything the XML community does for a quarter of a century now, I very much doubt this would change anything. And users don't need a spec that documents the known limitations of fossilised products, they need some improved functionality. |
I believe it would be changed in HTML5, quickly even. They've been willing so far to remove other willful violations when they became moot, and some of them express the sentiment that the more can (from their point of view) be removed, the better. Indeed, several years ago there was much disdain, and even hostility (resulting in incompatibilities and interoperability blockers being introduced on purpose) towards the XML community and XML technologies from them in general, but now, having assured their victory in the realm of browsers and content they support, to the point of taking the reins of HTML and DOM from W3C (which now just rubberstamps those specs), they (especially newcomers) no longer feel the need to be so vicious. We can do better than them (so far we have, I believe) and not reciprocate. After so many years. Especially given that the nastiest bulldogs among them (I'm not going to mention names here), whose excesses Mr Last Week so aptly documented, are either no longer active or only participate sporadically. As hard as it may be to believe, the climate has changed for the better (look at their cooperation with ECMA TC39 to convince yourself; albeit not without hiccups, I wish it could have looked similarly with XML folks in the 00s), and if we hope, even decades from now, to overcome the chasm they (though mostly their predecessors) tore in the fabric of Web technologies, this would be a solid step towards that goal. More technically, I disagree with your assessment of this willful violation as a limitation. It seems for this very purpose that XPath 2.0 introduced this feature, and were some major browser team to undertake the huge task of upgrading to at least XPath 2.0, they'd naturally reach for it. And the range of what's possible, called expressiveness, is the same with |
The feature in XPath 2.0 is very different from the "wilful violation" [despite WhatWG's claim to the contrary]. In XPath 2.0 the default namespace for elements and types is part of the static context. In the "wilful violation" it depends on whether the context node is an XML or HTML node, which isn't known until runtime. And the spec is very unclear as to which "context node" it is talking about - is it the context node for the particular axis step, or the context node for the XPath expression as a whole? In XPath 1.0 this isn't often going to make a difference, because the facilities for handling multiple documents are very limited; but for an expression like Anyone trying to write a new spec would have to spend a lot of time studying such edge cases, and it would probably end up being one of those reverse-engineered specs when you end up saying that different browsers handle edge cases differently.
I wasn't specifically referring to the wilful violation as a limitation. I was referring to the entire set of known limitations in XPath 1.0 that are fixed in subsequent versions, for example the inability to do any kind of join query. |
It is a little bit more intricate, but, given the context (the HTML5 spec), which defines some underpinnings, I'm not sure it can be called even slightly underspecified and requiring reverse engineering. I might be wrong about that. But they almost certainly do know OTOH and would be willing to explain if asked. If it'd help were I to to it, I volunteer, otherwise maybe somebody in a more official capacity (a CG member, an XPath spec editor, former or current…) should. I bet that even if their spec does turn out to be underspecified, they'd consider it appropriate to fix it. Namely, IIUC, the HTML5 spec defines an SGML-inspired (though not conformant to either SGML or XML) syntax for HTML documents, whereas for documents parsed from XML syntax and for |
I suggest releasing a second edition of XPath 1.0 supporting the default element/type namespace feature (added in XPath 2.0).
Most systems running an implementation of XPath 1.0, namely Web browsers, already implement it, thereby deviating from XPath 1.0, as prescribed by a "willful violation" in the HTML5 spec. (And unfortunately they generally don't intend to implement any higher version of XPath.) It seems a low hanging fruit to just add it, allowing one of those infamous willful violations to be removed. Existing implementations needn't change anything to claim conformance, as IIUC there may be no default element/type namespace initially, and it cannot be changed (unlike in XQuery).
The text was updated successfully, but these errors were encountered: