473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Importing multiple schemas with same namespace?

Hi, I have a scenario where I have a master schema that defines a
number of complex and simple types. I then have a number of other
schemas (with different namespaces) where I would like to reuse some
of these master complex and simple types. This I believe will assist
me in transforming between the master schema and the other smaller
schemas that contain a subset of the elements in the master schema.

I understand that I can import an xsd file that contains all of the
complex and simple types I want to reuse, and refer to them via their
namespace alias. As it happens though, because there are lots of these
complex and simple types in the master schema, I have split them
across multiple files merely to organise them. All files have the same
namespace though since the types contained within them are all part of
the master schema.

If I then try to define one of my other schemas with a different
namespace, I'm having difficulty importing multiple xsd files where
they all have the same name space. For instance, I've tried this:

<xsd:import schemaLocation="master_types1.xsd"
namespace="http://www.myschema.com/"/>
<xsd:import schemaLocation="master_types2.xsd"
namespace="http://www.myschema.com"/>
<xsd:import schemaLocation="master_types3.xsd"
namespace="http://www.myschema.com"/>

and coupled it with a single alias in the xsd:schema tag like this:
xmlns:master="http://www.myschema.com"

When my editor tries to validate the types of elements in my second
schema, for any element whose type exists in the master_types2.xsd or
master_types3.xsd it reports that it cannot resolve the type. Its like
the editor will only recognise one import statement for a given
namespace. It then seems to ignore any other import statements that
define the same namespace.

I guess I could resolve this by defining a 'common_types.xsd' that
simply 'includes' all of the files that contain my complex and simple
types, and then import only the common_types.xsd file, but this feels
like a workaround rather than being the correct way to structure my
xsd files.

Any advice much appreciated. Thanks.

Steve.
Jul 20 '05 #1
1 2203


Steve George wrote:

I guess I could resolve this by defining a 'common_types.xsd' that
simply 'includes' all of the files that contain my complex and simple
types, and then import only the common_types.xsd file, but this feels
like a workaround rather than being the correct way to structure my
xsd files.


I think one schema per namespace that includes the different components
of the schema for that namespace and then one import for the main schema
per namespace is the right way to go.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sascha Kerschhofer | last post by:
Hi, is it against the spec to import two external schemas with the same namespace into one main schema? e.g <xs:import namespace="http://myCompany.com/formating" schemaLocation="srt3.xsd"/>...
8
by: Poonam | last post by:
Hi, Can some one please help me with (or point me to) a very simple but working code sample that shows how to import XML Schema. I have tried many samples out there on internet but nothing seems...
3
by: rehveli | last post by:
Isn't it possible to generate .cs files from schemas, where one schema imports another, and both have the same namespace? If a.xsd and b.xsd have namespace "MyNameSpace", and in b.xsd I do...
3
by: farseer | last post by:
Hello, i have a schema which also imports the XHTML schema: <xsd:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/> This...
2
by: Ali | last post by:
I am having problem compiling schema contained in WSDL file when analyzing schema types contained in it (for example http://www.ebout.net/net/GoogleSearch.wsdl). Following code demonstrates my...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
5
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
0
by: vihrao | last post by:
I am designing wsdl that uses multiple schemas. I can do this in two ways: 1) use multiple schema imports in one wsdl or 2) use multiple schema imports in to one common schema and then import a...
5
by: paul_zaoldyeck | last post by:
does anyone know how to validate an xml file against multiple defined schema? can you show me some examples? i'm making here an xml reader.. thank you
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.