W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

RE: Illegal use of unique? I need it. Microsoft supports it. Alternatives?

From: Steen Lehmann <slehmann@silverstream.com>
Date: Wed, 10 Oct 2001 19:40:39 +0200
To: "'Eric van der Vlist'" <vdv@dyomedea.com>, "'Gary Robertson'" <gazinyork@hotmail.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <004f01c151b2$ad5dd1c0$0601a8c0@steenxp>
Hi,

Just a comment on the restriced XPath syntax in XML Schema:

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Eric van der Vlist
> Sent: 10. oktober 2001 16:54
> To: Gary Robertson
> Cc: xmlschema-dev@w3.org
> Subject: Re: Illegal use of unique? I need it. Microsoft 
> supports it. Alternatives?

[...]

> >       <xs:unique name="StateNamesUniqueWithinAnObject">
> >       <xs:selector xpath="../State"/>
> >       <xs:field xpath="@name"/>
> >       </xs:unique>
> >       </xs:element>
> >     </xs:sequence>
> >   </xs:extension>
> >   </xs:complexContent>
> > </xs:complexType>
> > 
> > However, note use of parent node syntax (..) in the 
> selector xpath. Is 
> > this illegal?
> 
> 
> Yes.

Actually this is not legal as far as I can tell. The selector XPath
syntax is 
defined as follows (from XML Schema Part 1):

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

As you can see there is no way the Selector can begin with '..'

-- Steen
slehmann@silverstream.com
Received on Wednesday, 10 October 2001 13:38:01 GMT

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