Subject: bug#17964: 24.3; xml-print inserts spurious whitespace

From: Juliusz Chroboczek <[email-masked]>
Date: Mon, 07 Jul 2014 14:54:30 +0200

Hi.

I'm trying to use Emacs' XML parser to parse Atom feeds, and I'm finding
that xml-print inserts spurious whitespace in the XHTML content, which
breaks formatting.  Here's a pretty minimal example:

(require 'xml)

(defun xml-parse-from-string (s)
  (with-temp-buffer
    (insert s)
    (xml-parse-region (point-min) (point-max))))

(defun xml-print-to-string (x)
  (with-temp-buffer
    (xml-print x)
    (buffer-substring (point-min) (point-max))))

(xml-print-to-string (xml-parse-from-string "<p>[<a>foo</a>]</p>"))
"<p>[
  <a>foo</a>]
</p>"