/// <summary>
        /// Append new Url into Sitemap with refresh rate.
        /// </summary>
        /// <param name="loc">URL of the page.</param>
        /// <param name="changefreq">How frequently the page is likely to change.</param>
        public void AppendUrl(string loc, ChangefreqEnum changefreq)
        {
            XmlElement url_node = CreateUrlElement(loc);
            url_node.AppendChild(CreateChangefreqElement(changefreq));

            _doc.DocumentElement.AppendChild(url_node);
        }
Пример #2
0
        private XmlElement CreateChangefreqElement(ChangefreqEnum changefreq)
        {
            XmlElement changefreq_node = _doc.CreateElement("changefreq", SITEMAP_NAMESPACE);

            changefreq_node.InnerText = changefreq.ToString();
            return(changefreq_node);
        }
Пример #3
0
        /// <summary>
        /// Append new Url into Sitemap with refresh rate.
        /// </summary>
        /// <param name="loc">URL of the page.</param>
        /// <param name="changefreq">How frequently the page is likely to change.</param>
        public void AppendUrl(string loc, ChangefreqEnum changefreq)
        {
            XmlElement url_node = CreateUrlElement(loc);

            url_node.AppendChild(CreateChangefreqElement(changefreq));

            _doc.DocumentElement.AppendChild(url_node);
        }
Пример #4
0
        /// <summary>
        /// Append new Url into Sitemap with refresh rate, priority and last modification date.
        /// </summary>
        /// <param name="loc">URL of the page.</param>
        /// <param name="changefreq">How frequently the page is likely to change.</param>
        /// <param name="priority">The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0.</param>
        /// <param name="lastmod">The date of last modification of the file.</param>
        public void AppendUrl(string loc, ChangefreqEnum changefreq, double priority, DateTime lastmod)
        {
            XmlElement url_node = CreateUrlElement(loc);

            url_node.AppendChild(CreateChangefreqElement(changefreq));
            url_node.AppendChild(CreatePriorityElement(priority));
            url_node.AppendChild(CreateLastmodElement(lastmod));

            _doc.DocumentElement.AppendChild(url_node);
        }
 private XmlElement CreateChangefreqElement(ChangefreqEnum changefreq)
 {
     XmlElement changefreq_node = _doc.CreateElement("changefreq", SITEMAP_NAMESPACE);
     changefreq_node.InnerText = changefreq.ToString();
     return changefreq_node;
 }
        /// <summary>
        /// Append new Url into Sitemap with refresh rate, priority and last modification date.
        /// </summary>
        /// <param name="loc">URL of the page.</param>
        /// <param name="changefreq">How frequently the page is likely to change.</param>
        /// <param name="priority">The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0.</param>
        /// <param name="lastmod">The date of last modification of the file.</param>
        public void AppendUrl(string loc, ChangefreqEnum changefreq, double priority, DateTime lastmod)
        {
            XmlElement url_node = CreateUrlElement(loc);
            url_node.AppendChild(CreateChangefreqElement(changefreq));
            url_node.AppendChild(CreatePriorityElement(priority));
            url_node.AppendChild(CreateLastmodElement(lastmod));

            _doc.DocumentElement.AppendChild(url_node);
        }