Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Composition by extension in namespaced schema

From: Gavin Kistner <phrogz@---.--->
To: "xmlschema-dev@--.--- --- ------ ------- ----" <-------------@--.--->
Date: 3/14/2008 5:02:00 AM
The appended test case shows a simple schema that fails to validate (using oXygen/Xerces) when the targetNamespace is declared for the file. If I remove the targetNamespace, the file validates and works just fine.

I see that there are 'suggestions' on how to fix this, but I don't know exactly what to do. (Just adding an empty <xs:import> doesn't fix anything. It changes the error to say that the name can't be resolved.)

I need to use a targetNamespace (or is it an xmlns?) in my schema so that I can validate other files without having to add noNamespaceSchemaLocation to those files. Can someone help me understand the core issue here, and (especially) how to modify the file to accomplish the goal?

Thanks! Test case follows:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.foo.com/">
  <xs:complexType name="mammal" />
  <xs:element name="dog">
    <xs:complexType><xs:complexContent>
    	<xs:extension base="mammal" />
    </xs:complexContent></xs:complexType>
  </xs:element>
</xs:schema>

<!--
  SystemID: E:\foo.xsd
  Location: 6:36
  Description: src-resolve.4.1: Error resolving component 'mammal'. It was detected that 'mammal' has no namespace, but components with no target namespace are not referenceable from schema document 'file:/E:/foo.xsd'. If 'mammal' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'mammal' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:/E:/foo.xsd'.
  URL: http://www.w3.org/TR/xmlschema-1/#src-resolve
-->



From mike@s... Fri Mar 14 19:23:04 2008
Received: fr


transparent
Print
Mail
Like It
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.

.
.

transparent

transparent