XPath的问题
有一个xml文件如下所示:
<bookstore xmlns="schema.xsd">
<book genre="autobiography" publicationdate="1981" ISBN="1-861003-11-0">
<title>The Autobiography of Benjamin Franklin</title>
</book>
<book genre="novel" publicationdate="1967" ISBN="0-201-63361-2">
<title>The Confidence Man</title>
</book>
<book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6">
<title>The Gorgias</title>
</book>
</bookstore>
以下是C#的代码:
XPathNodeIterator myXPathNodeIterator = myXPathNavigator.Select("/bookstore/book/title");
while(myXPathNodeIterator.MoveNext())
{
Console.WriteLine("<" + myXPathNodeIterator.Current.Name + "> " + myXPathNodeIterator.Current.Value);
}
我不能得到title的值,这是为什么?