RSS and Rublog, XML parsing error

Another Rublog/Apache problem, extra characters are leaking into my
HTTP Response content which is preventing RSS XML from being parsed on
the web browser.

Parsing error:
XML Parsing Error: xml processing instruction not at start of
external entity
Location: http://…/index.rss
Line Number 3, Column 1:<?xml version="1.0" encoding="iso-8859-1" ?>

HTTP response:
HTTP/1.1 200 OK

Content-Type: text/xml

fb9

<?xml version="1.0" encoding="iso-8859-1" ?>

What is that extra fb9? The response content is being created by the
Template class in rublog/Template.rb; methods:

def write_html_on(op, value_hash)
esc = proc { |str| CGI.escapeHTML(str) }
op << write_common(value_hash, esc)
end

def write_plain_on(op, value_hash)
esc = proc {|str| str}
op << write_common(value_hash, esc)
end

Cheers,
Rob

PS: I added the following line in the RssView.render() method to get
RSS content type to be text/xml:
@response.add_header(“Content-type”, “text/xml”)

···

Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

Another Rublog/Apache problem, extra characters are leaking into my

HTTP Response content which is preventing RSS XML from being parsed on

the web browser.

···

On Thu, 11 Mar 2004, Robert McKinnon wrote:

Parsing error:

XML Parsing Error: xml processing instruction not at start of

external entity

Location: http://…/index.rss

Line Number 3, Column 1:<?xml version="1.0" encoding="iso-8859-1" ?>

HTTP response:

HTTP/1.1 200 OK

Content-Type: text/xml

fb9

<!DOCTYPE rss PUBLIC “-//Netscape Communications//DTD RSS 0.91//EN”

http://my.netscape.com/publish/formats/rss-0.91.dtd”>

<?xml version="1.0" encoding="iso-8859-1" ?>

What is that extra fb9? The response content is being created by the

Template class in rublog/Template.rb; methods:

Have you tried running the script from the command line? I’d be
interested to know if the fb9 appears there. I’m not seeing it in any
instance for my rublog implementation. You’ll have to set PATH_INFO,
QUERY_STRING, and HTTP_HOST environment variables to run the CGI program
from the command line.

PS: I added the following line in the RssView.render() method to get

RSS content type to be text/xml:

@response.add_header(“Content-type”, “text/xml”)

Hmm… I think that should be included. Dave, it looks like you removed
the RSS_MIME_TYPE reference in version 1.8 of View.rb in CVS (when you
added the Last-modified header). Mistake?

Chad

No - it was causing problems with some browser or other. I can add it
back and see what breaks… :slight_smile:

However, I’m not sure anyone really needs this unless they want to have
the browser display XML for them.

Cheers

Dave

···

On Mar 11, 2004, at 14:09, Chad Fowler wrote:

Hmm… I think that should be included. Dave, it looks like you removed
the RSS_MIME_TYPE reference in version 1.8 of View.rb in CVS (when you
added the Last-modified header). Mistake?