<?xml version="1.0" encoding="utf-8" ?>
<Root>
<Fruits>
<Fruit>hahahaha</Fruit>
</Fruits>
</Root>
如果我试试这个代码想,我怎样才能节点,我从XML
string[] cFruitName; int i=0;
XmlDocument a= new XmlDocument();
a.LoadXml(getXML());
foreach (XmlNode xn in a)
{
cFruitName[i] = xn.Text;
i++;
}
但我正在逐渐null
为xn.Text
。
我只想得到水果的价值,就像这个例子中的“hahahah”。
编辑
现在我改变了我的XML。
为什么会出现内部水果 – tariq
水果有这样做的没有更好的办法,请告诉我 – Mathematics