tags:

views:

226

answers:

2

We are looking for a way to have C# autogenerate classes from an XSD and create C# namespaces using the namespace info in the XSD.

Doesnt seem like you can create a structured (xxxx.yyyy.zzzz) C# namespace from the XSD?

Is there a trick we're missing?

Thanks

+2  A: 

Would this do the trick? the /n allows you to specify a namespace to put the generated class in.

xsd.exe /classes MyXSDInput.xsd /n:MyCsharpNamespace

John Buchanan
This is a working solution +1
Daok
+1  A: 

There's a really interesting project XSD2Code on Codeplex. It basically does the same as xsd.exe - only better, on the command line, and as a Visual Studio plugin.

You just right-click on an XSD file in your solution explorer and run the tool!

alt text

You can set any valid .NET namespace as the target namespace for your generated code files.

marc_s