Hi,
I am experiencing a lot of problems with XsdObjectGen. I downloaded
the latest version from
http://www.microsoft.com/downloads/d...DisplayLang=en
but this is dated september 2006, so it's not very recent.
We receive xsds from a third party and our application has to generate
xml that is valid for these xsds. This makes that we cannot alter the
xsds in any way, we have to generate code for them as they are. The
xsds are also quite complicated, a lot of includes of other xsd files
in each xsd. Also some circular references, which makes that we cannot
use XSD.exe which is an alternative for XmlObjectGen.
My problems:
- Sometimes enums and classes with the same name are generated, but
this isn't allowed in C# (not in the same namespace, which is the
case). An easy solution would be if I could prefix all generated enums
with a string of my choice, but this seems not te be supported.
- Sometimes classes and properties within these classes are generated
with the same name. But C# doesn't allow a property to have the same
name as the class name. An easy solution again would be if I could
prefix or subfix the generated class names or property names, but
again this doens't seem to be supported.
- If there are two enums or two classes with the same name, the second
class or enum name is subfixed with "2", eg: Person and Person2. In
other classes, where these enums or classes are you used, it sometimes
mixes them up and declares a property as Person instead of Person2.
Anyone having the same problems? What do you do about them (we correct
them manually each time, but this takes like 5 minutes each time we
regenerate).
Anyone knowing a better tool than XsdObjectGen and xsd.exe?
Veerle