Open nverwer opened 7 years ago
If I 'solidify' the result
after evaluating an expression, using
result = BufferedNodeIterator.Preload(result as XPath2NodeIterator);
the test seems to work.
The problem is, that before making the result into a BufferedNodeIterator
, result.Count
is incorrect.
Then I tried to make the result into a list before assigning it to a variable:
result = (result as XPath2NodeIterator).ToList();
This works, and the Count
is right.
Is this the recommended way of storing an iterator in a variable?
Node iterators do not work correctly when one of the items is a variable containing the result of a previous XPath2 evaluation. I added the following test to XPath2ExtensionsTest (not the right place):
After every evaluation, the
result
contains only one item, which is the selected node. I would expect theresult
to contain 3 items at the end. The contents of the variable are lost.