Re: qname interpretation in included files

Two basic facts are relevant:

1) The schema composition process always combines _components_, not
documents.  It follows that all conversion of QNames to
namespace,local-name pairs on the basis of namespace declarations
during initial mapping from XML to components takes place uniformly
and regardless of where the components "are headed".

2) Chameleon-include, that is, the inclusion of components w/o target
namespaces into a context with a target namespace, calls for the
changing of component names from names w/o namespaces to names with
namespaces (see Schema Representation Constraint: Inclusion
Constraints and Semantics [1] in section 4.2.1 of part 1 of the W3C
XML Schema REC.

So, to answer your specific question, given

> flight-plan.xsd:
> <xs:schema 
> 	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> 	elementFormDefault="qualified" 
> 	attributeFormDefault="unqualified">
> 
>         <xs:complexType name="flight-plan"/>
>         <xs:element name="flight-plan" type="flight-plan" abstract="true"/>
> 
> </xs:schema>
> 
> airplane.xsd:
> <xs:schema 
> 	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> 	xmlns="my-namespace"
> 	targetNamespace="my-namespace"
> 	elementFormDefault="qualified" 
> 	attributeFormDefault="unqualified">
> 
>         <xs:include schemaLocation="flight-plan.xsd"/>
> 
>         <xs:complexType name="flight">
>                 <xs:complexContent>
>                         <xs:extension base="flight-plan">
>                                 <xs:attribute name="number" type="xsd:double"/>
>                         </xs:extension>
>                 </xs:complexContent>
>         </xs:complexType>
> 
> </xs:schema>
> 
> Now here is my question.

<snip/>

> However, it is not clear to me what type the abstract element
> "flight-plan" in the included file is suppoesd to be extending.

First of all, there is no extension involved wrt the abstract element
flight-plan.  Presuming that is just a typo, I understand your
question to be "What is the type definition of the {my-namespace,flight-plan}
element?".

The answer is {my-namespace,flight-plan}.  This follows from (1) and
(2) above, as follows:

  A component is built for the element {<None>,flight-plan} whose
  {type definition} is the complex type definition
  component whose name is {<None>,flight-plan}

  When those components are chameleon included, their names are
  changed per clause 3.2 of Inclusion Constraints and Semantics [1],
  to {my-namespace,flight-plan}.

Hope this helps.

ht

[1] http://www.w3.org/TR/xmlschema-1/#src-include
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Thursday, 30 January 2003 13:50:35 UTC