Re: use of "or" in keyref selector

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 UTC