The Object Model Generator
 |
The Object Model Generator (henceforth referred to as OMG) is a tool
designed to provide the programmer with a simple code generator able of
transforming XML Schema Documents (XSD) into a Typed Document Object Model of
nested classes, using either C# or VB.NET as a language.
The tool features the following:
-
Typed Elements (incl. simple elements).
-
Typed Attributes.
-
Attribute Nullability (incl. Value Type Nullability).
-
Typed Complex Elements (Sequence, Choice).
-
Attribute Change Events.
-
Typed Sub Element Search By Attribute.
-
Load From / Save To XML (incl. verification against original schema).
-
Automagically Clonable Objects.
-
Parental Recognition by Objects.
-
Element Equality.
-
Eventful Collections.
-
Any Attribute Support.
-
Constants for Element / Attribute Names.
-
Elements Inner Text Support.
Please note that the application does not support XSD Simple or Complex Types
at the moment.
|
Why Create This Tool If XSD.EXE Already Exists?
The "xsd.exe /classes" tool is nice and useful, but its output was just
inadequate for my purposes.
I needed to create a tool that would help me author XML, and using the XML DOM
was too troublesome.
This tool is not a replacement for Typed DataSets, as those are very useful for
relational data. This tool is used solely for the purpose of authoring entities
that are eventually saved in a specific existing subset to XML, making regular
serialization inadequate.
Usage:
| * |
omg.exe [xsd file] |
Creates an object model in C#. |
| * |
omg.exe [xsd file] /vb |
Creates an object model in VB.NET. |
| * |
omg.exe /? |
Usage Screen. |
How to install and use the Visual Studio.NET 2003 Plugin:
Copy Omer.Utilities.ObjectModelGenerator.VSPlugin.dll and Omer.Utilities.ObjectModelGenerator.dll
files into the c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
directory and run
this file. Restart Visual Studio.NET.
To use the generator, create an XML Schema and replace the 'Custom Tool' field
for the file with "ObjectModelGenerator". This will cause an automatic
generation of the Object Model file with every saving.
Note that this functionality is still experimental. Please email me with any
problem or question.