W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Selector and Field XPaths (for Schema 1.1)

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Wed, 20 Nov 2002 13:57:42 +0100 (MET)
To: xmlschema-dev@w3.org
Message-ID: <6274.1037797062@www23.gmx.net>

Hi all.

After reading the specification for selector and field XPaths I am not sure
what kind of XPaths are actually allowed. I think that this point needs


The spec. defines BNFs for the valid XPaths. However, it also states (at
2.2) that XPaths whose  abbreviated forms correspond to the BNFs are also valid
with the restriction that only the 'child' (and 'attribute' axes in case of
fields) are used.

Yet, the BNFs also use the 'self' and the 'descendant-or-self' axes.
Therefore I think that these axes should also be allowed for the XPaths covered by


The BNFs allow the '//', i.e. a 'descendant-or-self' step only at the
beginning. I think this restriction is not necessary because it does not ease
implementations and is conceptually not justified.

3. The 'descendant' axis should also be allowed.

To summarize I propose the following BNFs for selector and field XPaths:

RelLocPath := Step | (RelLocPath '/' Step) | (RelLocPaht '//' Step)

Step := (AxisSpecifier? NodeTest) | '.'

AxisSpecifier := 'self' | 'child' | 'descendant' | 'descendant-or-self'

NodeTest := '*' | (NCName ':' '*') | QName | 'node()'

Selector := RelLocPath ( '|' RelLocPath)*

FieldLocPath := (RelLocPath ('/' | '//'))? (Step | AttributeStep)

AttributeStep = ('attribute::' | '@') NameTest

Field := FieldLocPath ( '|' FieldLocPath )*

This definition describes a superset of the XPaths allowed with respect to
the current BNFS. Therefore it could be used for the XMLSchema 1.1

Received on Wednesday, 20 November 2002 07:58:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC