XPath attributes

Looking at the XPath Recommendation, it appears that the notation

element[@attribute]

is not actually supported by the grammar.

In particular, I was looking at the grammar to see if the following
statements would return the same results, albeit through
different mechanism (I assume they would, maybe someone can
comment):

a/@b
a/attribute::b
a[@b]
a[attribute::b]

Note that this observation applies to both the shortcut '@' as well as the
normal 'attribute::' notation.

Specifically, it appears that the only way to add '[]' is via a "predicate",
and a predicate does not seem to permit node notations
(of interest of course is '@' or 'attribute::').

Cliff Binstock
binstock@pacifier.net

Received on Tuesday, 26 February 2002 13:03:03 UTC