I have this function which in a xml structure gives me the id of a parent node.
(ns foo.core
(:require [clojure.data.zip.xml :as cdzx]))
(defn id-of-parent [zipper child-id node1 node2 node3 node4]
(cdzx/xml-> zipper node1 node2 node3 node4
(cdzx/attr= :Id child-id) zip/up zip/up (cdzx/attr :Id)))
It would be called like
(id-of-parent zipper child-id :Foos :Foo :Bars :Bar)
I would now like to make this function more general by replacing the four "node" with a simple "& path" so I can use any number of nodes to set a path.
(defn id-of-parent [zipper child-id & path]
(cdzx/xml-> zipper ????path????
(cdzx/attr= :Id child-id) zip/up zip/up (cdzx/attr :Id)))
What is the proper way of unrolling the sequence of keywords to single keywords?