Cant detect the keyref problem

Discussion in 'XML' started by boogieeee, Aug 25, 2009.

  1. boogieeee

    boogieeee

    Joined:
    Aug 25, 2009
    Messages:
    1
    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: Aug 25, 2009
    boogieeee, Aug 25, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marek Malowidzki

    Key/keyref validation in schema?

    Marek Malowidzki, Aug 18, 2003, in forum: XML
    Replies:
    1
    Views:
    507
    Mark Preston
    Aug 19, 2003
  2. J E E
    Replies:
    0
    Views:
    377
    J E E
    Nov 7, 2003
  3. Nagaraj
    Replies:
    1
    Views:
    855
    Lionel B
    Mar 1, 2007
  4. boeledi

    XSD: key and keyref problem

    boeledi, Oct 15, 2007, in forum: XML
    Replies:
    4
    Views:
    1,138
    Kris824
    Sep 6, 2012
  5. BobbyOwens
    Replies:
    0
    Views:
    959
    BobbyOwens
    Feb 17, 2009
Loading...

Share This Page