Uploaded image for project: 'Clojure'
  1. CLJ-408

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

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Declined
    • Affects versions: None
    • Fix versions: Backlog
    • 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='''/>
      

        Attachments

          Activity

            People

            • Assignee:
              richhickey Rich Hickey
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: