为什么 Telligent 的 RSS.Net 不分叉解析日期?
我正在使用 Telligent 的 RSS.Net 分支来解析 XML 流。该流格式良好,并且正在解析大多数所需的元素,但由于某种原因, pubData 元素没有被解析。
检查提要内容显示 pubData 元素显示良好,RSS 或元素内容没有问题。但是...正如我所说,也没有解析。在 Visual Studio 中检查显示:
PubDate = {1/01/0001 12:00:00 AM}
这显然不是这种情况,并且对于一个简单的错误解析来说可疑是通用的,所以我怀疑它只是彻底失败并默认为 NYE 高潮,1(抓住最近的热门人物,快! *{ Snog}*)
我尝试解析的提要是 Google 新闻提要,因此我想假设它们工作正常。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊哈!
我凭直觉检查了 RSSReader 代码,发现日期解析在处理解析不干净的日期时(例如,GMT+Offset):
将删除最后的 5 字符,离开:
这让 DateTime.Parse 非常非常难过。
因此,我将更改库以处理 GMT 时间偏移。
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):
Will remove the last 5 characters, leaving:
Which make DateTime.Parse very very sad.
So, I'm going to alter the library to deal with the GMT time offset.