My apologies ... I think I didn't pay close enough attention.
You do need to specify a different name for the element you are writing out
when you do this via XmlElementAttributes, otherwise the XmlSerializer will
not know what the object type to deserialize to when it reads in the
document later.
What should work is to attach an XmlIncludeAttibute to he myclass type to
declare the wizclass type:
[XmlInclude( typeof( wizclass )) ]
public class myclass
{
....
}
the output will then contian an xsi:type attribute to store the type to
deserialize to. I hope that acceptable for you.
--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"stephen prescott" <stephen.prescott@thermo.com> wrote in message
news:ezFcMSHTDHA.1920@TK2MSFTNGP11.phx.gbl...[color=blue]
> Thanks..
>
> I did try this but I get the following error because the attribute and
> namespace are not unique.
>
> There was an error reflecting field 'Entities'. --->
> System.InvalidOperationException: The XML element named 'class' from
> namespace 'blah-de-blah' is already present in the current scope. Use
> XML attributes to specify another XML name or namespace for the element.
>
>
>
> *** Sent via Developersdex
http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]