One XSD, two code generation tools, two namespaces

前端 未结 2 1772
甜味超标
甜味超标 2021-01-26 03:00

I have a XSD file, from which I want to generate C# and Java classes as well.

I first set the namespace in the XSD according to my C# namespace where my classes resides.

2条回答
  •  青春惊慌失措
    2021-01-26 03:50

    You must take your pick as to what model is the main one: XSD, C#, or Java code. Once you make that choice, you must let the other two vary as they may. The best choice would be to make your XSD the reference model, generate the code in both languages with their respective tools, and just accept the results.

    You can also try to pick the XML namespace such that the code at both ends will be satisfactory, but don't try to force anything to the last letter. That's not how it's meant to work.

提交回复
热议问题