![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: keyref schema trouble keyref schema troubleTo: NULL Date: 3/4/2005 1:41:00 PM 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>
Thanks.
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
