GNU bug report logs - #26533
26.0.50; xml-parse-region's symbol-qname argument is ignored

Previous Next

Package: emacs;

Reported by: Christopher Wellons <wellons <at> nullprogram.com>

Date: Sun, 16 Apr 2017 12:49:01 UTC

Severity: normal

Found in version 26.0.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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: David Engster <deng <at> randomsample.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#26533: closed (26.0.50; xml-parse-region's symbol-qname
 argument is ignored)
Date: Mon, 17 Apr 2017 15:34:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 17 Apr 2017 17:33:07 +0200
with message-id <874lxncamk.fsf <at> engster.org>
and subject line Re: bug#26533: 26.0.50; xml-parse-region's symbol-qname argument is ignored
has caused the debbugs.gnu.org bug report #26533,
regarding 26.0.50; xml-parse-region's symbol-qname argument is ignored
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
26533: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26533
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christopher Wellons <wellons <at> nullprogram.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; xml-parse-region's symbol-qname argument is ignored
Date: Sun, 16 Apr 2017 08:36:07 -0400
A bug was introduced in aea67018 that causes the special "symbol-qnames"
value for PARSE-NS to be ignored, as if it were nil. This information is
discarded by the change to xml-parse-attlist, so functions further down
the line see the argument as if it was set to nil.

Here's an example of the bug:

    (with-temp-buffer
      (insert "<root a:b='c'></root>")
      (let ((xml-default-ns ()))
        (xml-parse-region nil nil nil nil 'symbol-qnames)))

Prior to this commit (Emacs 25.1 and earlier) the result is:

    ((root ((b . "c"))))

After this commit:

    ((root ((a:b . "c"))))

This is the same as PARSE-NS being set to nil.


[Message part 3 (message/rfc822, inline)]
From: David Engster <deng <at> randomsample.de>
To: Christopher Wellons <wellons <at> nullprogram.com>
Cc: 26533-done <at> debbugs.gnu.org
Subject: Re: bug#26533: 26.0.50;
 xml-parse-region's symbol-qname argument is ignored
Date: Mon, 17 Apr 2017 17:33:07 +0200
Christopher Wellons writes:
> A bug was introduced in aea67018 that causes the special "symbol-qnames"
> value for PARSE-NS to be ignored, as if it were nil. This information is
> discarded by the change to xml-parse-attlist, so functions further down
> the line see the argument as if it was set to nil.
>
> Here's an example of the bug:
>
>     (with-temp-buffer
>       (insert "<root a:b='c'></root>")
>       (let ((xml-default-ns ()))
>         (xml-parse-region nil nil nil nil 'symbol-qnames)))
>
> Prior to this commit (Emacs 25.1 and earlier) the result is:
>
>     ((root ((b . "c"))))
>
> After this commit:
>
>     ((root ((a:b . "c"))))
>
> This is the same as PARSE-NS being set to nil.

Thanks for the report.

You are right that the fix for bug #23440 was not correct. I now pushed
a hopefully better version to master.

Note however that your test above has two problems: First, it's invalid
XML since you're using an undeclared prefix (so the parser should rather
throw an error, but I'm not eager to make the xml parser more strict, as
there's a lot of invalid XML in the wild). Second, I don't understand
why you let-bind `xml-default-ns' to nil. This will break namespace
expansion, and it will actually do this for the whole Emacs session if
xml.el gets autoloaded during the above.

-David


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

Previous Next


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