Takes all nodes (under the current element) matched by src-selector, removes
them and combines them with the elements matched by dest-selector.
By default, destination elements are replaced.
(defn move
"Takes all nodes (under the current element) matched by src-selector, removes
them and combines them with the elements matched by dest-selector.
By default, destination elements are replaced."
([src-selector dest-selector] (move src-selector dest-selector substitute))
([src-selector dest-selector combiner]
(fn [node-or-nodes]
(let [nodes (select node-or-nodes src-selector)]
(at node-or-nodes
src-selector nil
dest-selector (apply combiner nodes))))))
Comments top
No comments for move. Log in to add a comment.