Clojure

clojure.xml emit does not properly escape attribute and element content

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None

Description

(with-out-str
  (clojure.xml/emit-element {:tag :e :attrs nil :content "&"}))
</code></pre>
produces: <e>&</e>
correct would be: <e>&amp;</e>
This is true for both element content and attribute content. < and > are not escaped as well. Furthermore, apostrophe ( ' ) in an attribute value leads to broken xml:
<pre><code>
<e a='''/>

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/408 Attachments: 408-escape-and-in-content-and-attribute-value.patch - https://www.assembla.com/spaces/clojure/documents/aBCHT2LZer34ioeJe5cbLr/download/aBCHT2LZer34ioeJe5cbLr
Hide
Assembla Importer added a comment -

bpsm said: Tests that demonstrate #408 are available at http://github.com/bpsm/test-clojure-xml.

Show
Assembla Importer added a comment - bpsm said: Tests that demonstrate #408 are available at http://github.com/bpsm/test-clojure-xml.
Hide
Assembla Importer added a comment -

bpsm said: I saw rich's message about marking issues "ready for test" to get patches noticed. This was in connection with marking #410 as ready for test. This issue is joined at the hip with 410 and also has a patch ready.

Show
Assembla Importer added a comment - bpsm said: I saw rich's message about marking issues "ready for test" to get patches noticed. This was in connection with marking #410 as ready for test. This issue is joined at the hip with 410 and also has a patch ready.
Hide
Stuart Halloway added a comment -

emit is not part of Clojure's public API, and we don't want to grow a public API via an issue-driven random walk. If you are interested in this issue, please chime in on the design page for a new data.xml library: http://dev.clojure.org/display/DXML/Home

Show
Stuart Halloway added a comment - emit is not part of Clojure's public API, and we don't want to grow a public API via an issue-driven random walk. If you are interested in this issue, please chime in on the design page for a new data.xml library: http://dev.clojure.org/display/DXML/Home

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: