Попробуйте установить атрибуты, как показано ниже. Обратите внимание, что вам придется изменить тип Value
в классе Cell
с object
на string
.
[XmlRoot("table")]
public class Table
{
[XmlElement(typeof(Row), ElementName = "tr")]
public List<Row> Rows { get; set; }
}
public class Row
{
[XmlElement(typeof(Cell), ElementName = "td")]
public List<Cell> Cells { get; set; }
}
public class Cell
{
[XmlText(typeof(string))]
public string Value { get; set; }
}