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

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 UTC