Problem with the rss file
list Francesco Duranti
Hi Henrik, I've a little problem with the creation of the rss/xml file. Sometimes I get errors in it related at some external plugin used with some bb client that put character that will distrupt the file. This is an example of what i get: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. A semi colon character was expected. Error processing resource 'http://itromlx10/bb/bb2.rss';. Line 66, Position 55 <description>red Tue Sep 20 10:19:43 MET DST 2005 &red prtdiag reports some failures !!! </description> ------------------------------------------------------^ It seems to me that the & char have to be escaped (or removed) to get it work. Regards Francesco
list Henrik Størner
▸
On Tue, Sep 20, 2005 at 10:30:01AM +0200, Francesco Duranti wrote:
I've a little problem with the creation of the rss/xml file. Sometimes I get errors in it related at some external plugin used with some bb client that put character that will distrupt the file.
[snip]
It seems to me that the & char have to be escaped (or removed) to get it work.
Right, does this patch fix it for you ? Against 4.1.1, or any snapshot
you may have.
Regards,
Henrik
-------------- next part --------------
--- bbdisplay/rssgen.c 2005/04/25 12:54:24 1.16
+++ bbdisplay/rssgen.c 2005/09/20 08:45:47
@@ -150,7 +150,26 @@
}
fprintf(fd, "</link>\n");
- if (e->shorttext) fprintf(fd, "<description>%s</description>\n", e->shorttext);
+ if (e->shorttext) {
+ char *inpos = e->shorttext, *amp;
• + fprintf(fd, "<description>");
+ /* Must escape any &-characters, or RSS readers will choke on them */
+ while (inpos && *inpos) {
+ amp = strchr(inpos, '&');
+ if (amp) {
+ *amp = '\0';
+ fprintf(fd, "%s&", inpos);
+ *amp = '&';
+ inpos = amp+1;
+ }
+ else {
+ fprintf(fd, "%s", inpos);
+ inpos = NULL;
+ }
+ }
+ fprintf(fd, "</description>\n");
+ }
fprintf(fd, " </item>\n");
}
list Francesco Duranti
Tested with the yesterday snapshot (that already include the fix) and it works. Thanks for the good work Francesco -----Messaggio originale----- Da: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Inviato: martedì 20 settembre 2005 10.48 A: user-ae9b8668bcde@xymon.invalid Oggetto: Re: [hobbit] Problem with the rss file
▸
On Tue, Sep 20, 2005 at 10:30:01AM +0200, Francesco Duranti wrote:I've a little problem with the creation of the rss/xml file. Sometimes I get errors in it related at some external plugin used with some bb client that put character that will distrupt the file.
[snip]
It seems to me that the & char have to be escaped (or removed) to get it work.
Right, does this patch fix it for you ? Against 4.1.1, or any snapshot you may have. Regards, Henrik
list Francesco Duranti
Hi Henrik, I've another little problem with rss pages. I have about 10 pageset available for different kind of users (DB, NETWORK, etc) and it seems that rss files are not created for pagesets but only for principal bb pages. Is it possible to create rss file also for pageset? Am I doing something wrong with parameters of bbgen? This is the command line for bbgen I use to generate one of the pagesets: bbgen --pageset=inet --report=bbgen-inet --nopurple --nstab=INET/nstab.html --recentgifs --subpagecolumns=2 --nopropred=msgs,vmio --pagetext-headings --timing --docurl=/hobbit/admin/notes.php?host=%s --rssversion=2.0 --eventignore=uptime,event,msgs,vmio,legato --includecolumns=graph --bb2-ignorecolumns=legato --rss BBHOME/www/INET