0

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?

MusicLovingIndianGirl
  • 5,909
  • 9
  • 34
  • 65
MirlvsMaximvs
  • 1,453
  • 1
  • 24
  • 34

2 Answers2

1

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?

Community
  • 1
  • 1
philicomus
  • 133
  • 1
  • 9
1

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?

Community
  • 1
  • 1
Yair Nevet
  • 12,725
  • 14
  • 66
  • 108