1
我正在尋找數在一個巨大的XML文件的一些標籤的最快方式(120MB)XPATH評估VS創建XPathNodeIterator
long Quantity;
XPathDocument xDocData = new XPathDocument(str_File_path);
XPathNavigator xNavData = xDocData.CreateNavigator();
//Option 1
XPathExpression xExp = xNavData.Compile("sum(Tag/Value)");
Quantity = Convert.ToInt64(xNavData.Evaluate(xExp));
//Option 2
XPathNodeIterator xNodeIter = xNavData.Select(xExp);
while(xNodeIter.MoveNext())
{
Quantity += xNodeIter.Current.ValueAsLong;
}
有什麼建議?
的問候和感謝事先