Код: Выделить всё
Alice30
Bob31
Charley29
Dory25
Код: Выделить всё
XmlDocument submission = new XmlDocument();
submission.LoadXml(xml);
var bookNodes = submission.SelectNodes("//*[starts-with(local-name(),'book_')]");
Код: Выделить всё
foreach (XmlNode book in bookNodes)
{
//I want to do something like to find book authors for the book in context e.g. for the first book I just want nodes for Alice and Bob.
// var bookAuthors = book.SelectNodes("decendants::[starts-with(local-name(),'author_')");
}
РЕДАКТИРОВАТЬ:
Похоже, это опечатка...
var bookAuthors = book.SelectNodes("descendant::*[starts-with(local-name (),'MeritCriterion_')]");
Подробнее здесь: https://stackoverflow.com/questions/504 ... a-xml-node
Мобильная версия