How can I generate multiple classes from xsd's with common includes?

岁酱吖の 提交于 2019-12-21 20:59:19

问题


Aloha

I received a few nice xsd files which I want to convert to classes (using xsd.exe) All the xsd's have the same includes, like this:

<xs:include schemaLocation="kstypes.xsd" />
<xs:include schemaLocation="ksparams.xsd" />

When I generate a class for each xsd the types declared in these files are duplicated for each original xsd. Is there any easy way to 1) only generate the types in the included xsd's once and 2) make sure all other classes use these types?

-Edoode


回答1:


try the approach outlined here : http://blog.hosca.com/blog/fpmlgen/




回答2:


Looking over the documentation, it would appear that the 'best' way (not an easy way!) would be to use the /element:elementname command line switch on the second and subsequent files to specify the types you want classes generated for.



来源:https://stackoverflow.com/questions/374600/how-can-i-generate-multiple-classes-from-xsds-with-common-includes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!