the path with ".//", which I think would meet your needs. So it would look
"Mr. Almenares" <MrAlmenares@discussions.microsoft.com> wrote in message
news:C723698E-AE19-4210-82A5-88385350D1AC@microsoft.com...
> Hello:
>
> I'm trying to do a schema with recurrent structure for a Book like a Node
> can have many Nodes inside or One leave. So, the leaves have an attribute
> that is Identifier. My goal is define Uniqueness that guarantees to the
> attribute Identifier his uniqueness. That I don't know the depth of levels
> I
> have to put in the xpath attribute of the selector something like this
> TOC/descendant::Tree/Data, but this is not allow. How I can resolve.
> This is the simplified version of the schema.
>
> Hello:
>
> I'm trying to do a schema with recurrent structure for a Book like a Node
> can have many Nodes inside or One leave. So, the leaves have an attribute
> that is Identifier. My goal is define Uniqueness that guarantees to the
> attribute Identifier his uniqueness. That I don't know the depth of levels
> I
> have to put in the xpath attribute of the selector something like this
> TOC/descendant::Tree/Data, but this is not allow. How I can resolve.
> This is the simplified version of the schema.
>
> <xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified" attributeFormDefault="unqualified">
> <xs:element name="Book">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="TOC">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Tree" type="typeTree" maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
>
> <xs:key name="UTree">
> <xs:selector xpath="TOC/descendant::Tree/Data"/> HERE IS THE
> PROBLEM
> <xs:field xpath="@Identifier"/>
> </xs:key>
> </xs:element>
>
> <xs:complexType name="typeTree">
> <xs:choice>
> <xs:element name="Tree" type="typeTree" maxOccurs="unbounded"/>
> <xs:element name="Data" nillable="true">
> <xs:complexType>
> <xs:attribute name="Identifier" type="xs:string" use="required"/>
> </xs:complexType>
> </xs:element>
> </xs:choice>
> </xs:complexType>
> </xs:schema>
>
>