Skip to content

Instantly share code, notes, and snippets.

@solussd
Created January 11, 2012 15:19

Revisions

  1. solussd created this gist Jan 11, 2012.
    9 changes: 9 additions & 0 deletions gistfile1.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    (defn generate-file-audit-xml
    "Takes a seq of DirectoryRecords that contains the file audit and outputs an XML string with a
    top level element with the value of file-audit/audit-rootkey"
    [directory-records]
    {:pre [(sequential? directory-records)]}
    (let [out *out*]
    (-> (binding [*out* out] {:tag audit-rootkey :attrs {} :content (map to-xml-struct directory-records)})
    xml/emit
    with-out-str)))