tags:

views:

193

answers:

1

I have an XML file that I used to create an XSD File and from there generated the C# code.

However, during development I had to make some changes to that C# file. Is there a way I can use the xsd.exe tool to convert that C# file back into an XSD file? I'm hoping to avoid having to go and manually edit the XSD File.

+2  A: 

From the C# file directly you cannot go back to the XSD file (not by using xsd.exe).

You can build back the schema from the type constructed in the C# file:

xsd.exe yourdll.dll /t[ype]:TypeYouWantASchemaFor or

xsd.exe yourExe.exe /t[ype]:TypeYouWantASchemaFor

See the DLL and EXE File Options section from the xsd documentation.

Ando
right, and remember. . . the schema you arrive at, is just one possible schema that the document conforms to. It will not be completely general, obviously.
Cheeso