Keyref not working in MSXML4 - is it correct?

I have a very simple keyref set up, as shown in the example below. In
XMLSpy 4.1 the document validates fine. In MSXML4 i get an error
saying:

   The keyref "FORM_1" does not resolve to a key for the Identity
   Constraint "FormKey".

I can't see anything wrong with the code, so would I be right in
thinking there's something wrong in MSXML4 ??

Here is the document:

<Root xsi:noNamespaceSchemaLocation="\keyTest.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Form FormID="FORM_1"/>
  <IDs>
    <Form ID="FORM_1"/>
  </IDs>
</Root>


And the Schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="Root">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Form" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="FormID" type="xs:IDREF" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="IDs">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Form" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="ID" type="xs:ID" use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
    <xs:key name="FormKey">
      <xs:selector xpath="IDs/Form"/>
      <xs:field xpath="@ID"/>
    </xs:key>
    <xs:keyref name="Form_FormKeyRef" refer="FormKey">
      <xs:selector xpath="Form"/>
      <xs:field xpath="@FormID"/>
    </xs:keyref>
  </xs:element>
</xs:schema>

  

-- 
May the flares be with you,
 Kevin                    mailto:xmldude@burieddreams.com

++++++++++++ Cool music - http://burieddreams.com/marshan
++++++ Attitude Webzine - http://burieddreams.com/attitude

Received on Friday, 30 November 2001 08:38:31 UTC