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

Re: Is schemaLocation just a hint in schema import?

From: Xan Gregg <xan.gregg@jmp.com>
Date: Mon, 9 Oct 2006 12:14:04 -0400
Message-Id: <497410E9-11B5-42DC-8500-49895A27509A@jmp.com>
Cc: xml-dev@lists.xml.org, xmlschema-dev@w3.org
To: "Antoli, Leo" <Leo.Antoli@Misys.com>
Re: Is schemaLocation just a hint in schema import?

> Does it mean that you can't have 2 schemas defining different  
> elements for
> the same namespace and then import both from another schema?

Not reliably, anyway. For a given schema usage, there is one schema  
for a given namespace URI. A "schema document" is different from a  
"schema". From the XML Schema perspective, a schema is roughly a set  
of schema components all having the same namespace URI.

> Should everything for a given schema be defined in just one schema  
> file? If
> you have a big schema definition for different functional areas, it  
> might be
> useful to split the schema in several files so you don't need to  
> import
> elements that you won't be using.

There may be multiple schema documents used to create a schema;  
however, you can only reliably import a schema using a single  
location. Instead, you should build a grouping schema document that  
<xs:include>s the other schema documents that are in the same  
namespace and then import the schema using the location of the  
grouping schema document.

> Can anybody tell me the motivation for this note in the schema spec?

To allow maximum flexibility in schema processors. For instance, to  
allow a processor to keep known schemas in a cache, while ignoring  
the location hint altogether. However, this flexibility can lead to  
other problems, for instance, in the presence of multiple versions of  
the same schema.

xan
Received on Monday, 9 October 2006 16:14:12 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.