I have the following xml structure that i am trying to convert to C#, I appreciate the assistance:
<AnimalTypeList>
<Type>Tiger</Type>
<Type>Rabbit</Type>
<AnimalTypeList>
So far i have the following C# defined in my sample app. I am having difficulty correctly satisfying the above structure:
public class TestApp
{
[XmlArrayItem(ElementName="Type")]
public AnimalTypeListType[] AnimalTypeList {get; set;}
}
Here is the other class
public class AnimalTypeListType
{
[XmlElement]
public string Type {get; set;}
}
Here is my schema:
<xs:element name="AnimalTypeList" type="AnimalTypeListType"/>
<xs:complexType name="AnimalTypeListType">
<xs:sequence>
<xs:element type="xs:string" name="Type" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>