Renaming classes in XML Serialization

upperrq

New Member
Consider the following C# code:\[code\][XmlRoot]public class A { [XmlArray] public List<B> ArrayOfBItems { get;set; }}public class B{ [XmlAttribute] public String Name { get;set; }}\[/code\]When run through XmlSerialzier, will produce the following:\[code\]<A> <B Name="Foo" /> <B Name="Bar" /></A>\[/code\]What can I do, short of renaming class B to change the name that is output in XML? Adding XmlAttribute to a class is not allowed.
 
Back
Top