Altova Mailing List Archives


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

From: "Edwin Dankert" <edankert@--------.--->
To: xmlschema-dev@--.---
Date: 10/24/2003 3:41:00 PM
> I have a question for Edwins comment about namespaces. What is the
> significance of the suggestion? I made the schemas with no xs: because of
an
> existing group of schemas that did not have the xs: namespace. I do not
know
> any advantadge nor disadvantadge of doing so.

If you don't use a targetNamespace, none of your Elements or Attributes
should be in a namespace, however at the moment your Elements and Attributes
are defined in the XMLSchema namespace. Xerces-J 2.5.0 does complain about
this (and I think this is correct), I don't know why XSV does not complain
about this.

The following however is valid according to Xerces:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.w3.org/2001/XMLSchema">
 <element name="A">
  <complexType>
   <all>
    <element ref="B"/>
   </all>
  </complexType>
 </element>
 <element name="B"/>
</schema>

However you probably don't want your elements to be in the XML Schema
namespace.

If you don't want to declare a targetNamespace, use this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="A">
  <xs:complexType>
   <xs:all>
    <xs:element ref="B"/>
   </xs:all>
  </xs:complexType>
 </xs:element>
 <xs:element name="B"/>
</xs:schema>

If you want to declare a targetnamespace you could use this:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="test" targetNamespace="test">
 <xs:element name="A">
  <xs:complexType>
   <xs:all>
    <xs:element ref="B"/>
   </xs:all>
  </xs:complexType>
 </xs:element>
 <xs:element name="B"/>
</xs:schema>

Or if you want the schema elements to be in the default namespace:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="test" xmlns:test="test">
 <element name="A">
  <complexType>
   <all>
    <element ref="test:B"/>
   </all>
  </complexType>
 </element>
 <element name="B"/>
</schema>

By the way I made a mistake in my previous email, the positiveInteger type
should be referencing a type in the schema namespace so it should look like
this:
xs:positiveInteger

Regards,
Edwin Dankert
Cladonia Ltd.
http://www.cladonia.com/



From owner-xmlschema-dev@d...  Fri Oct 24 12:07:45 2003
Return-Path: <owner-xmlschema-dev@d...>
X

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.