[xml] Clarification on XML Schema error



Hi,

I get the following error message when validating a document against a XML Schema:

Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'ref': References from this schema to components in the namespace '' are not allowed, since not indicated by an import statement.

Can someone clarify this message for me? My knowledge on XSD is limited.
When I validate the same document using Oxygen, it is considered valid.

The problem seems to be in this part:

<xs:element msdata:IsDataSet="true" msdata:UseCurrentLocale="true" name="NewDataSet">
    <xs:complexType>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element ref="Bubble" />
      </xs:choice>
    </xs:complexType>
  </xs:element>

When I remove it, libxml does validate the document. I'm using libxml version 2.6.26 on Windows.

For completeness, here is the entire schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns="" id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema";>
  <xs:element name="Bubble">
    <xs:complexType>
      <xs:sequence>
<xs:element minOccurs="1" name="bubble_id" type="xs:unsignedInt" />
        <xs:element minOccurs="1" name="name" type="xs:string" />
<xs:element minOccurs="1" name="description" type="xs:string" />
        <xs:element minOccurs="1" name="active" type="xs:boolean" />
        <xs:element minOccurs="1" name="count" type="xs:unsignedInt" />
<xs:element minOccurs="1" name="total_time" type="xs:unsignedLong" /> <xs:element minOccurs="1" name="date_added" type="xs:dateTime" />
        <xs:element minOccurs="1" maxOccurs="unbounded" name="tracks">
          <xs:complexType>
            <xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" name="track">
                <xs:complexType>
                  <xs:sequence>
<xs:element minOccurs="1" name="track_id" type="xs:unsignedInt" /> <xs:element minOccurs="1" name="location" type="xs:anyURI" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<xs:element msdata:IsDataSet="true" msdata:UseCurrentLocale="true" name="NewDataSet">
    <xs:complexType>
      <xs:choice minOccurs="1" maxOccurs="unbounded">
        <xs:element ref="Bubble" />
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>



Thank you,

- Rob Laveaux

--------------------------------------------------------
Pluggers Software
Thijssestraat 203
2521 ZG  Den Haag
The Netherlands

Email: rob laveaux pluggers nl
Website: http://www.pluggers.nl

--------------------------------------------------------





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]