W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: what namespace for unqualified locals?

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 08 Oct 2001 20:53:13 +0100
To: Brian Atkins <brian_atkins@firehunter.com>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bbsjhdi3a.fsf@cogsci.ed.ac.uk>
Brian Atkins <brian_atkins@firehunter.com> writes:

> If the form for local element is unqualified, what namespace, if any,
> to they belong to?  If they do not belong to the targetNamespace of
> the schema, how do they participate in validation?

The same namespace that unprefixed attributes belong to :-).  That is, 
I like to say, they are _associated_ with the namespace of their
parent, but they're not directly in it.

> I am also confused about the relationship between scope and namespace.
> Consider the following schema:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema targetNamespace='http://www.test.com/test'
>            xmlns='http://www.test.com/test'
>            xmlns:xs='http://www.w3.org/2001/XMLSchema'
> 	   elementFormDefault='unqualified'>
>   <xs:element name="test" type="mytype"/>
>   <xs:complexType name="mytype">
>     <xs:sequence>
>       <xs:element name="spam" type="xs:string"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>

> What namespace is the element "spam" in?  I know it's in the scope of the
> type "mytype" in the targetNamespace.  Outside the schema itself (in
> instance documents or stylesheets, for example), complex types and,
> specifically, 'mytype' are not relevant.  How is this "spam" element,
> in this type, in this namespace, uniquely identified?

Point is, it can't be more uniquely identified than by specifying its
scope, because their could be _another_ local <spam> within a distinct 
complex type definition.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-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/
Received on Monday, 8 October 2001 15:52:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:54 UTC