This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9571 - There is no zero-arity node-name() function
Summary: There is no zero-arity node-name() function
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-21 15:07 UTC by Michael Kay
Modified: 2011-06-08 11:43 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2010-04-21 15:07:45 UTC
The node-name() function is anomalous. Other functions that return a property of a node, for example base-uri(), name(), local-name(), namespace-uri(), generate-id(), string() have a zero-arity form that takes the context item as the implicit first argument. Some other functions that do this: number(), string-length(), normalize-space().

node-name() might be expected to follow this pattern, but doesn't.

Similarly, though perhaps with less usability impact, document-uri() and data().

We ought to be consistent.
Comment 1 Michael Kay 2010-04-21 15:09:41 UTC
root() is another one that DOES have a zero-arity variant (proving that it's not only a design that was adopted for 1.0 functions and abandoned in 2.0).
Comment 2 Jonathan Robie 2010-04-21 17:46:20 UTC
I agree - we should allow this for node-name(),document-uri(), and
data().
Comment 3 Michael Kay 2010-11-01 17:09:00 UTC
According to my records this we agreed on 2010-05-14 to add zero-argument forms of the three functions node-name(), data(), and document-uri(), and I am therefore closing this belatedly as FIXED/RESOLVED.