GNU bug report logs - #34685
26.1; function nnrss-get-namespace-prefix always returns nil

Previous Next

Packages: gnus, emacs;

Reported by: wenbushi <wenbushi <at> gmail.com>

Date: Thu, 28 Feb 2019 15:37:02 UTC

Severity: minor

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: wenbushi <wenbushi <at> gmail.com>
Cc: 34685 <at> debbugs.gnu.org
Subject: bug#34685: 26.1; function nnrss-get-namespace-prefix always returns nil
Date: Thu, 04 Apr 2019 20:50:54 -0400
tags 34685 + moreinfo
quit

wenbushi <wenbushi <at> gmail.com> writes:

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

> 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.

That's only due to the particular encoding of your RSS feed though,
isn't it?  I believe xmlns prefixes can technically go on any element in
a document; I expect the current code works for some feeds, and your fix
would break things for them.

We should gather some test cases to be able to fix this properly.




This bug report was last modified 3 years and 286 days ago.

Previous Next


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