468,768 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,768 developers. It's quick & easy.

Problems with XsdObjectGen

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

Mar 26 '07 #1
1 3912
Have you taken a look at the LINQ to XSD preview? Using Linq To XSD, you can
generate classes from the schema (these classes work on top of an in-memory
xml tree) . To generate the xml, your application should set the properties
on these classes with the appropriate values.
More information is available at:
http://blogs.msdn.com/xmlteam/archiv...e-to-linq.aspx

Thanks,
Priya

"Veerle" <ve*********@hotmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
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

Mar 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Pavan | last post: by
5 posts views Thread by colinco | last post: by
reply views Thread by Pascal Brunot | last post: by
reply views Thread by Andrew Burgher | last post: by
reply views Thread by Jeff Killberg | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.