This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The syntax for an abbreviated step now looks like this: AbbrevForwardStep ::= "@"? NodeTest NodeTest ::= KindTest | NameTest This allows users to write silly things like this: @comment() which looks for a comment node on the attribute axis. Of course, there is nothing on the attribute axis but attribute nodes, so there is no need for a KindTest following "@" in an abbreviated step. We could eliminate this kind of silliness by changing the grammar as follows: AbbrevForwardStep ::= NodeTest | "@" NameTest NodeTest ::= KindTest | NameTest
Please note that XPath 1.0 did not have any "natural" way of expressing an empty node-set. It is therefore customary for XSLT 1.0 users wanting an empty node-set (e.g. as a parameter to a template) to write expressions that are guaranteed to select nothing, such as "/.." or "@comment()". The former is actually recommended in the XSLT 1.0 specification, and the latter is suggested in at least one book. Michael Kay
On further thought, it occurs to me that a kind test in the abbreviated syntax can be used to search for attributes of a particular type, as in this example: @attribute(*, xs:date) This use case, together with Mike Kay's comments, prompts me to withdraw my suggestion for a syntax change. If no one objects, I will mark this comment as closed with a resolution of "WONTFIX". --Don C.
(In reply to comment #2) > @attribute(*, xs:date) I'm not sure what the "@" buys you here. Why is that different from simply attribute(*, xs:date) ? FYI, I've tested your proposal and it works fine. But maybe we should go ahead and leave it alone, since it would be another XPath 1.0 incompatibility, which I would like to avoid. -scott
On July 20, 2005, the Query and XSLT working groups voted to close this comment without change to specifications.