[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Keyref not working in MSXML4 - is it correct?

From: Kevin Burges <xmldude@burieddreams.com>
Date: Fri, 30 Nov 2001 13:36:24 +0000
Message-ID: <17017768503.20011130133624@burieddreams.com>
To: xmlschema-dev@w3.org
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.