views:

2542

answers:

2

I'm doing some research in code generation from xsd schema files. My requirements:

  • Must generate C# 2.0 code, using generic collections where needed.
  • Must generate comments from the xsd comments
  • Must generate fully serializable code.
  • Should be able to generate resuable basetypes when generating from multiple xsd's with the same includes.

(see also my other questions: How can I generate multiple classes from xsd’s with common includes? and How can I generate comments from xs:documentation tags in a wsdl?

I have found the following options:

  1. Use xsd.exe (supplied with the SDK and Visual Studio)
  2. XSDCodeGen from Daniel Cazzulino
  3. Xsd2Code
  4. CodeXS
  5. XsdObjectGen by Microsoft
  6. XSDClassGen (Seems to be missing in action)

Did I miss any? Because (1), (2) and (5) do not generate 2.0 code, and I have problems with serializing code from (3). What do you use when generating code?

+1  A: 

I a project a bit over a year ago we used CodeXS. With some minor adjustments (a script that cleaned up the generated code a bit) it worked a charm.

There is also Dingo, which have some very good extensibility features (which we didn't need).

Steen
+1  A: 

I have not yet checked this out, but Linq2XSD might be a useful alternative.

I'm going to give this one a shot. LINQ with XSD generation would be better than any of these tools you mentioned - provided it works nicely.

Simon_Weaver
don't be too concerned its a 'dead project'. if its pretty much complete and working then its not 'dead' - its working! seems ok for me so far
Simon_Weaver