14

https://stackoverflow.com/feeds/tag/delphi

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

I tried few validators:

6
  • 1
    No, it is not. First line is empty. Tried with the newest FF.
    – Polygnome
    Aug 24 '12 at 10:44
  • and it is exactly redundant 4 me. Redundant as line, not as empty one. English is not my native, sorry. Aug 24 '12 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. Aug 24 '12 at 11:09
  • Well, that's why it is baf idea to delete comments :-) Though i sometimes do it myself :-) Aug 24 '12 at 11:11
  • The problem is back again today. Sep 14 '12 at 8:09
  • And fixed again: Feeds have stopped working Sep 14 '12 at 11:00
7

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.

3
12

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.

7
  • or maybe some empty header getsadded at the end, if no sanity check catches it... Aug 24 '12 at 11:43
  • @Arioch'The: Yeah, that would be one reason for such a bug. Aug 24 '12 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? Aug 24 '12 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 :-) Aug 24 '12 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. Aug 24 '12 at 14:24
  • Then sorry, no green V to You ;-) Aug 24 '12 at 14:27
  • 2
    @Arioch'The: Oh dear, not sure if I can live with that! :-P Aug 24 '12 at 14:28

You must log in to answer this question.

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