         (str->badge user))
       (some->>
         doc .getDocumentCatalog .getMetadata .createInputStream
-        xml/parse (find-tag :openbadges:assertion) :attrs :verify
+        xml/parse (find-tag 0 :openbadges:assertion) :attrs :verify
         string/trim
         (str->badge user)))))
 


;;;

(defmulti file->badge (fn [_ upload]
                        (or (:content-type upload)
                            (get-in upload [:headers "Content-Type"]))))

             (str->badge user))))

(defmethod file->badge "image/svg+xml" [user upload]
  (some->> (or (:tempfile upload) (:body upload))
           xml/parse (find-tag 0 :openbadges:assertion) :attrs :verify
           string/trim
           (str->badge user)))

(defmethod file->badge "application/pdf" [user upload]
  (with-open [doc (pdf/obtain-document (or (:tempfile upload) (:body upload)))]
