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

Re: use of "or" in keyref selector

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 14 Jun 2002 10:30:43 +0100
Message-ID: <133-2068289964.20020614103043@jenitennison.com>
To: xmlschema-dev@w3.org, "Colin Mackenzie" <colin@elecmc.com>

Hi Colin,

> Can anyone confirm whether or not it is valid to specify an "or" for
> a selector in a keyref.

You mean union ("or" in XPath is 'or', "union" is '|'). And yes, it is
valid. The BNF for selectors is:

[1]    Selector    ::=    Path ( '|' Path )*
[2]    Path        ::=    ('.//')? Step ( '/' Step )*
[3]    Step        ::=    '.' | NameTest
[4]    NameTest    ::=    QName | '*' | NCName ':' '*'  

As you can see, the selector can be made up of several paths,
separated by the union operator ('|').

The BNF for fields is the same except that the Paths can point to
attributes:

[5]    Path    ::=    ('.//')? ( Step '/' )* ( Step | '@' NameTest )

See http://www.w3.org/TR/xmlschema-1/#coss-identity-constraint.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 14 June 2002 05:30:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT