Details
-
Type:
Enhancement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
XML parsers can support preserving white space nodes, but clojure.data.xml does not seem to support this functionality.
For example, the following should be able to return true (perhaps with an option to parse-str):
Desired Behavior
(= (clojure.data.xml/element :x {}
(clojure.data.xml/element :a {} "foo")
" "
(clojure.data.xml/element :a {} "bar"))
(clojure.data.xml/parse-str
(str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<x>"
"<a>foo</a>"
" "
"<a>bar</a>"
"</x>")))
;=> true
This is the current behavior:
Current Behavior
(= (clojure.data.xml/element :x {}
(clojure.data.xml/element :a {} "foo")
(clojure.data.xml/element :a {} "bar"))
(clojure.data.xml/parse-str
(str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<x>"
"<a>foo</a>"
" "
"<a>bar</a>"
"</x>")))
;=> true