Esempio n. 1
0
        /// <summary>
        ///		Añade los elementos al XML
        /// </summary>
        private void AddItems(MLNode parent, FeedEntriesBaseCollection <RSSEntry> entries)
        {
            foreach (RSSEntry entry in entries)
            {
                MLNode node = parent.Nodes.Add(RSSConstTags.cnstStrItem);
                MLNode objID;

                // Datos básicos
                node.Nodes.Add(RSSConstTags.cnstStrItemTitle, entry.Title);
                node.Nodes.Add(RSSConstTags.cnstStrItemLink, entry.Link);
                node.Nodes.Add(RSSConstTags.cnstStrItemDescription, entry.Content);
                AddDate(node, RSSConstTags.cnstStrItemPubDate, entry.DateCreated);
                // ID
                objID = node.Nodes.Add(RSSConstTags.cnstStrItemGuid, entry.GUID.ID);
                objID.Attributes.Add(RSSConstTags.cnstStrItemAttrPermaLink, entry.GUID.IsPermaLink);
                // Categorías
                foreach (RSSCategory category in entry.Categories)
                {
                    node.Nodes.Add(RSSConstTags.cnstStrItemCategory, category.Text);
                }
                // Adjuntos
                AddEnclosures(node, entry.Enclosures);
                // Autores
                foreach (RSSAuthor objAuthor in entry.Authors)
                {
                    node.Nodes.Add(RSSConstTags.cnstStrItemAuthor, objAuthor.Name);
                }
                // Obtiene el XML de las extensiones
                entry.Extensions.AddNodesExtension(node);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///		Añade los elementos al XML
        /// </summary>
        private void AddItems(MLNode parent, FeedEntriesBaseCollection <AtomEntry> entries)
        {
            foreach (AtomEntry entry in entries)
            {
                MLNode node = parent.Nodes.Add(AtomConstTags.cnstStrItemRoot);

                // Datos básicos
                node.Nodes.Add(AtomConstTags.cnstStrItemID, entry.ID);
                AddText(node, AtomConstTags.cnstStrItemTitle, entry.Title);
                AddText(node, AtomConstTags.cnstStrItemContent, entry.Content);
                AddText(node, AtomConstTags.cnstStrSummary, entry.Summary);
                // Fechas
                AddDate(node, AtomConstTags.cnstStrItemIssued, entry.DateIssued);
                AddDate(node, AtomConstTags.cnstStrItemModified, entry.DateModified);
                AddDate(node, AtomConstTags.cnstStrItemCreated, entry.DateCreated);
                AddDate(node, AtomConstTags.cnstStrItemUpdated, entry.DateUpdated);
                AddDate(node, AtomConstTags.cnstStrItemPublished, entry.DatePublished);
                // Vínculos
                AddLinks(node, entry.Links);
                // Autores
                AddPeople(node, AtomConstTags.cnstStrItemAuthor, entry.Authors);
                AddPeople(node, AtomConstTags.cnstStrItemContributor, entry.Contributors);
                // Categorías
                AddCategories(node, entry.Categories);
                // Origen
                AddSource(node, entry.Source);
                // Derechos
                AddRights(node, entry.Rights);
                // Extensiones
                entry.Extensions.AddNodesExtension(node);
            }
        }
Esempio n. 3
0
        /// <summary>
        ///		Añade los elementos al XML
        /// </summary>
        private void AddItems(MLNode parent, FeedEntriesBaseCollection <RDFEntry> entries)
        {
            foreach (RDFEntry entry in entries)
            {
                MLNode node = parent.Nodes.Add(RDFConstTags.cnstStrItem);

                // Datos básicos
                node.Nodes.Add(RDFConstTags.cnstStrItemTitle, entry.Title);
                node.Nodes.Add(RDFConstTags.cnstStrItemLink, entry.Link);
                node.Nodes.Add(RDFConstTags.cnstStrItemDescription, entry.Content);
                node.Nodes.Add(RDFConstTags.cnstStrItemDate, entry.DateCreated);
                // Obtiene el XML de las extensiones
                entry.Extensions.AddNodesExtension(node);
            }
        }