[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Composition by extension in namespaced schema

From: Gavin Kistner <phrogz@mac.com>
Date: Fri, 14 Mar 2008 12:02:24 -0700
To: "xmlschema-dev@w3.org XML Schema Mailing List" <xmlschema-dev@w3.org>
Message-ID: <20DF0D9F-0118-1000-DEFF-B00BF644BE33-Webmail-10021@mac.com>
Composition by extension in namespaced schema

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
-->
Received on Friday, 14 March 2008 19:02:58 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.