W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2003

RE: qname interpretation in included files

From: Niko Matsakis <niko@alum.mit.edu>
Date: Thu, 30 Jan 2003 13:18:52 -0500 (EST)
To: Dare Obasanjo <dareo@microsoft.com>
cc: xmlschema-dev@w3.org
Message-ID: <Pine.LNX.4.44.0301301301160.14835-100000@sub-zero.mit.edu>

I think you are missing my point.  I realize that the names of
element declarations, attribute declarations, and types are NCNames and
receive their URIs from the targetNamespace.  However, when a type is
later referenced, as in

<xs:element name="surname" type="xs:string"/>

clearly the 'xs:string' is interpreted relative to some namespace
bindings, no?

So, as I said in my original e-mail, I want to know what the
set of namespace bindings that should be used to make that interpretation

I read your article and it did not seem to address my question; all
examples of chameleon schemas that I have seen consist only of
type declarations, but what if a component IN the chameleon schema
tries to reference one of the types declared in itself?

Here is my example again:


       <xs:complexType name="flight-plan-type"/>
       <xs:element name="flight-plan" type="flight-plan-type" abstract="true"/>


Note that the abstract element 'flight-plan' references the type
'flight-plan-type' which is declared above it.

Now, in my including schema:


       <xs:include schemaLocation="flight-plan.xsd"/>

       <xs:complexType name="flight">
                       <xs:extension base="flight-plan-type">
                               <xs:attribute name="number" type="xsd:double"/>


byincluding flight-plan.xsd, we change the name of 'flight-plan-type' to
'{my-namespace}flight-plan-type', but now the reference to 'flight-plan-type'
in the element 'flight-plan' in flight-plan.xsd is refering to a non-existent
type.  So is the intention that the references in the included file are
resolved before it is included?  (i.e., it is determined which type
'flight-plan-type' refers to before the file is included). 

Do you see my question?  


> Namespace declarations have nothing to do with the qualified names of
> elements declarations, attributes declarations or types. These are all
> dependent on the target namespace of the schema they are defined in or
> the including schema if they are defined in a schema with no target
> namespace. 
> Also you should understand how chamaleon schemas work. The article below
> goes into some detail on understanding how namespaces work in W3C XML
> Schema 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml
> /html/xml08192002.asp
Received on Thursday, 30 January 2003 13:11:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:59 UTC