W3C home > Mailing lists > Public > www-xpath-comments@w3.org > July to September 2001

RE: Grammar doesn't state that in Step AxisSpecifier is optional, assumes child.

From: Michael Kay <mhkay@iclway.co.uk>
Date: Wed, 1 Aug 2001 10:45:27 -0400 (EDT)
To: "'Liddicott, Ben'" <ben.liddicott@gs.com>, <www-xpath-comments@w3.org>
Cc: <ben.liddicott@bencat.demon.co.uk>
Message-ID: <000401c11a99$271d3ab0$b1483c3e@PCUKMKA>
(unofficial response: not endorsed by the XSL WG)

> The grammar states:
> [4]    Step    ::=    AxisSpecifier NodeTest Predicate*
>    | AbbreviatedStep
> [5]    AxisSpecifier    ::=    AxisName '::'
>    | AbbreviatedAxisSpecifier
> Which is confusing because this doesn't allow "node()" or
> "div" or many of
> the other paths given as examples.

These constructs are allowed by virtue of the fact that an
AbbreviatedAxisSpecifier may be empty.

Your observation that the grammar is "confusing" is certainly justified; it
wasn't written as a reference guide for users of the language, much more as
a specification for implementors, and the way the grammar is presented is
influenced by considerations of parser design that should be of no interest
to users of the language.

The style of presentation of the next version is likely to be very
different, though the changes will be geared towards improving the precision
of the specification and not necessarily towards ease of reading by the
end-user of the language.

Mike Kay
Received on Wednesday, 1 August 2001 14:20:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:02:14 UTC