GNU bug report logs - #23440
25.1.50; xml.el parses default namespace incorrectly

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Wed, 4 May 2016 00:29:01 UTC

Severity: normal

Tags: patch

Found in version 25.1.50

Done: David Engster <deng <at> randomsample.de>

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 23440 in the body.
You can then email your comments to 23440 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#23440; Package emacs. (Wed, 04 May 2016 00:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 04 May 2016 00:29:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; xml.el parses default namespace incorrectly
Date: Wed, 04 May 2016 08:27:40 +0800
Apparently xml.el isn't doing quite the right thing when parsing xml
default namespaces. With the following text:

<multistatus xmlns="DAV:">
</multistatus>

M-: (xml-parse-region nil nil nil nil 'symbol-qnames)

Should return:

((DAV:multistatus ((... . "DAV:"))

But actually returns:

((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:"))

A bit more background:

http://article.gmane.org/gmane.emacs.devel/203476/


In GNU Emacs 25.1.50.20 (i686-pc-linux-gnu, GTK+ Version 3.20.3)
 of 2016-05-01 built on pellet
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Wed, 04 May 2016 06:07:02 GMT) Full text and rfc822 format available.

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

From: David Engster <deng <at> randomsample.de>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 23440 <at> debbugs.gnu.org
Subject: Re: bug#23440: 25.1.50; xml.el parses default namespace incorrectly
Date: Wed, 04 May 2016 08:06:36 +0200
[Message part 1 (text/plain, inline)]
Eric Abrahamsen writes:
> Apparently xml.el isn't doing quite the right thing when parsing xml
> default namespaces. With the following text:
>
> <multistatus xmlns="DAV:">
> </multistatus>
>
> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>
> Should return:
>
> ((DAV:multistatus ((... . "DAV:"))
>
> But actually returns:
>
> ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:"))

Should be fixed by the attached patch, but I need to test a bit more
before pushing it.

-David

[xml-patch.diff (text/x-diff, inline)]
diff --git a/lisp/xml.el b/lisp/xml.el
index 414300c..848a030 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -646,8 +646,10 @@ xml-parse-string
 (defun xml-parse-attlist (&optional xml-ns)
   "Return the attribute-list after point.
 Leave point at the first non-blank character after the tag."
-  (let ((attlist ())
-	end-pos name)
+  (let* ((attlist ())
+	 (symbol-qnames (eq (car-safe xml-ns) 'symbol-qnames))
+	 (xml-ns (if symbol-qnames (cdr xml-ns) xml-ns))
+	 end-pos name)
     (skip-syntax-forward " ")
     (while (looking-at (eval-when-compile
 			 (concat "\\(" xml-name-re "\\)\\s-*=\\s-*")))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Wed, 04 May 2016 06:56:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: 23440 <at> debbugs.gnu.org
Subject: Re: bug#23440: 25.1.50; xml.el parses default namespace incorrectly
Date: Wed, 04 May 2016 14:55:29 +0800
On 05/04/16 08:06 AM, David Engster wrote:
> Eric Abrahamsen writes:
>> Apparently xml.el isn't doing quite the right thing when parsing xml
>> default namespaces. With the following text:
>>
>> <multistatus xmlns="DAV:">
>> </multistatus>
>>
>> M-: (xml-parse-region nil nil nil nil 'symbol-qnames)
>>
>> Should return:
>>
>> ((DAV:multistatus ((... . "DAV:"))
>>
>> But actually returns:
>>
>> ((multistatus ((http://www\.w3\.org/2000/xmlns/xmlns . "DAV:"))
>
> Should be fixed by the attached patch, but I need to test a bit more
> before pushing it.

This solved my org-caldav <--> radicale server sync problem.

Thanks,
Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Mon, 23 Jan 2017 18:57:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: 23440 <at> debbugs.gnu.org
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Mon, 23 Jan 2017 13:56:39 -0500
I've been using this patch for months, with no ill effect. I hope
someone can push it soon!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Mon, 23 Jan 2017 21:16:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 23440 <at> debbugs.gnu.org
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Mon, 23 Jan 2017 16:15:02 -0500
Eric Abrahamsen wrote:

> I've been using this patch for months, with no ill effect. I hope
> someone can push it soon!

Why don't you want to commit it yourself?

(If you are waiting for David, then note that AFAICS you did not cc him
on any of your replies.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Mon, 23 Jan 2017 22:34:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23440 <at> debbugs.gnu.org, deng <at> randomsample.de
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Mon, 23 Jan 2017 17:32:57 -0500
On 01/23/17 16:15 PM, Glenn Morris wrote:
> Eric Abrahamsen wrote:
>
>> I've been using this patch for months, with no ill effect. I hope
>> someone can push it soon!
>
> Why don't you want to commit it yourself?

General hesitation! I was given Gnu access for ELPA, not Emacs. I don't
have much experience with XML. But I'll review CONTRIBUTE and do it.

> (If you are waiting for David, then note that AFAICS you did not cc him
> on any of your replies.)

I forgot a cc was necessary. I'll ping him on this and see if he has any
new opinions. If not I'll just push it.




Reply sent to David Engster <deng <at> randomsample.de>:
You have taken responsibility. (Tue, 24 Jan 2017 21:59:01 GMT) Full text and rfc822 format available.

Notification sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
bug acknowledged by developer. (Tue, 24 Jan 2017 21:59:01 GMT) Full text and rfc822 format available.

Message #25 received at 23440-close <at> debbugs.gnu.org (full text, mbox):

From: David Engster <deng <at> randomsample.de>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: Glenn Morris <rgm <at> gnu.org>, 23440-close <at> debbugs.gnu.org
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Tue, 24 Jan 2017 22:58:03 +0100
Eric Abrahamsen writes:
> I forgot a cc was necessary. I'll ping him on this and see if he has any
> new opinions. If not I'll just push it.

Thanks for the reminder, I completely forgot about that one. I just
pushed it with an accompanying test.

-David




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Wed, 25 Jan 2017 22:45:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 23440 <at> debbugs.gnu.org, deng <at> randomsample.de
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Wed, 25 Jan 2017 17:44:36 -0500
Eric Abrahamsen wrote:

> General hesitation! I was given Gnu access for ELPA, not Emacs.

Ah, ok! There's no way to tell that from the Savannah project membership page.
But in general I think you should feel free.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23440; Package emacs. (Thu, 26 Jan 2017 07:05:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23440 <at> debbugs.gnu.org
Subject: Re: bug#23440: Acknowledgement (25.1.50;
 xml.el parses default namespace incorrectly)
Date: Thu, 26 Jan 2017 02:04:24 -0500
On 01/25/17 17:44 PM, Glenn Morris wrote:
> Eric Abrahamsen wrote:
>
>> General hesitation! I was given Gnu access for ELPA, not Emacs.
>
> Ah, ok! There's no way to tell that from the Savannah project membership page.
> But in general I think you should feel free.

In the future I will!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Feb 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 121 days ago.

Previous Next


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