• (prxml & args)
Print XML to *out*. Vectors become XML tags: the first item is the
tag name; optional second item is a map of attributes.

Sequences are processed recursively, so you can use map and other
sequence functions inside prxml.

(prxml [:p {:class "greet"} [:i "Ladies & gentlemen"]])
; =>

Ladies & gentlemen



PSEUDO-TAGS: some keywords have special meaning:

:raw! do not XML-escape contents
:comment! create an XML comment
:decl! create an XML declaration, with attributes
:cdata! create a CDATA section
:doctype! create a DOCTYPE!

(prxml [:p [:raw! "here & gone"]])
; =>

here & gone



(prxml [:decl! {:version "1.1"}])
; =>

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/prxml.clj:146 top

(defn prxml
  "Print XML to *out*.  Vectors become XML tags: the first item is the
  tag name; optional second item is a map of attributes.

  Sequences are processed recursively, so you can use map and other
  sequence functions inside prxml.

    (prxml [:p {:class \"greet\"} [:i \"Ladies & gentlemen\"]])
    ; => 

Ladies & gentlemen

PSEUDO-TAGS: some keywords have special meaning: :raw! do not XML-escape contents :comment! create an XML comment :decl! create an XML declaration, with attributes :cdata! create a CDATA section :doctype! create a DOCTYPE! (prxml [:p [:raw! \"here & gone\"]]) ; =>

here & gone

(prxml [:decl! {:version \"1.1\"}]) ; => " [& args] (doseq [arg args] (print-xml arg)))
Vars in clojure.contrib.prxml/prxml: defn doseq
Used in 0 other vars

Comments top

1 comment(s) for prxml.

A good discussion of how to use this can be found here.

Also, a 1.3 compatible port is available on github.

Log in to add a comment.