By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,847 Members | 2,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,847 IT Pros & Developers. It's quick & easy.

XSD.exe w/Include: What am I doing wrong?

P: n/a
I'm running into problems using XSD.exe to generate classes from XSD files using the <Include> functionality.
Being a complete newbie with this, I am obviously missing something obvious

I have defined two schemas, XMLSchema1 and XMLSchema2 with the same target namespace: "TestSpace", each with one complextype element defined. In the XSD designer for XMLSchema2, I have included XMLSchema1

When I run XSD.exe

XSD.exe XMLSchema1.xsd XMLSchema2.xsd /

I get the following

"A schema with the namespace "TestSpace" has already been added.

I thought that using <Include> means that you _must_ have the same target namespace defined?

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
When you have xs:include statement in a given schema, there is no need to
reference the included schema as a commnad line argument to xsd.

For example, following should work (assuming XMLSchema1.xsd contains include
statement for XMLSchema2.xsd) :

XSD.exe XMLSchema1.xsd /c

(as long as the included schema can be resolved)

When you have xs:import statement, you do need to specified all imported
schemas on the command line.

Hope this helps.
Raghu/..
"David" <an*******@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
I'm running into problems using XSD.exe to generate classes from XSD files using the <Include> functionality. Being a complete newbie with this, I am obviously missing something obvious:
I have defined two schemas, XMLSchema1 and XMLSchema2 with the same target namespace: "TestSpace", each with one complextype element defined. In the
XSD designer for XMLSchema2, I have included XMLSchema1.
When I run XSD.exe:

XSD.exe XMLSchema1.xsd XMLSchema2.xsd /c

I get the following:

"A schema with the namespace "TestSpace" has already been added."

I thought that using <Include> means that you _must_ have the same target namespace defined?

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.