[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML Schema: Import and namespace question

  • From: Didier Perhirin <dperhirin@s...>
  • To: "'xml-dev@x...'" <xml-dev@x...>
  • Date: Thu, 8 Jun 2000 19:03:34 +0200

xml schema import

I'm currently working on the W3C XML Schema Working Draft 7 April 2000.
I have a question concerning the <import> element.
When I use such an element inside a schema, do the imported elements have
the same target namespace than the main schema, or do they keep their originating targetNamespace.
Concretely, if I have a schema imp_schema.xsd:

<xsd:schema targetNamespace="imported_schema_ns">
	<xsd:element name="tag1"/>

and a main schema main_schema.xsd, which imports it:

<xsd:schema targetNamespace="main_schema_ns"
	<xsd:import namespace="imported_schema_ns" schemaLocation="imp_schema.xsd"/>
	<xsd:element name="MainTag">
			<xsd:element ref="imp:tag1"/>

Is the following instance of the main schema valid :

<x:MainTag xmlns:x="main_schema_ns"
	xsi:schemaLocation="main_schema_ns main_schema.xsd">

or this next one is better:

<x:MainTag xmlns:x="main_schema_ns"
	xsi:schemaLocation="main_schema_ns main_schema.xsd">

I think the second one is right, but I still have some doubt ...

Thanks in advance for your answers,


Didier Perhirin

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.