.NET – Delphi Prism – How to generate wrapper classes code from XSD file
Posted by jpluimers on 2009/09/04
I do a lot of .NET work; most in C#, but also some in Delphi Prism (which like C#, VB.NET and other languages integrate in the Visual Studio Shell).
Both Visual Studio and the .NET Framework SDK include a nifty tool called XSD.EXE.
XSD.EXE allows you you to generate the code for wrapper classes from your XSD or other schema definition file, both for regular classes (that you can use for XML Serialization) as well as for typed dataset classes.
You need to specify the Oxygene language to generate Delphi Prism code.
A sample batch-file is here:
xsd /classes /language:Oxygene /namespace:xokumClasses xokum.xsd rename xokum.pas xokumClasses.pas xsd /dataset /language:Oxygene /namespace:XokumDataset xokum.xsd rename xokum.pas xokumDataset.pas
Thanks to Peter Nowotnick who posted this answer at Stackoverflow!
–jeroen
Finding the path of xsd.exe from your Visual Studio Build Events « The Wiert Corner – irregular stream of stuff said
[…] .NET – Delphi Prism – How to generate wrapper classes code from XSD file. […]
Generating a WordPress posting categories page – part 1 « The Wiert Corner – irregular stream of Wiert stuff said
[…] can generate C# wrapper classes using the XSD.exe tool that ships with Visual Studio, but XSD.exe is hard to use, is hard to integrate into Visual […]
Generate XSD from XML – XSD.EXE versus on-line tools « The Wiert Corner – irregular stream of Wiert stuff said
[…] a while ago, I wrote about the XSD.EXE tool to generate wrapper classes from an XSD […]
Dynamically generating code with Delphi Prism said
[…] also worth noting that Microsoft’s xsd.exe tool can also be used with Delphi Prism (thanks to Jeroen Pluimers and Peter Nowotnick for sharing this tip with […]