Skip to content

Commit

Permalink
easy-xml
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijndevos committed Nov 23, 2011
1 parent 5abdfad commit 091cc7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/armagedom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,14 @@
"Return document as string"
[document]
(with-out-str (spit-xml *out* document)))

(defn map-syntax [m]
(for [[k v] m]
(cons k
(cond
(map? v) (map-syntax v)
(coll? v) (mapcat map-syntax v)
:else [v]))))

(defn easy-xml [root uri m]
(apply xml root uri [] (map-syntax m)))

0 comments on commit 091cc7d

Please sign in to comment.