Below roundtrip produces invaild xml as the result is not escaped correctly, i.e. the attribute values contain ' instead of apos;. Am I doing somthing wrong or is this a bug?
(ns xml-test
(:require [clojure.xml :as xml])
(:require [clojure.zip :as zip]))
(def test-xml "<?xml version="1.0" encoding="UTF-8"?> <main> <item attr=''test''> </item> </main>")
(def s (ByteArrayInputStream. (.getBytes test-xml "UTF-8")))
(xml/emit (zip/root (zip/xml-zip (clojure.xml/parse s))))
output:
<?xml version='1.0' encoding='UTF-8'?>
<main>
<item attr=''test''/>
</main>
nil