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

Re: import schema namespace problem

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 08 Jan 2001 12:36:41 +0000
To: MarkH@i2.co.uk
Cc: xmlschema-dev@w3.org
Message-ID: <f5b8zomz0di.fsf@cogsci.ed.ac.uk>
MarkH@i2.co.uk writes:

> === imported-schema.xsd ===
> <?xml version="1.0"?>
> <schema
> targetNamespace="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
> xmlns:vlvx="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
> xmlns="http://www.w3.org/2000/10/XMLSchema">

<snip/>

> === types-schema.xsd ===
> <?xml version="1.0"?>
> <schema
> targetNamespace="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
> xmlns:vlvx="http://www.i2group.com/Schemas/2001-01-01/VLVXSchema"
> xmlns="http://www.w3.org/2000/10/XMLSchema">
> 	<import namespace="vlvx" schemaLocation="imported-schema.xsd">
> 		<annotation>
> 			<documentation>
> imported-schema.xsd defines a top level complexType 'topType'
>   </documentation>
> 		</annotation>
> 	</import>

<snip/>

> Schema representation errors
> Detected during schema construction
> file:/E:/My Documents/_ Work Current/_VLV/XML/imported-schema.xsd:2:191:
> Error: targetNamespace mismatch: vlvx expected,
> http://www.i2group.com/Schemas/2001-01-01/VLVXSchema found

Just like it says -- you say 'import for ns vlvx' but you point it at
a schema which says
targetNS='http://www.i2group.com/Schemas/2001-01-01/VLVXSchema'

<import> does not use prefixes, as someone already mentioned in an
earlier reply to you.

In any case, you don't _want_ <import> here, which is for multiple
namespaces, just

<include schemaLocation='imported-schema.xsd'/>

will do just fine.

ht
-- 
  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 January 2001 07:36:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT