我创建了两个 XPathNodeIteratorit
并childIt
在我的代码中
像这样的代码片段,
string selectSfStr = "Equipment/Main/Sub";
it = nav.Select(selectSfStr);
while (it.MoveNext())
{
; // do something here
if (it.Current.HasChildren)
{
XPathNodeIterator childIt;
string selectChildSfStr = "//item";
childIt = nav.Select(selectChildSfStr);
while (childIt.MoveNext())
{
; // do something here, but I found bug. The childIt can't move sychronized with the parent `it`.
;// How can I synchronize `childIt` here when I moved to next `it`.
}
}
}
我的xml文件嵌套在序列中,并且每个节点Equipment/Main/Sub/item
都有多个sub
节点和多个item
sub