Thursday, November 29, 2007

XSD.EXE, oh how you vex me

I ran into an interesting issue with xsd.exe today. I was generating some classes based on a schema, but when I went to use the classes, I became confused. For some reason when generating a section that simply contains an array of another complex type, it ends up creating a double array of the inner class, rather than a normal array of the parent type which would contain a single array of the child class. This had me pretty confused for awhile but luckily I was able to find a solution online, which saved me from hand-bombing the fix.

Interestingly, while I'm currently using xsd.exe to gen the classes, I'm actually more a fan of the Skeleton Crew tools from BoneSoft. If you ever need to generate schema's from XML, or classes from schema's, or both, give it a try.

No comments: