なぜこれが機能しないのか、誰か説明してもらえますか?
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("Bing2_ss.xml");
//Instantiate an XmlNamespaceManager object.
XmlNamespaceManager xmlnsManager = new XmlNamespaceManager(xmlDoc.NameTable);
//Add the namespaces used in feed to the XmlNamespaceManager.
//xmlnsManager.AddNamespace("base", "https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/Composite");
xmlnsManager.AddNamespace("m", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
xmlnsManager.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices/");
xmlnsManager.AddNamespace(String.Empty, "http://www.w3.org/2005/Atom");
XmlNodeList nodeList;
XmlElement root = xmlDoc.DocumentElement;
nodeList = root.SelectNodes("//m:properties/d:WebTotal", xmlnsManager);
foreach (XmlNode nd in nodeList)
{
System.Console.WriteLine(nd.InnerText);
}
これは元の xml です: http://gezond-afslanken.info/bing2_ss.xml