3

The following Atom feed has invalid characters, and is making my reader app crash because the XML library cannot parse it:

https://stackoverflow.com/feeds/tag/windows-8.1%20OR%20windows-store-apps%20OR%20windows-8%20OR%20windows-phone-8%20OR%20windows-runtime

Feeds change too fast, so by the time you see this report the feed may not be invalid anymore, so I am copying the feed here:

https://skydrive.live.com/redir?resid=63207E51377958A9!12583&authkey=!ALmX1rIbGv-bais&ithint=file%2c.xml

This is not the first time I've seen an invalid feed.

The problem is that there are multiple 0x1E bytes, the first one is in line 121 character 48, or byte 7104.

That is the <summary> of this question:

System.InvalidCast exception Windows Runtime

So any Atom feed containing that question is invalid.

2
  • 1
    I'm taking a look at this now.
    – Haney
    Commented Jun 27, 2014 at 15:11
  • 1
    Can we get the status-completed removed and the issue looked-at and completely addressed? Or it would be more appropriate to open a new one?
    – Léa Gris
    Commented Jan 4, 2022 at 11:02

3 Answers 3

6

You're right, U+001E is not a valid character in XML 1.0, which the SO Atom feed claims to be. The same goes for all other C0 control characters too, except for TAB (U+0009), LF (U+000A) and CR (U+000D).

Those characters are valid in XML 1.1, as long as they're encoded as entity literals (e.g. &#x1E;). However, given that they have no obvious use in an Atom feed, it would probably be better to just filter them out.

4

Thanks for bringing this up. I have resolved it by retroactively sanitizing the Question/Answer data that is used in the feeds, and installing mechanisms to prevent future invalid characters from being input. This will be live in the next release (> rev 2014.6.27.2348)

1
3

The same issue popped again as I reported here: https://support.stackenterprise.co/support/tickets/15320

Consequence was that Thunderbird was unable to load the feed until the invalid characters slid out of the feed.

The error that popped on this feed is now gone, but here is the error reported by the validator from W3C:

Sorry This feed does not validate.
line 206, column 1357: XML parsing error: <unknown>:206:1357: reference to invalid character number [help]

    ... /p&gt;&#xA;&lt;pre&gt;&lt;code&gt;&#xA0;&#x13; &#xA;&lt;/code&gt;&lt;/pr ...
                                                 ^

If you run the W3C validator today, it sill reports an issue with the namespace:

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
line 2, column 0: Use of unknown namespace: http://purl.org/atompub/rank/1.0 [help]

    <feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0">

You must log in to answer this question.

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