What would be the best and/or simplest way to remove an element from a XML document using anti-xml?
Best way to remove an element in an XML using anti-xml
104 views Asked by JWC At
2
There are 2 answers
0
On
Not sure whether this is better or not, but you could use the drop method, like so:
(xml \\ 'nodeToRemove drop 1).unselect.head
which assumes a single occurrence of nodeToRemove; you can drop all items in the resulting Zipper if there is more than one occurrence.
Also, as the drop complements, the take and slice methods remove anything that's not included in their ranges.
Here is one way:
Any others?