Skip to content

Commit 4f05e37

Browse files
committed
Add a comment why insert-xmlns is needed
1 parent 35b6f68 commit 4f05e37

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/clj/mdr2/dtb/xml.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
(list (xml/element ::xhtml/meta {:name "ncc:kByteSize" :content value})))
4646
node))
4747

48+
;; Insert a xmlns attribute in the root node to avoid namespace
49+
;; prefixes in all nodes. See
50+
;; https://github.com/clojure/data.xml?tab=readme-ov-file#namespace-support
51+
;; and
52+
;; https://ask.clojure.org/index.php/8788/possible-namespace-aliases-emitted-strings-clojure-alpha6
4853
(defn insert-xmlns [node]
4954
(assoc-in node [:attrs :xmlns] xhtml-uri))
5055

0 commit comments

Comments
 (0)