Structure
Code:
XPathNavigator XNode = this.CreateNavigator().SelectSingleNode("/my:myFields/my:PagingHistory", this.NamespaceManager);
XPathNodeIterator nodeTOdeleted = this.CreateNavigator().Select("/my:myFields/my:PagingHistory/my:PageHistory", NamespaceManager);
if (nodeTOdeleted .Count > 1)
{
string group = "/my:myFields/my:PagingHistory/my:PageHistory";
XPathNavigator firstItem = XNode.SelectSingleNode(group + "[2]", NamespaceManager);
XPathNavigator lastItem = XNode.SelectSingleNode(group + "[position()=last()]", NamespaceManager);
firstItem.DeleteRange(lastItem);
lastItem = null;
firstItem = null;
}
node_2b_deleted = null;
No comments:
Post a Comment