Groups | Blog | Home
all groups > dotnet xml > october 2003 >

dotnet xml : Generating serializable class using XSD.exe


tushar
10/7/2003 11:54:28 AM
Hi

Serializable classes generated from xsd files using xsd.exe always uses an
array? Is there any way to force xsd.exe to use collection (ArrayList or
equivalent) classes instead of Array? is there any other tool that could be
used?

Thanks in advance

Regards

Christoph Schittko [MVP]
10/7/2003 10:11:41 PM
Cross post ... YUCK!

you couldn't possibly include any other groups, could you ...

check out David Cazzulino's blog for a work around.

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[quoted text, click to view]

Christoph Schittko [MVP]
10/7/2003 10:14:44 PM
Daniel Cazzulino ... not David ... ts ts ts

[quoted text, click to view]

Christoph Schittko [MVP]
10/8/2003 9:52:28 AM
Hmm ..maybe I've been around for too long, but cross-posting's been a no no
for a long time.

Anyway, unfortunately there is no way to generate Collections from
xsd.exe -- although I wish that there was. If you are planning to generate
the serialization classes as part of an automated build then you would have
to process the output of xsd.exe through an extra little program that
replaces the arrays using regular expressions. The expression is pretty
straight forward integrating this modification into your build process will
avoid any extra work if you ever have to rebuild your classes.

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[quoted text, click to view]

tushar
10/8/2003 5:42:54 PM
Christoph

I checked David Cazzulino's blog but could not find the work around you
mentioned. Anyway, thanks for your reply. I guess I will just write
collection wrappers around source generated by xsd.exe.

I am not a big user of news groups so was really not aware that posting
message in multiple groups is that YUCK as you say! I was just tried to get
max readers by posting in multiple groups.

Regards

"Christoph Schittko [MVP]" <christophdotnetINVALID@austin.rr.com> wrote in
message news:eAYemnUjDHA.2276@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

JasonWilson101 NO[at]SPAM hotmail.com
10/20/2003 6:14:59 AM
You could also look at liquid technologies data binding wizard, it
creates strongly typed collection classes rather than arrays (in C#).

http://www.liquid-technologies.com/

We've been using it for a bit now, and it seems pretty solid.

Cheers

[quoted text, click to view]
Daniel Cazzulino
11/7/2003 3:53:18 PM
Thanks Chris for mentioning my post.
"tushar", you can use the technique I explained in weblog to modify XSD-like
generated CodeDom and replace the arrays with ArrayLists, no problem there.
I figure you could even get to generate a CollectionBase-inherited class.
However, I don't know how the XmlSerializer would handle that change...


"Christoph Schittko [MVP]" <christophdotnetINVALID@austin.rr.com> wrote in
message news:uF9jMvajDHA.3612@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button