Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


keyref schema trouble

From: Mr. Almenares@-----------.---------.---
To: 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.



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent