[DXML-13] Support for preserving whitespace between tags Created: 10/Feb/13 Updated: 10/Feb/13 |
|
| Status: | Open |
| Project: | data.xml |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Major |
| Reporter: | Kevin Albrecht | Assignee: | Ryan Senior |
| Resolution: | Unresolved | Votes: | 0 |
| 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
|