Cant detect the keyref problem

Joined
Aug 25, 2009
Messages
1
Reaction score
0
Hey there, does anyone know why these codes give me a: "src-resolve: Cannot resolve the name 'boardNo' to a(n) 'element declaration' component."

...
<xs:complexType>
<xs:sequence>
<xs:element name="member" minOccurs="0" maxOccurs="unbounded" type="memberType" />
<xs:element name="board" minOccurs="0" maxOccurs="32" type="boardType"/>
<xs:element name="competition" minOccurs="0" maxOccurs="unbounded" type="competitionType"/>
</xs:sequence>
</xs:complexType>

...

<!-- declared the key here -->
<xs:key name="BOARDkey">
<xs:selector xpath="board"/>
<xs:field xpath="@boardNo"/>
</xs:key>

<!-- declared the keyref here -->
<xs:keyref name="BOARDref" refer="BOARDkey">
<xs:selector xpath="competition/game"/>
<xs:field xpath="boardNo"/>
</xs:keyref>

...

<!-- Type definition of board element -->
<xs:complexType name="boardType">
<xs:sequence>
<!-- 3.1. Additon of restrictions on Set of Values -->
<xs:element name="dealer">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N"/>
<xs:enumeration value="S"/>
<xs:enumeration value="E"/>
<xs:enumeration value="W"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

<!-- 3.2. Additon of restrictions on Set of Values -->
<xs:element name="vulnerability">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="nil"/>
<xs:enumeration value="all"/>
<xs:enumeration value="NS"/>
<xs:enumeration value="EW"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>

<xs:attribute name="boardNo" type="xs:ID" use="required"/>

</xs:complexType>

...

<!-- Type definition of competition element -->
<xs:complexType name="competitionType">
<xs:sequence>
<xs:element name="pair" minOccurs="2" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="player1" type="xs:IDREF" minOccurs="1" maxOccurs="1" />
<xs:element name="player2" type="xs:IDREF" minOccurs="1" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="pairNo" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>

<xs:element name="game" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element ref="boardNo"/> <!-- heres the problem key that cannot be detected. -->
<xs:element name="NSpair" type="xs:integer"></xs:element>
<xs:element name="EWpair" type="xs:integer"></xs:element>
<xs:element name="scoreNS" type="xs:integer"></xs:element>
<xs:element name="MPforNS" type="xs:decimal"></xs:element>
<xs:element name="maxMP" type="xs:integer"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>


Can anyone please advice?
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,130
Members
46,689
Latest member
liammiller

Latest Threads

Top