/// <summary>
        /// Modifies the <see cref="ISyndicationResource"/> to match the data source.
        /// </summary>
        /// <param name="resource">The Really Simple Syndication (RSS) <see cref="ISyndicationResource"/> to be filled.</param>
        /// <param name="resourceMetadata">A <see cref="SyndicationResourceMetadata"/> object that represents the meta-data describing the <paramref name="resource"/>.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="resource"/> is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="resourceMetadata"/> is a null reference (Nothing in Visual Basic).</exception>
        private void FillRssResource(ISyndicationResource resource, SyndicationResourceMetadata resourceMetadata)
        {
            //------------------------------------------------------------
            //	Validate parameter
            //------------------------------------------------------------
            Guard.ArgumentNotNull(resource, "resource");
            Guard.ArgumentNotNull(resourceMetadata, "resourceMetadata");

            //------------------------------------------------------------
            //	Fill syndication resource using appropriate data adapter
            //------------------------------------------------------------
            RssFeed rssFeed = resource as RssFeed;

            if (resourceMetadata.Version == new Version("2.0"))
            {
                Rss20SyndicationResourceAdapter rss20Adapter = new Rss20SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss20Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("1.0"))
            {
                Rss10SyndicationResourceAdapter rss10Adapter = new Rss10SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss10Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.92"))
            {
                Rss092SyndicationResourceAdapter rss092Adapter = new Rss092SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss092Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.91"))
            {
                Rss091SyndicationResourceAdapter rss091Adapter = new Rss091SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss091Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.9"))
            {
                Rss090SyndicationResourceAdapter rss090Adapter = new Rss090SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss090Adapter.Fill(rssFeed);
            }
        }
        /// <summary>
        /// Modifies the <see cref="ISyndicationResource"/> to match the data source.
        /// </summary>
        /// <param name="resource">The Really Simple Syndication (RSS) <see cref="ISyndicationResource"/> to be filled.</param>
        /// <param name="resourceMetadata">A <see cref="SyndicationResourceMetadata"/> object that represents the meta-data describing the <paramref name="resource"/>.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="resource"/> is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="ArgumentNullException">The <paramref name="resourceMetadata"/> is a null reference (Nothing in Visual Basic).</exception>
        private void FillRssResource(ISyndicationResource resource, SyndicationResourceMetadata resourceMetadata)
        {
            Guard.ArgumentNotNull(resource, "resource");
            Guard.ArgumentNotNull(resourceMetadata, "resourceMetadata");

            RssFeed rssFeed = resource as RssFeed;

            if (resourceMetadata.Version == new Version("2.0"))
            {
                Rss20SyndicationResourceAdapter rss20Adapter = new Rss20SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss20Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("1.0"))
            {
                Rss10SyndicationResourceAdapter rss10Adapter = new Rss10SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss10Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.92"))
            {
                Rss092SyndicationResourceAdapter rss092Adapter = new Rss092SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss092Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.91"))
            {
                Rss091SyndicationResourceAdapter rss091Adapter = new Rss091SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss091Adapter.Fill(rssFeed);
            }

            if (resourceMetadata.Version == new Version("0.9"))
            {
                Rss090SyndicationResourceAdapter rss090Adapter = new Rss090SyndicationResourceAdapter(this.Navigator, this.Settings);
                rss090Adapter.Fill(rssFeed);
            }
        }
        /// <summary>
        /// Modifies the <see cref="RssFeed"/> to match the data source.
        /// </summary>
        /// <param name="resource">The <see cref="RssFeed"/> to be filled.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="resource"/> is a null reference (Nothing in Visual Basic).</exception>
        public void Fill(RssFeed resource)
        {
            Guard.ArgumentNotNull(resource, "resource");

            XmlNamespaceManager manager = new XmlNamespaceManager(this.Navigator.NameTable);

            manager.AddNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
            manager.AddNamespace("rss", "http://purl.org/rss/1.0/");

            XPathNavigator channelNavigator = this.Navigator.SelectSingleNode("rdf:RDF/rss:channel", manager);

            if (channelNavigator != null)
            {
                Rss10SyndicationResourceAdapter.FillChannel(resource.Channel, channelNavigator, manager, this.Settings);
            }

            XPathNavigator imageNavigator = this.Navigator.SelectSingleNode("rdf:RDF/rss:image", manager);

            if (imageNavigator != null)
            {
                resource.Channel.Image = new RssImage();
                Rss10SyndicationResourceAdapter.FillImage(resource.Channel.Image, imageNavigator, manager, this.Settings);
            }

            XPathNavigator textInputNavigator = this.Navigator.SelectSingleNode("rdf:RDF/rss:textinput", manager);

            if (textInputNavigator != null)
            {
                resource.Channel.TextInput = new RssTextInput();
                Rss10SyndicationResourceAdapter.FillTextInput(resource.Channel.TextInput, textInputNavigator, manager, this.Settings);
            }

            XPathNodeIterator itemIterator = this.Navigator.Select("rdf:RDF/rss:item", manager);

            if (itemIterator != null && itemIterator.Count > 0)
            {
                int counter = 0;
                while (itemIterator.MoveNext())
                {
                    RssItem item = new RssItem();
                    counter++;

                    if (this.Settings.RetrievalLimit != 0 && counter > this.Settings.RetrievalLimit)
                    {
                        break;
                    }

                    XPathNavigator itemTitleNavigator       = itemIterator.Current.SelectSingleNode("rss:title", manager);
                    XPathNavigator itemLinkNavigator        = itemIterator.Current.SelectSingleNode("rss:link", manager);
                    XPathNavigator itemDescriptionNavigator = itemIterator.Current.SelectSingleNode("rss:description", manager);

                    if (itemTitleNavigator != null)
                    {
                        item.Title = itemTitleNavigator.Value;
                    }

                    if (itemLinkNavigator != null)
                    {
                        Uri link;
                        if (Uri.TryCreate(itemLinkNavigator.Value, UriKind.RelativeOrAbsolute, out link))
                        {
                            item.Link = link;
                        }
                    }

                    if (itemDescriptionNavigator != null)
                    {
                        item.Description = itemDescriptionNavigator.Value;
                    }

                    SyndicationExtensionAdapter itemExtensionAdapter = new SyndicationExtensionAdapter(itemIterator.Current, this.Settings);
                    itemExtensionAdapter.Fill(item, manager);

                    ((Collection <RssItem>)resource.Channel.Items).Add(item);
                }
            }

            SyndicationExtensionAdapter feedExtensionAdapter = new SyndicationExtensionAdapter(this.Navigator.SelectSingleNode("rdf:RDF", manager), this.Settings);

            feedExtensionAdapter.Fill(resource, manager);
        }