W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2003

Re: Invalid per cvc-complex-type.1.3: undeclared attribute {None}:use

From: Edwin Dankert <edankert@cladonia.com>
Date: Sun, 26 Oct 2003 20:33:40 -0000
To: xmlschema-dev@w3.org
Message-ID: <bnhb3p$q6t$1@sea.gmane.org>

Hello Jeni,

Thanks for that.

I think it's all clear now:
- Elements/attributes/types in the schema are declared in the
  targetNamespace or in no namespace if no targetNamespace is defined.

- References to an element/attribute/type in the schema are resolved
  using the default namespace declaration or if the 'ref' value has a
  prefix using the namespace declared for the prefix.

So the following reference is correct, since the default namespace of the
'ref element' is empty:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:test">
  <xs:element name="A">
    <xs:complexType>
      <xs:all>

        <xs:element xmlns="" ref="B"/>

      </xs:all>
    </xs:complexType>
  </xs:element>
  <xs:element name="B"/>
</xs:schema>

However the following cannot be correct, since the reference would point to
an element defined in the XML Schema namespace and this 'B' element has not
been defined in any namespace:

<schema xmlns="http://www.w3.org/2001/XMLSchema">
  <element name="A">
    <complexType>
      <all>
        <element ref="B"/>
      </all>
    </complexType>
  </element>
  <element name="B"/>
</schema>

Note: XSV (2.5-2 of 2003/07/09 13:08:04) does not report an error for the
version above.

Regards,
Edwin
Received on Sunday, 26 October 2003 15:34:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:40 GMT