]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix nnrss-get-namespace-prefix (bug#34685)
authorBenjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
Tue, 10 Aug 2021 13:47:50 +0000 (15:47 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 10 Aug 2021 14:41:37 +0000 (16:41 +0200)
* lisp/gnus/nnrss.el (nnrss-get-namespace-prefix): Use the car of
parameter el to match what dom-search expects.
* test/lisp/gnus/nnrss-tests.el (test-nnrss-xml): Adjust to what
xml-parse-region produces (bug#34685).

lisp/gnus/nnrss.el
test/lisp/gnus/nnrss-tests.el

index 0f12ee0e9d29809c520d0db28bff575c9b097cb5..97c9f18a602b73b26ec342922f47bdc0db218e53 100644 (file)
@@ -954,9 +954,10 @@ Simply ensures that the first element is rss or rdf."
   "Given EL (containing a parsed element) and URI (containing a string
 that gives the URI for which you want to retrieve the namespace
 prefix), return the prefix."
-  (let* ((prefix (car (rassoc uri (dom-attributes
-                                  (dom-search
-                                   el
+  (let* ((dom (car el))
+         (prefix (car (rassoc uri (dom-attributes
+                                  (dom-search
+                                   dom
                                    (lambda (node)
                                      (rassoc uri (dom-attributes node))))))))
         (nslist (if prefix
index 01b374a2f6391425e3439153dbbd26ce06aae2e7..92b7dacf1801677e1ed0c0a5e8427681efce4115 100644 (file)
                  "Fri, 17 Sep 2004 05:09:49 +0000")))
 
 (defconst test-nnrss-xml
-  '(rss
-    ((version . "2.0")
-     (xmlns:dc . "http://purl.org/dc/elements/1.1/"))
-    (channel
-     ((xmlns:content . "http://purl.org/rss/1.0/modules/content/")))))
+  '((rss
+     ((version . "2.0")
+      (xmlns:dc . "http://purl.org/dc/elements/1.1/"))
+     (channel
+      ((xmlns:content . "http://purl.org/rss/1.0/modules/content/"))))))
 
 (ert-deftest test-nnrss-namespace-top ()
   (should (equal (nnrss-get-namespace-prefix