Context
I’m outputting a xml file from clojure using data.xml. I need to output the following line:
<use xlink:href="#whiskers" transform="scale(-1 1) translate(-140 0)" />
(We’re drawing a cat in SVG).
Now, my try is something like:
(indent-str (element :use {:xlink:href "#whiskers",
:transform "scale(-1 1) translate(-140 0)"}))
This fails because
:xlink:href “#whiwksers”
is apparently interpreted as:
:xlink ,
:href “#whiskers”
Question
How do I create a clojure symbol to output “xlink:href” as a field for data.xml?
Edit
I have tried:
(keyword “xlink:href”)
still same error. Not sure what’s going on.
I’m not sure there is an error here.
The
indent-strfunction has a problem though:So it appears
clojure.data.xmlis namespace aware. Let’s try this:That’s better. If anything, I guess you could argue that
emit-stris wrong because it didn’t throw an exception.