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