diff options
Diffstat (limited to 'modules/prxml/src/main/clojure/clojure/contrib/prxml.clj')
-rw-r--r-- | modules/prxml/src/main/clojure/clojure/contrib/prxml.clj | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/prxml/src/main/clojure/clojure/contrib/prxml.clj b/modules/prxml/src/main/clojure/clojure/contrib/prxml.clj index 2c2ec761..a680c773 100644 --- a/modules/prxml/src/main/clojure/clojure/contrib/prxml.clj +++ b/modules/prxml/src/main/clojure/clojure/contrib/prxml.clj @@ -27,7 +27,7 @@ :doc "Compact syntax for generating XML. See the documentation of \"prxml\" for details."} clojure.contrib.prxml - (:use [clojure.contrib.string :only (escape as-str)])) + (:use [clojure.string :only (escape)])) (def ^{:doc "If true, empty tags will have a space before the closing />"} @@ -43,11 +43,17 @@ for details."} (def ^{:private true} print-xml) ; forward declaration (defn- escape-xml [s] - (escape {\< "<" - \> ">" - \& "&" - \' "'" - \" """} s)) + (escape s {\< "<" + \> ">" + \& "&" + \' "'" + \" """})) + +(defn- as-str + [x] + (if (instance? clojure.lang.Named x) + (name x) + (str x))) (defn- prxml-attribute [name value] (print " ") |