data.xml

Support for preserving whitespace between tags

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Completed
  • 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

Activity

Aron Nopanen made changes -
Field Original Value New Value
Attachment DXML-13.patch [ 12195 ]
Herwig Hochleitner made changes -
Assignee Ryan Senior [ ryansenior ] Herwig Hochleitner [ bendlas ]
Herwig Hochleitner made changes -
Status Open [ 1 ] In Progress [ 3 ]
Herwig Hochleitner made changes -
Resolution Completed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]

People

Vote (3)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: