Trying to read it in Opera i was "greeted" with "1st line should be XML declaration" error.

I tried few validators:

  • 1
    No, it is not. First line is empty. Tried with the newest FF.
    – Polygnome
    Commented Aug 24, 2012 at 10:44
  • and it is exactly redundant 4 me. Redundant as line, not as empty one. English is not my native, sorry. Commented Aug 24, 2012 at 11:08
  • @Arioch'The: that comment was directed at a comment of mine, where I claimed the XML feed does start with a XML declaration. I've since retracted that comment to make it a full post below. Commented Aug 24, 2012 at 11:09
  • Well, that's why it is baf idea to delete comments :-) Though i sometimes do it myself :-) Commented Aug 24, 2012 at 11:11
  • The problem is back again today. Commented Sep 14, 2012 at 8:09
  • And fixed again: Feeds have stopped working Commented Sep 14, 2012 at 11:00

2 Answers 2


A recent upgrade introduced a blank line above the xml declaration, breaking our feeds.

This has been fixed and we've already deployed the change. Feeds should be working correctly now.


I can confirm there is a validation error in the feed:

>>> import urllib2
>>> data = urllib2.urlopen('http://stackoverflow.com/feeds/tag/delphi').read()
>>> data[:10]
'\r\n<?xml ve'

There is a CRLF (carriage-return + newline) combo before the <?xml .. ?> declaration statement, and the XML 1.0 standard only allows for whitespace after that declaration:

prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?

where Misc* is a comment, a processing instruction or whitespace. Without the CRLF the feed is otherwise valid.

CRLF normally delimits HTTP headers, so I suspect the header generation for feeds has a bug where one CRLF is appended too many to the header output.

  • or maybe some empty header getsadded at the end, if no sanity check catches it... Commented Aug 24, 2012 at 11:43
  • @Arioch'The: Yeah, that would be one reason for such a bug. Commented Aug 24, 2012 at 11:45
  • Hehe, someone downvoted to disagree. What, may I ask, is there to disagree? That adding a CRLF to the start of a XML document doesn't make it malformed? Commented Aug 24, 2012 at 13:58
  • maybe that since that is bug, the real answer would be fixing the code ? i just don't know how bugs are tracked on SO :-) Commented Aug 24, 2012 at 14:20
  • @Arioch'The: Sure, but I don't have the code access to make that fix. That's up to the StackExchange devs. We can help by diagnosing the exact nature of said bug though. Commented Aug 24, 2012 at 14:24
  • Then sorry, no green V to You ;-) Commented Aug 24, 2012 at 14:27
  • 2
    @Arioch'The: Oh dear, not sure if I can live with that! :-P Commented Aug 24, 2012 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .