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

qname interpretation in included files

From: Niko Matsakis <niko@alum.mit.edu>
Date: Thu, 30 Jan 2003 12:22:12 -0500 (EST)
To: xmlschema-dev@w3.org
Message-ID: <Pine.LNX.4.44.0301301210590.14835-100000@sub-zero.mit.edu>

I have a question about qname interpretation in included files.  In short,
my question is: What namespace bindings are in effect when we interpret
the qnames in an attribute, such as the type attribute of xs:element.  
It doesn't seem to be the same as the bindings that are on the node,
for the reasons I will explain below.

Suppose I have a generic schema with no target namespace that I
am attempting to reuse in a number of contexts.  Suppose it
declares a complex type 'flight-plan', and an abstract element of
that type with the same name.  (I am just making up these type names,
so don't try to read any meaning in them)


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


Now I try to use that schema from this other schema:


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

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


Now here is my question.  It is clear that the complexType flight-plan
will be instantiated as {my-namespace}flight-plan due to the targetNamespace.  
Furthermore, I assume that the type which "flight" is extending 
is {my-namespace}flight-plan due to the xmlns="". 

However, it is not clear to me what type the abstract element 
"flight-plan" in the included file is suppoesd to be extending.  The 
intention would seem to be {my-namespace}flight-plan, however, it seems
like the type attribute on the 'flight-plan' element has no default
namespace binding on it, so it would in fact be interpreted as {}flight-plan.

So my question again is: what namespace bindings apply on the interpretation of
qname attributes?  It can't be the bindings on the node that the attribute
is on, it seems, because that would lead to {}flight-plan.  But it isn't
targetNamespace, I don't think, as the schemas I have seen use both 
xmlns="my-namespace" and targetNamespace="my-namespace" as quite independent

Thank you!

Received on Thursday, 30 January 2003 12:16:58 UTC

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