GNU bug report logs - #17964
24.3; xml-print inserts spurious whitespace

Previous Next

Package: emacs;

Reported by: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>

Date: Mon, 7 Jul 2014 12:56:01 UTC

Severity: normal

Tags: confirmed, wontfix

Found in version 24.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17964 in the body.
You can then email your comments to 17964 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17964; Package emacs. (Mon, 07 Jul 2014 12:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 07 Jul 2014 12:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; xml-print inserts spurious whitespace
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>"




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Mar 2016 14:15:04 GMT) Full text and rfc822 format available.

Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Mar 2016 14:16:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 17964 <at> debbugs.gnu.org and Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Mar 2016 14:16:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17964; Package emacs. (Tue, 01 Mar 2016 14:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 17964 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>
Cc: 17964 <at> debbugs.gnu.org
Subject: Re: bug#17964: 24.3; xml-print inserts spurious whitespace
Date: Tue, 01 Mar 2016 17:14:52 +1100
Juliusz Chroboczek <jch <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17964; Package emacs. (Tue, 01 Mar 2016 17:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 17964 <at> debbugs.gnu.org (full text, mbox):

From: Ulf Jasper <ulf.jasper <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 17964 <at> debbugs.gnu.org, Juliusz Chroboczek <jch <at> pps.univ-paris-diderot.fr>
Subject: Re: bug#17964: 24.3; xml-print inserts spurious whitespace
Date: Tue, 01 Mar 2016 18:16:56 +0100
Hi Juliusz,

Am 01.03.2016 um 17:14 (+1100) schrieb Lars Ingebrigtsen:
> Juliusz Chroboczek <jch <at> 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.

[Not directly related to the bug report but maybe helpful:]

'newsticker.el' already does parsing of different Atom and RSS feeds.
Maybe you can re-use some of that functionality.  Please have a look at
newst-backend.el.

Best,
Ulf




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Mar 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.