Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.3
-
Fix Version/s: 2.0-beta-3, 1.8.7
-
Component/s: XML Processing
-
Labels:None
-
Environment:(any)
-
Number of attachments :
Description
Node.depthFirst() is expected to recursively include all Node.children() elements. The attached program demonstrates a counter example, where Node.depthFirst() 'forgets' all 3 text chldren resulting in a list of 4 instead of 7 elements.
The correct semantics of "Node.depthFirst()" is defined by "depthFirst( node )" in the attached program.
The behavior of depthFirst and breadthFirst for XmlParser was aligned with XmlSlurper some time back and it intentionally 'forgets' text nodes - just processing elements. I guess we should allow for both behaviors. Certainly depthFirst and breadthFirst need to be kept consistent. The same comments apply to the DOMCategory implementation, i.e. if we make changes we should align its behavior as well.