Compact syntax for generating XML. See the documentation of "prxml" for details.
Compact syntax for generating XML. See the documentation of "prxml" for details.
If true, empty tags will have a space before the closing />
If true, empty tags will have a space before the closing />
The number of spaces to indent sub-tags. nil for no indent and no extra line-breaks.
The number of spaces to indent sub-tags. nil for no indent and no extra line-breaks.
(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"]]) ; => <p class="greet"><i>Ladies & gentlemen</i></p>
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! "<i>here & gone</i>"]]) ; => <p><i>here & gone</i></p>
(prxml [:decl! {:version "1.1"}]) ; => <?xml version="1.1" encoding="UTF-8"?>
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"]]) ; => <p class="greet"><i>Ladies & gentlemen</i></p> 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! "<i>here & gone</i>"]]) ; => <p><i>here & gone</i></p> (prxml [:decl! {:version "1.1"}]) ; => <?xml version="1.1" encoding="UTF-8"?>
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close