Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Adds support for reading a10:updated elements in RSS 2.0 feeds #35

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daveaglick
Copy link

Re #34

I need some feedback on this PR. It fully supports reading <a10:updated> elements but the Echo test is failing because the RssFeedWriter does not write anything for SyndicationItem.LastUpdatedTime.

I started to implement writing the updated time, but it's tricky because the a10 namespace would ideally be declared in the <rss> element, but we don't know when writing it whether we have any items that require that namespace. Here's some options:

  • Always declare the a10 namespace when writing RSS feeds whether we need it or not.
  • Leave this up to the user to specify either in the attributes collection when constructing the writer or though some other property or constructor flag. Then throw if we encounter an updated time that requires the namespace but it wasn't specified.
  • Declare the namespace on every <updated> element directly instead of on the parent <rss> element which could get really noisy.

Thoughts?

@daveaglick
Copy link
Author

I ended up implementing the writing without making any assumptions about namespaces. If the user wants to include the a10 namespace they can do so by passing an attributes array to the RssFeedWriter:

var attributes = new SyndicationAttribute[] { new SyndicationAttribute("xmlns:a10", "http://www.w3.org/2005/Atom") };
var writer = new RssFeedWriter(xmlWriter, attributes);

Otherwise, the <updated> elements will contain an unprefixed namespace declaration when written.

This PR should now be ready for review.

@daveaglick daveaglick changed the title [WIP] Adds support for reading a10:updated elements in RSS 2.0 feeds Adds support for reading a10:updated elements in RSS 2.0 feeds May 17, 2018
@alexsorokoletov
Copy link

Anyone?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants