I can't believe how unbelievably complicated this has been...
I have the following XML...
<Library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mynamespace.com/books">
<Rows>
<Row>
<Author><Name>Stephen King</Name></Author>
</Row>
</Rows>
</Library>
I would like the Deserialized C# object to read like... Library.Books[0].Author
I have tried a million different combination of XML Attribute Markings to Deserialize, such as...
[XmlRootAttribute("Library", Namespace = "http://mynamespace.com/books", IsNullable = false)]
public class Library
{
[XmlElement("Rows")]
public List<Book> Books { get; set; }
}
[XmlRoot("Row")]
public class Book
{
public Author Author { get; set; }
}
[XmlRoot("Author")]
public class Author
{
public string Name { get; set; }
}
...and I continually get the "Author" object as null when I try to Deserialze. It almost succeeds...I do get the ArrayList with one Book item in the Books property. But for the life of me I can't get the Author.
Any advice/help would be greatly appreciated!