How can I generate multiple classes from xsd's

2019-04-13 03:32发布

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

2条回答
一纸荒年 Trace。
2楼-- · 2019-04-13 03:55

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.

查看更多
\"骚年 ilove
3楼-- · 2019-04-13 03:57

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

查看更多
登录 后发表回答