|
Paul King made changes - 23/Aug/07 05:40 AM
I am going to close this. I don't think this suggested change in behaviour fits in with the current semantics of XmlParser. If I have a NodeList with a, b, a, b elements in it, then list.a produces a new NodeList with two elements in it. You can remove then one of those two elements but that doesn't affect the original 4 element list. To make that work we would have to have a 'late-evaluating' style wrapper which is what XmlSlurper gives you. Please re-open with some additional arguments and use cases if you really see some value in this behaviour. Thanks.
Paul King made changes - 09/Oct/07 05:20 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The issue is that node.nodeList returns a copy of the relevant nodes. The remove actually works but only in the copy.
If you go and use node.nodeList again, it generates a new list. I am not sure if this is a bug or a feature but the workaround is: