I have a relatively simple xsd which I am turning into a class using
"xsd.exe". I then create a collection of these classes. I have run
into one minor problem. When serializing my collection, I would like
the names of the elements to be different from the class name as
generated by xsd.exe. I don't want to change the class name itself,
due to naming conventions. This is trivial to do after-the-fact by
adding the "XmlType" tag to the signature of the class. However, when
I regenerate from the xsd, the tag disappears. Is there some way of
putting the "XmlType" information into the xsd so that xsd.exe
maintains it? Alternatively, is there an easy way to rename the
elements when serializing?
Thanks!
Brad.
Yan Leshinsky - 05 Jun 2004 04:48 GMT
Following is a detailed description on how to do that:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemxmlserializationxmlattributeoverridesclasstopic.asp
>I have a relatively simple xsd which I am turning into a class using
> "xsd.exe". I then create a collection of these classes. I have run
[quoted text clipped - 10 lines]
> Thanks!
> Brad.
Bradley Plett - 09 Jun 2004 22:14 GMT
I have been unable to make that sample work for a class that inherits
from a collection. Any further help or examples would be much
appreciated!
Thanks!
Brad.
>Following is a detailed description on how to do that:
>
[quoted text clipped - 14 lines]
>> Thanks!
>> Brad.