bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#17964: 24.3; xml-print inserts spurious whitespace
Date: Tue, 01 Mar 2016 17:14:52 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Juliusz Chroboczek <jch@pps.univ-paris-diderot.fr> writes:

> 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>"

I can confirm that this is still an issue on the Emacs trunk.  However,
our XML reader does not retain information about whitespace (or the lack
of it).  And

<p>[
   <a>foo</a>]
 </p>

is perfectly valid XML.  I don't really think there's a way to "fix"
this, if it's considered a bug, which is kinda isn't.  So I'm closing
this as "wontfix".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]