[DXML-13] Support for preserving whitespace between tags Created: 10/Feb/13 Updated: 15/Dec/14
|Reporter:||Kevin Albrecht||Assignee:||Ryan Senior|
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):
This is the current behavior:
|Comment by Aron Nopanen [ 18/Aug/13 3:49 PM ]|
The issue lies with the '.isWhiteSpace' check in this section of function pull-seq:
While the 'props' argument to parse/parse-str currently only holds XMLInputFactory options, perhaps a ':maintain-whitespace' option could be added that affects this behavior? It would be straightforward to pass the props into pull-seq to conditionally perform the .isWhiteSpace check.
|Comment by Aron Nopanen [ 20/Aug/13 12:47 AM ]|
I have attached a patch to support a :maintain-whitespace property to parse and parse-str. If set to 'true', whitespace-only nodes will not be stripped during the parsing process.
|Comment by Ryan Senior [ 10/Nov/13 10:38 PM ]|
Thanks for the patch. Have sent in a contributor agreement? I didn't see you name here: http://clojure.org/contributing. Submitting patches to Clojure contrib libraries requires this.
|Comment by Jason Gilman [ 08/Apr/14 6:51 AM ]|
I'm running into this problem as well. Can this be fixed without using the contributed patch?
|Comment by Jan-Paul Bultmann [ 15/Dec/14 5:15 PM ]|
Aron Nopanen, the author of the patch is now in the contributors list after signing the agreement.