public bool MoveNext()
{
if (!_navStack.IsEmpty)
{
while (true)
{
// Move to the next matching node that is before the top node on the stack in document order
if (_filter.MoveToFollowing(_navCurrent, _navStack.Peek()))
{
// Found match
return(true);
}
// Do not include ancestor nodes as part of the preceding axis
_navCurrent.MoveTo(_navStack.Pop());
// No more preceding matches possible
if (_navStack.IsEmpty)
{
break;
}
}
}
return(false);
}