Subject: bug#34685: 26.1; function nnrss-get-namespace-prefix always returns nil

From: wenbushi <[email-masked]>
Date: Thu, 28 Feb 2019 20:31:02 +0800

Package: nnrss

The function "nnrss-get-namespace-prefix" in gnus/nnrss.el always returns
nil,
which causes the contents in "<content:encoded>" tag of an RSS XML not
showing in the gnus article buffer.

Here is a fix:

--- nnrss.el    2019-02-28 20:02:29.224675750 +0800
+++ nnrss-fixed.el      2019-02-28 20:02:04.534267796 +0800
@@ -1031,7 +1031,7 @@
   "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 (cadar el))))
+  (let* ((prefix (car (rassoc uri (cadar (nthcdr 2 (car el))))))
         (nslist (if prefix
                     (split-string (symbol-name prefix) ":")))
         (ns (cond ((eq (length nslist) 1) ; no prefix given

the argument "el" in the function is a list of the parsed XML, like(some
fields are ignored)

((rss ((version . "2.0") (xmlns:atom . "http://www.w3.org/2005/Atom"))
      (channel ((xmlns:content . "http://purl.org/rss/1.0/modules/content/
"))
               (title nil "RSS title")
               (item nil
                     (title nil "article title")
                     (content:encoded nil "article content")))))

The function "nnrss-get-namespace-prefix" should extract tag
"xmlns:content". But it only returns nil because "(cadar el)" matches
nothing.

Hope it helps.