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.

Full log


View this message in rfc822 format

From: David Engster <deng <at> randomsample.de>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 23440 <at> debbugs.gnu.org
Subject: 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-*")))

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.