Question

I'm using Telligent's RSS.Net fork to parse an XML Stream. The stream is well-formed and most of the desired elements are being parsed, but for some reason the pubData element isn't.

Inspecting the feed contents shows the pubData element nicely displayed, no issues with the RSS or the element contents. But... As I said, no parsing, either. Inspecting in Visual Studio shows:

PubDate = {1/01/0001 12:00:00 AM}

Which is clearly not the case and suspiciously generic for an plain incorrect parse, so I suspect it's just failing outright and defaulting to the NYE culmination, 1 (Grab the nearest hot person, quick! *{Snog}*)

The feeds I'm trying to parse are Google News feeds, so I'd like to assume they're working correctly.

Was it helpful?

Solution

Aha!

On a hunch I checked through the RSSReader code, and found that the date parsing, when dealing with a date that doesn't parse cleanly (Say, GMT+Offset):

Mon, 02 Nov 2009 12:34:56 GTM+10:00

Will remove the last 5 characters, leaving:

Mon, 02 Nov 2009 12:34:56 GTM+

Which make DateTime.Parse very very sad.

So, I'm going to alter the library to deal with the GMT time offset.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top