Why does XSD.EXE Create Two .XSD Files, and How to Use Them?

前端 未结 4 1545
走了就别回头了
走了就别回头了 2020-12-17 02:20

I am using the following command to generate related xsd file from my input XML file -- response.xml, my confusion is (1) why there are two xsd file output (response.xsd and

相关标签:
4条回答
  • 2020-12-17 02:41

    Yes, remove the namespaces from XML file and generate it, you will get single XSD file

    0 讨论(0)
  • 2020-12-17 02:49

    The reason why two files are getting generated is because your XML contains two XML namespaces; each generated XSD corresponds to a namespace. The one for the soap envelope namespace imports the mycorp namespace (which you can see from the xs:import element).

    0 讨论(0)
  • 2020-12-17 02:52

    IIRC, you use both, one will probably reference the other.

    0 讨论(0)
  • 2020-12-17 02:55

    George,

    To generate classes from these files, you must list both on the command line:

    D:\>xsd response.xsd response_app1.xsd /classes 
    

    It has already been correctly said that the two .xsd files are because there were two XML namespaces in your original XML file. BTW, I'm guessing a little here because you did not post the XML file.

    0 讨论(0)
提交回复
热议问题