all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Engster <deng@randomsample.de>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 23440@debbugs.gnu.org
Subject: bug#23440: 25.1.50; xml.el parses default namespace incorrectly
Date: Wed, 04 May 2016 08:06:36 +0200	[thread overview]
Message-ID: <87mvo61hn7.fsf@engster.org> (raw)
In-Reply-To: <87eg9ihdkz.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 04 May 2016 08:27:40 +0800")

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: xml-patch.diff --]
[-- Type: text/x-diff, Size: 604 bytes --]

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

  reply	other threads:[~2016-05-04  6:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  0:27 bug#23440: 25.1.50; xml.el parses default namespace incorrectly Eric Abrahamsen
2016-05-04  6:06 ` David Engster [this message]
2016-05-04  6:55   ` Eric Abrahamsen
     [not found] ` <handler.23440.B.146232172514754.ack@debbugs.gnu.org>
2017-01-23 18:56   ` bug#23440: Acknowledgement (25.1.50; xml.el parses default namespace incorrectly) Eric Abrahamsen
2017-01-23 21:15     ` Glenn Morris
2017-01-23 22:32       ` Eric Abrahamsen
2017-01-24 21:58         ` David Engster
2017-01-25 22:44         ` Glenn Morris
2017-01-26  7:04           ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvo61hn7.fsf@engster.org \
    --to=deng@randomsample.de \
    --cc=23440@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.