XSD2Code.exe does not seem to generate the LoadFromFile and SaveToFile methods

Jul 16, 2009 at 3:57 PM


I just downloaded this tool and it seems great, but I can't get it to generate code that contains the load and save methods...

I even tried an included sxd file from the testunit project and also no save and load...

What am I doing wrong?


I also downloaded the source files and tried to add Delphi Prism (Oxygene) as a language and that works fine...

I added the language to the enum and added a codedom provider for Oxygene and that seems to work fine (except for the save and load functions, but those also don't work in C#)

Is there anything I can do to help, so that Oxygene can be included offcially in the tool?


Best Regards,


Jeroen Vandezande


Jul 16, 2009 at 8:24 PM
If you want generate load and save methods, you must set IncludeSerializeMethod to true.
Install the addin in vs 2008, add a new xsdfile in your project. Then right click on your xsd, choose Generate in context menu.
In property windows, set IncudeSerializeMethod to true. 
Yes i think it's a good stuff to integrate delphi codedom provider for Oxygene in xsd2code.
Can you send me your code in zip file ?
I'll test it and if it work fine, i'll include it in next release.
Thank you.
Jul 17, 2009 at 11:56 AM


Now it  works, thank you...

IncludeSerializeMethod was not included in the commandline help, that's why I could not find it...

Here is a link where you can download the modified sources:


username: xsd2code

password: xsd2code

I used the latest sources from the repository to start with (3.0)

The command line tool works fine, but I can't get it to generate Oxygene code in the VS plugin...

I can select Oxygene in the dropdown, but it always generates a C# file...

Maybe you know where this problem is...


Best Regards,

Jeroen Vandezande


Jul 17, 2009 at 1:59 PM

Hmm I did not test the syntax before, but there are some small issues with the Oxygene code generation

it uses ' for comments that should be // like in C#

and it uses "!= null" for null checking while that should be "<> nil" in Pascal

I will look into the code tonight if I can find the reason for this...






Jeroen Vandezande


Jan 21, 2010 at 7:55 AM

How do I do "IncludeSerializeMethod" from the command line?


Jan 21, 2010 at 10:08 PM
Edited Jan 21, 2010 at 10:09 PM

I was able to figure this one out myself from the source code.

To include Serialize, Deserialize, and LoadFromFile methods in the generated code, you need to have any one of these switches in your command line:

  • /s
  • /s+
  • /is
  • /is+

Suggestion: Add this feature to the help file.

Jan 21, 2010 at 11:25 PM

(suggestion was filed earlier today at http://xsd2code.codeplex.com/WorkItem/View.aspx?WorkItemId=10040)