title: In clojure enlive how to create template to add values and keys from a map
body: <p>I want to create a template with Clojure's Enlive for a "table" like html page, that should have a header and rows. I want to populate this "table" with data that comes from this map. Basicaly I want to populate header with keys, and cells with vals from each of the maps that come from :event-data key.</p>
  
  <pre><code>(def dummy-content
  {:title "Events Mashup"
   :event-data [{ :event-name "event name 1"
                      :performer "performer 1"
                    :date "date 1"
                         :start-time "start time 1"
                         :end-time "end time 1"}
    {:event-name "event name 2"
                         :performer "performer 2"
                        :date "date 2"
                         :start-time "start time 2"
                         :end-time "end time 2"}]})
  </code></pre>
  
  <p>My snippets and template look like this:</p>
  
  <pre><code>(defsnippet header-cell "index.html" [:.psdg-top-cell] [value] [:.psdg-top-cell]
  
  (defsnippet value-cell "index.html" [:.psdg-right] [value] [:.psdg-right] 
  
  (deftemplate mshp "index.html" [content] 
   [:.psdg-top] (append (for [c (keys content)] (header-cell c)))
   [:.psdg-right] (append (for [v (vals content)] (value-cell v))))
  </code></pre>
  
  <p>And index.html has these tags, that are rellevant for this template.</p>
  
  <pre><code>&lt;div id="psdg-top"&gt;
  &lt;div class="psdg-top-cell" style="width:129px; text-align:left; padding- left:24px;"&gt;Summary&lt;/div&gt;
  &lt;div class="psdg-top-cell"&gt;Website.com&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="psdg-right"&gt;10 000&lt;/div&gt;
  </code></pre>
  
  <p>When I  call the template I get this error:</p>
  
  <pre><code> =&gt; (mshp (:event-data dummy-content))
  </code></pre>
  
  <p>ClassCastException clojure.lang.PersistentHashMap cannot be cast to java.util.Map$Entry  clojure.lang.APersistentMap$ValSeq.first (APersistentMap.java:183)
  What am I doing wrong?</p>