Reputation: 1483
I've been trying generate xsd schema
from xml
file in order to obtaining the classes (applying the xsd tool). In visual studio
with my xml open: main menu -> Xml -> Generate Schema
and visual studio generates the schema in several files:
One main file referencing the other ones. After that I have to copy the others files content into the main file to apply the xsd tool and generate the classes I want.
My question is, it would be possible generate all in just only one file?
Upvotes: 0
Views: 5408
Reputation: 13013
Each namespace in your XML file is considered as a separate schema (XSD).
Consider consolidate your namespaces into one so you could enjoy 1 file generation.
In addition, as a good reference, look at this related good answer: xsd.exe generates two files, how to join them into one?
Upvotes: 1
Reputation: 133
Can you change the xml file so all types are in the same namespace, thereby forcing xsd to create a single-file schema? See Why does XSD.EXE Create Two .XSD Files, and How to Use Them?
Upvotes: 1