Problem
The current Elements visitor returns a Set meaning that it cannot be streamed as every element needs to be kept in memory. This prevents working on large documents that can't fit in memory.
Solution
- Add a new visitor with the signature
All::elements(non-empty-string)(Node): Sequence<Element>
- Deprecate
Elements visitor
The important part of this new visitor is that it returns a Sequence that can be lazy.
Problem
The current
Elementsvisitor returns aSetmeaning that it cannot be streamed as every element needs to be kept in memory. This prevents working on large documents that can't fit in memory.Solution
All::elements(non-empty-string)(Node): Sequence<Element>ElementsvisitorThe important part of this new visitor is that it returns a
Sequencethat can be lazy.