どこが間違っているか分かる人いますか?または、ビデオ名を文字列にするより良い方法はありますか?
string text = "<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007'><entry><title>VIDEO NAME</title></entry></feed>";
string xpath = "feed/entry";
XmlDocument xml = new XmlDocument();
xml.LoadXml(text);
XmlNodeList nodes = xml.SelectNodes(xpath);
foreach (XmlNode node in nodes)
{
string title = node["title"].InnerText;
MessageBox.Show(title);
}
XML
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<entry>
<title>VIDEO NAME</title>
</entry>
</feed>