aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Engster2017-04-17 16:52:08 +0200
committerDavid Engster2017-04-17 17:17:00 +0200
commit09eaf661eb6ea49c6324d8819a872c523133dc2b (patch)
treed073537c697580c114b0b06a66172b27900c9b18 /test
parent630df0587e1069b2cd2f2536d5fb61175adac3a2 (diff)
downloademacs-09eaf661eb6ea49c6324d8819a872c523133dc2b.tar.gz
emacs-09eaf661eb6ea49c6324d8819a872c523133dc2b.zip
xml: Properly handle symbol-qnames for attribute parsing
* lisp/xml.el (xml-parse-attlist): Do not strip 'symbol-qnames from xml-ns argument (reverts aea67018) (Bug#26533). (xml-maybe-do-ns): Properly handle default namespace by not interning new symbol when 'special' flag is set. * tests/lisp/xml-tests.el (xml-parse-test--namespace-attribute-qnames) (xml-parse-namespace-attribute-qnames): Add test for Bug#26533.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/xml-tests.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el
index d0da2094db7..16945b0f92d 100644
--- a/test/lisp/xml-tests.el
+++ b/test/lisp/xml-tests.el
@@ -149,6 +149,21 @@ Parser is called with and without 'symbol-qnames argument.")
149 (should (equal (cdr xml-parse-test--default-namespace-qnames) 149 (should (equal (cdr xml-parse-test--default-namespace-qnames)
150 (xml-parse-region nil nil nil nil 'symbol-qnames))))) 150 (xml-parse-region nil nil nil nil 'symbol-qnames)))))
151 151
152;; Test bug #26533 (proper expansion in prefixed attributes with 'symbol-qnames)
153(defvar xml-parse-test--namespace-attribute-qnames
154 (cons "<something xmlns:a=\"myns:\"><whatever a:b='c'></whatever></something>"
155 '((something
156 ((("http://www.w3.org/2000/xmlns/" . "a")
157 . "myns:"))
158 (whatever
159 ((myns:b . "c")))))))
160
161(ert-deftest xml-parse-namespace-attribute-qnames ()
162 (with-temp-buffer
163 (insert (car xml-parse-test--namespace-attribute-qnames))
164 (should (equal (cdr xml-parse-test--namespace-attribute-qnames)
165 (xml-parse-region nil nil nil nil 'symbol-qnames)))))
166
152;; Local Variables: 167;; Local Variables:
153;; no-byte-compile: t 168;; no-byte-compile: t
154;; End: 169;; End: