[Adapdev-commits] Adapdev/src/Adapdev.Web/Rss IPersistentManager.cs,1.2,1.3 RssCacheManager.cs,1.2,1
Status: Beta
Brought to you by:
intesar66
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Web/Rss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv909/src/Adapdev.Web/Rss Added Files: IPersistentManager.cs RssCacheManager.cs RssCacheManager.resx RssReader.cs atom.xsd atom.xsx opml.xsd opml.xsx opmlbody.cs opmldocument.cs opmlhead.cs opmloutline.cs rss.xsd rss.xsx rsschannel.cs rsscloud.cs rssenclosure.cs rssguid.cs rssimage.cs rssitem.cs rsssource.cs rsstextinput.cs Log Message: --- NEW FILE: IPersistentManager.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: RssCacheManager.resx --- <?xml version="1.0" encoding="utf-8" ?> <root> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="ResMimeType"> <value>text/microsoft-resx</value> </resheader> <resheader name="Version"> <value>1.0.0.0</value> </resheader> <resheader name="Reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="Writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> --- NEW FILE: rsscloud.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: atom.xsd --- <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://purl.org/atom/ns#" xmlns:atom="http://purl.org/atom/ns#" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> <xs:element name="feed" type="atom:feedType"> <xs:annotation> <xs:documentation><![CDATA[ The top-level element is <feed>. ]]></xs:documentation> </xs:annotation> </xs:element> <xs:complexType name="feedType"> <xs:annotation> <xs:documentation><![CDATA[ The top-level element is <feed>. It has several <entry> children. If a property says it can apply to entries, that means that if itâs put in <feed> then itâs a default value for each <entry>. If it can also apply to <entry>, then the value in an <entry> can override the default entries value. Required children of feed: title: Equivalent to dc:title. If this feed describes a website, SHOULD be the title of the website. link: The link to the website described by this feed. If this feed describes a website, SHOULD be a link to the homepage of the website. modified: W3DTF. Equivalent to dcterms:modified. The modification date of the feed, including any changes to any of the listed entries. SHOULD be UTC. author: [defined below] One of these MUST be true: feed contains author (if so, itâs inherited by all the entries); every entry contains author (overrides any inherited one). Optional children of feed: tagline: Subproperty of dc:description. A short human-readable tagline for this feed. Examples: "All the news thatâs fit to print" (tagline of NYT). id: A URI. Permanent, globally unique ID of this feed. MUST NOT change, ever, even if the feed is moved to a new server. For this reason, it probably shouldnât be the same as feed/link, although it MAY be. Weâre currently discussing options, including tag: URIs and GUID in the COM/CORBA sense. generator: [defined below] entry*: [defined below] contributor*: [defined below] copyright: Equivalent to dc:rights. Human-readable copyright statement for this feed. For machine-readable licensing information, producers SHOULD use the <license> element (to be defined). Note that omission of this element does not mean the feed isnât copyrighted. ]]></xs:documentation> </xs:annotation> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="title" type="xs:string"/> <xs:element name="link" type="xs:anyURI"/> <xs:element name="modified" type="atom:iso8601dataTime"/> <xs:element name="author" type="atom:authorType" minOccurs="0"/> <xs:element name="tagline" type="xs:string" minOccurs="0"/> <xs:element name="id" type="xs:anyURI" minOccurs="0"/> <xs:element name="generator" type="atom:generatorType" minOccurs="0"/> <xs:element name="contributor" type="atom:authorType" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation><![CDATA[ Same required and optional elements as author. Suproperty of "dc:contributor". ]]></xs:documentation> </xs:annotation> </xs:element> <xs:element name="copyright" type="xs:string" minOccurs="0"/> <xs:element name="entry" type="atom:entryType" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:sequence> <xs:attribute name="version" type="atom:versionType" use="required"/> <xs:attribute ref="xml:lang" use="optional"/> </xs:complexType> <xs:complexType name="authorType"> <xs:annotation> <xs:documentation><![CDATA[ Required children: name: Equivalent to dc:creator of feed or entry (depending on where author element is). MAY be name of corporation, if there are no individual authors or publisher does not wish to make their names available. See Authors on the other wiki. Optional children: url*: A URI. The URL of this author. email*: An email address, including plus signs and other allowable weird characters. The email address of this author. ]]></xs:documentation> </xs:annotation> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="name" type="xs:string"/> <xs:element name="url" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="email" type="atom:emailType" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:sequence> </xs:complexType> <xs:complexType name="generatorType" > <xs:annotation> <xs:documentation><![CDATA[ Required children: link: A URI. URI of the toolkit that generated this feed. SHOULD be home page of toolkit/program/hosting provider, like http://www.movabletype.org/. MAY include version number, like: http://www.movabletype.org/?v=2.64. name: human-readable name of the toolkit that generated this feed, like "Movable Type". ]]></xs:documentation> </xs:annotation> <xs:simpleContent> <xs:extension base="xs:anyURI" > <xs:attribute name="name" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="entryType"> <xs:annotation> <xs:documentation><![CDATA[ Required children: title: Eqivalent to dc:title. link: A URI. Permanent link to a representation of this entry. Is NOT defined as "link to an external resource described in the content of this entry". MUST be permanent. MUST be globally unique. MUST be clickable (not sure how to express this, perhaps "use an IANA-registered protocol and point to a resource that is viewable by ... uh, something) id: A URI. Subproperty of to dc:identifier. Permanent globally unique ID of this entry. MUST be permanent, MUST be globally unique. MAY be same as link. Current recommendations are under active discussion, same issues as feed/id. issued: W3DTF minus timezone requirement. Subproperty of dcterms:issued. SHOULD include timezone. SHOULD be expressed in publisherâs local timezone. MAY skip timezone (LiveJournal requirement). modified: W3DTF. Subproperty of dcterms:modified. SHOULD be UTC. Optional children: created W3DTF. Subproperty of dcterms:created. SHOULD be UTC. If not present, its value is presumed to be identical to modified. summary: Subproperty of dc:description. Short summary, blurb, or excerpt about this entry. MUST be plain text (i.e. no escaped HTML). Examples of use: lead on first page of news site. author: [defined above] contributor*: [defined below] content*: [defined below] ]]></xs:documentation> </xs:annotation> <xs:sequence> <xs:choice minOccurs="4" maxOccurs="unbounded"> <xs:element name="title" type="xs:string"/> <xs:element name="link" type="xs:anyURI"/> <xs:element name="id" type="xs:string"/> <xs:element name="issued" type="atom:iso8601dataTime"/> <xs:element name="modified" type="atom:iso8601dataTime"/> <xs:element name="created" type="atom:iso8601dataTime" minOccurs="0"/> <xs:element name="summary" type="xs:string" minOccurs="0"/> <xs:element name="author" type="atom:authorType" minOccurs="0"/> <xs:element name="contributor" type="atom:authorType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="content" type="atom:contentType" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:sequence> <xs:attribute ref="xml:lang" use="optional"/> </xs:complexType> <xs:complexType name="contentType" > <xs:annotation> <xs:documentation><![CDATA[ Required children: type: MIME type. Format of this content. And at most one mode of: xml: Inline XML. (Probably namespaced XHTML.) escaped: Consumers must unescape and treat as its type. base64: base64-encoded string. Consumers must decode and treat as its type. If content type is "multipart/alternative", then instead of any of the above, the content element MUST contain 1 or more content elements. These content elements MUST NOT specify type="multipart/alternative" (i.e. only one level of nesting is allowed). Consumers SHOULD look at all alternative content elements and determine which one is most suitable, based on which type and mode the consumer supports, and preferences specified by the end user (if any). Consumers SHOULD NOT render more than one content alternative. ]]></xs:documentation> <xs:documentation> I took this group and the next one from Tim Bray's Atom XSD. </xs:documentation> </xs:annotation> <xs:complexContent mixed="true"> <xs:restriction base="xs:string" > <xs:choice> <xs:element name="content" type="atom:contentType" minOccurs="0" maxOccurs="unbounded"/> <xs:sequence> <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:choice> <xs:attribute name="type" use="required"/> <xs:attribute name="mode"> <xs:simpleType> <xs:restriction base="xs:token"> <xs:enumeration value="xml"/> <xs:enumeration value="escaped"/> <xs:enumeration value="base64"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute ref="xml:lang" use="optional"/> </xs:restriction > </xs:complexContent> </xs:complexType> <xs:simpleType name="iso8601dataTime"> <xs:union memberTypes="xs:dateTime xs:date"/> </xs:simpleType> <xs:simpleType name="versionType"> <xs:restriction base="xs:normalizedString"> <xs:pattern value="\d+\.\d+" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="emailType"> <xs:restriction base="xs:normalizedString"> <xs:pattern value="\w+@(\w+\.)+\w+"/> </xs:restriction> </xs:simpleType> </xs:schema> --- NEW FILE: rsssource.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rssitem.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: atom.xsx --- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout /> --- NEW FILE: RssReader.cs --- using System; using System.Xml; using System.IO; using System.Collections; /// Version 1.0 namespace Sloppycode.net { #region Event datatype/delegate /// <summary> /// Holds details about any errors that occured /// during the loading or parsing of the RSS feed. /// </summary> public class RssReaderErrorEventArgs : EventArgs { /// <summary> /// The details of the error. /// </summary> public string Message { get { return this.message; } set { this.message = value; } } private string message; } /// <summary> /// Represents the method that will handle the RssReader error event. /// </summary> public delegate void RssReaderErrorEventHandler(object sender, RssReaderErrorEventArgs e); #endregion #region RssReader class /// <summary> /// The RssReader class provides a number of static methods for easy /// 1 or 2 step retrieval of RSS feeds. RSS feeds can be downloaded from any /// URL, and are then parsed into an <see cref="RssFeed">RssFeed</see> data type, /// which contains properties representing most aspects of an RSS Feed. A number /// of events are available for the calling application to register at the various /// stages of the feed request and parsing. /// <example> /// The following example retrieves the RSS news feed for the BBC news website, /// and creates a HTML document from the feed's details. It saves the HTML document /// to disk, and launches the default browser with the document. The number of items /// displayed is limited to 5. If there is any error, a messagebox is displayed with /// the details of the error. /// <code> /// RssFeed feed = RssReader.GetFeed("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/front_page/rss091.xml"); /// /// if ( feed.ErrorMessage == null || feed.ErrorMessage == "" ) /// { /// string template = "<a href=\"%Link%>%Title%</a><br/>%Description%<br/><br/><ul>%Items%</ul>"; /// string itemTemplate = "<li><a href=\"%Link%>%Title%</a><br/>%Description%</li>"; /// string html = RssReader.CreateHtml(feed,template,itemTemplate,"",5); /// /// StreamWriter streamWriter = File.CreateText("c:\\rss.html"); /// streamWriter.Write(html); /// streamWriter.Close(); /// /// System.Diagnostics.Process.Start("c:\\rss.html"); /// } /// else /// { /// MessageBox.Show("Error getting feed:\r\n" +feed.ErrorMessage,"Rss Demo App",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); /// } /// </code> /// </example> /// </summary> public class RssReader { // Events: XML document loaded, rss element found, // channel node found, item parsed, error /// <summary> /// This event is fired when the feed has finished loading from the URL /// provided, into the XML parser. /// </summary> public event EventHandler FeedLoaded; /// <summary> /// This event is fired when the root node (typically 'rss') has /// been found in the feed. /// </summary> public event EventHandler RssNodeFound; /// <summary> /// This event is fired when the channel/child node of the rss node /// (typically 'channel') has been found in the feed. /// </summary> public event EventHandler ChannelNodeFound; /// <summary> /// This event is fired when an item is added to the <see cref="RssFeed">RssFeed</see>'s /// collection of items. /// </summary> public event EventHandler ItemAdded; /// <summary> /// This event is fired when an error occurs in the loading or parsing /// of the feed. The same error message is also available in the ErrorMessage /// property of the <see cref="RssFeed">RssFeed</see> object that is returned /// by the <see cref="Retrieve">Retrieve</see> method. /// </summary> public event RssReaderErrorEventHandler Error; /// <summary> /// The node name for the channel element /// in the RSS feed. This will rarely ever to be /// changed. Default is 'channel'. /// </summary> public string RootNodeName { get { return this.rootNodeName; } set { this.rootNodeName = value; } } /// <summary> /// The node name for the root rss element /// in the RSS feed. This is altered automatically to 'rdf:RDF' /// when RdfMode is set to true. Default is 'rss'. /// </summary> public string ChannelNodeName { get { return this.channelNodeName; } set { this.channelNodeName = value; } } /// <summary> /// If this is set to true, then the XML document /// is parsed slightly different, to cater sites with RDF feeds (such as /// slashdot.org and register.com). The whole RDF format is not supported, /// but those items in RSS which have a corresponding RDF property, such /// as description,title for the channel, and title,description for each /// item, are matched. /// </summary> public bool RdfMode { get { return this.rdfMode; } set { if ( value ) { this.rootNodeName = "rdf:RDF"; } else { this.rootNodeName = "rss"; } this.rdfMode = value; } } /// <summary> /// Member for the public property. /// </summary> private string rootNodeName = "rss"; /// <summary> /// Member for the public property. /// </summary> private string channelNodeName = "channel"; /// <summary> /// Member for the public property. /// </summary> private bool rdfMode = false; /// <summary> /// Retrieves a <see cref="RssFeed">RssFeed</see> object using /// the url provided as the source of the Feed. /// </summary> /// <param name="Url">The url to retrieve the RSS feed from, this can /// be in the format of http:// and also file://.. (ftp?)</param> /// <param name="RdfFormat">If this is set to true, then the XML document /// is parsed slightly different, to cater sites with RDF feeds (such as /// slashdot.org and register.com). The whole RDF format is not supported, /// but those items in RSS which have a corresponding RDF property, such /// as description,title for the channel, and title,description for each /// item, are matched.</param> /// <returns>A <see cref="RssFeed">RssFeed</see> object from the /// RSS feed's details.</returns> public static RssFeed GetFeed(string Url,bool RdfFormat) { RssReader rssReader = new RssReader(); rssReader.RdfMode = RdfFormat; return rssReader.Retrieve(Url); } /// <summary> /// Retrieves a <see cref="RssFeed">RssFeed</see> object using /// the url provided as the source of the Feed. /// </summary> /// <param name="Url">The url to retrieve the RSS feed from, this can /// be in the format of http:// and also file://.. (ftp?)</param> /// <returns>A <see cref="RssFeed">RssFeed</see> object from the /// RSS feed's details.</returns> public static RssFeed GetFeed(string Url) { RssReader rssReader = new RssReader(); return rssReader.Retrieve(Url); } /// <summary> /// A simplified method of creating a HTML (or any document) from an /// RSS Feed. See <see cref="RssHtmlMaker">RssHtmlMaker</see> /// </summary> /// <param name="Feed">The <see cref="RssFeed">RssFeed</see> object to /// get the tokens' data from.</param> /// <param name="Template">The overall HTML template (or any other format) /// to replace the tokens in.</param> /// <param name="ItemPrefix">A string template that is prepended to the beginning /// of each RSS item.</param> /// <param name="ItemSuffix">A string template that is apppended to the end /// of each RSS item.</param> /// <returns>A string with the templates provided parsed of their tokens, with /// the data values in their place.</returns> public static string CreateHtml(RssFeed Feed,string Template,string ItemPrefix,string ItemSuffix) { return new RssHtmlMaker().GetHtmlContents(Feed,Template,ItemPrefix,ItemSuffix); } /// <summary> /// A simplified method of creating a HTML (or any document) from an /// RSS Feed. See <see cref="RssHtmlMaker">RssHtmlMaker</see> /// </summary> /// <param name="Feed">The <see cref="RssFeed">RssFeed</see> object to /// get the tokens' data from.</param> /// <param name="Template">The overall HTML template (or any other format) /// to replace the tokens in.</param> /// <param name="ItemPrefix">A string template that is prepended to the beginning /// of each RSS item.</param> /// <param name="ItemSuffix">A string template that is apppended to the end /// of each RSS item.</param> /// <param name="MaxItems">The maximum number of RSS items to display.</param> /// <returns>A string with the templates provided parsed of their tokens, with /// the data values in their place.</returns> public static string CreateHtml(RssFeed Feed,string Template,string ItemPrefix,string ItemSuffix,int MaxItems) { RssHtmlMaker rssHtmlMaker = new RssHtmlMaker(); rssHtmlMaker.MaxItems = MaxItems; return rssHtmlMaker.GetHtmlContents(Feed,Template,ItemPrefix,ItemSuffix); } /// <summary> /// Retrieves an RSS feed using the given Url, parses it and /// creates and new <see cref="RssFeed">RssFeed</see> object with the information. /// If an error occurs in the XML loading of the document, or parsing of /// the RSS feed, the error is trapped and stored inside the RssFeed's /// ErrorMessage property. /// </summary> /// <param name="Url">The url to retrieve the RSS feed from, this can /// be in the format of http:// and also file://.. (ftp?)</param> /// <returns>An <see cref="RssFeed">RssFeed</see> object with information /// retrieved from the feed.</returns> public RssFeed Retrieve(string Url) { RssFeed rssFeed = new RssFeed(); rssFeed.Items = new RssItems(); XmlTextReader xmlTextReader = new XmlTextReader(Url); XmlValidatingReader xmlValidatingReader = new XmlValidatingReader(xmlTextReader); xmlValidatingReader.ValidationType = ValidationType.None; XmlDocument xmlDoc= new XmlDocument(); try { xmlDoc.Load(xmlTextReader); // Fire the load event if ( this.FeedLoaded != null ) { this.FeedLoaded(this, new EventArgs()); } XmlNode rssXmlNode = null; // Loop child nodes till we find the rss one for (int i=0;i < xmlDoc.ChildNodes.Count;i++) { System.Diagnostics.Debug.Write("Child: " +xmlDoc.ChildNodes[i].Name); System.Diagnostics.Debug.WriteLine(" has " +xmlDoc.ChildNodes[i].ChildNodes.Count+" children"); if ( xmlDoc.ChildNodes[i].Name == this.rootNodeName && xmlDoc.ChildNodes[i].ChildNodes.Count > 0 ) { rssXmlNode = xmlDoc.ChildNodes[i]; // Fire the found event if ( this.RssNodeFound != null ) { this.RssNodeFound(this,new EventArgs()); } break; } } if ( rssXmlNode != null ) { XmlNode channelXmlNode = null; // Loop through the rss node till we find the channel for (int i=0;i < rssXmlNode.ChildNodes.Count;i++) { System.Diagnostics.Debug.WriteLine("Rss child: "+rssXmlNode.ChildNodes[i].Name); if ( rssXmlNode.ChildNodes[i].Name == this.channelNodeName && rssXmlNode.ChildNodes[i].ChildNodes.Count > 0 ) { channelXmlNode = rssXmlNode.ChildNodes[i]; // Fire the found event if ( this.ChannelNodeFound != null ) { this.ChannelNodeFound(this,new EventArgs()); } break; } } // Found the channel node if ( channelXmlNode != null ) { // Loop through its children, copying details to the // RssFeed struct, and parsing the items for (int i=0;i < channelXmlNode.ChildNodes.Count;i++) { System.Diagnostics.Debug.WriteLine(channelXmlNode.ChildNodes[i].Name); switch ( channelXmlNode.ChildNodes[i].Name ) { case "title": { rssFeed.Title = channelXmlNode.ChildNodes[i].InnerText; break; } case "description": { rssFeed.Description = channelXmlNode.ChildNodes[i].InnerText; break; } case "language": { rssFeed.Language = channelXmlNode.ChildNodes[i].InnerText; break; } case "copyright": { rssFeed.Copyright = channelXmlNode.ChildNodes[i].InnerText; break; } case "webmaster": { rssFeed.Webmaster = channelXmlNode.ChildNodes[i].InnerText; break; } case "pubDate": { rssFeed.PubDate = channelXmlNode.ChildNodes[i].InnerText; break; } case "lastBuildDate": { rssFeed.LastBuildDate = channelXmlNode.ChildNodes[i].InnerText; break; } case "category": { rssFeed.Category = channelXmlNode.ChildNodes[i].InnerText; break; } case "generator": { rssFeed.Generator = channelXmlNode.ChildNodes[i].InnerText; break; } case "ttl": { rssFeed.Ttl = channelXmlNode.ChildNodes[i].InnerText; break; } case "rating": { rssFeed.Rating = channelXmlNode.ChildNodes[i].InnerText; break; } case "skipHours": { rssFeed.Skiphours = channelXmlNode.ChildNodes[i].InnerText; break; } case "skipDays": { rssFeed.Skipdays = channelXmlNode.ChildNodes[i].InnerText; break; } case "managingEditor": { rssFeed.ManagingEditor = channelXmlNode.ChildNodes[i].InnerText; break; } case "item": { rssFeed.Items.Add( this.getRssItem(channelXmlNode.ChildNodes[i]) ); // Fire the found event if ( this.ItemAdded != null ) { this.ItemAdded(this,new EventArgs()); } break; } } } // If rdf mode is set, then the channel node only contains // information about the channel, it doesn't hold the item // nodes. The item nodes are children of the root node in // an RDF document, so we use this instead. if ( this.RdfMode ) { for (int i=0;i < rssXmlNode.ChildNodes.Count;i++) { switch ( rssXmlNode.ChildNodes[i].Name ) { case "item": { rssFeed.Items.Add( this.getRssItem(rssXmlNode.ChildNodes[i]) ); // Fire the found event if ( this.ItemAdded != null ) { this.ItemAdded(this,new EventArgs()); } break; } } } } } else { rssFeed.ErrorMessage = "Unable to find rss <seehannel> node"; // Fire the error event if ( this.Error != null ) { RssReaderErrorEventArgs args = new RssReaderErrorEventArgs(); args.Message = rssFeed.ErrorMessage; this.Error(this,args); } } } else { rssFeed.ErrorMessage = "Unable to find root <rss> node"; // Fire the error event if ( this.Error != null ) { RssReaderErrorEventArgs args = new RssReaderErrorEventArgs(); args.Message = rssFeed.ErrorMessage; this.Error(this,args); } } } catch (XmlException err) { // rssFeed.ErrorMessage = "Xml error: " +err.Message; // Fire the error event if ( this.Error != null ) { RssReaderErrorEventArgs args = new RssReaderErrorEventArgs(); args.Message = rssFeed.ErrorMessage; this.Error(this,args); } return rssFeed; } return rssFeed; } /// <summary> /// Creates an RSS item from an XML node with the /// corresponding child nodes (title,description etc.) /// </summary> /// <param name="xmlNode">The node to extract the details from</param> /// <returns>An RssItem object with details taken from the item node.</returns> private RssItem getRssItem(XmlNode xmlNode) { RssItem rssItem = new RssItem(); for (int i=0;i < xmlNode.ChildNodes.Count;i++) { switch ( xmlNode.ChildNodes[i].Name ) { case "title": { rssItem.Title = xmlNode.ChildNodes[i].InnerText; break; } case "description": { rssItem.Description = xmlNode.ChildNodes[i].InnerText; break; } case "link": { rssItem.Link = xmlNode.ChildNodes[i].InnerText; break; } case "author": { rssItem.Author = xmlNode.ChildNodes[i].InnerText; break; } case "comments": { rssItem.Comments = xmlNode.ChildNodes[i].InnerText; break; } case "pubdate": { rssItem.Pubdate = xmlNode.ChildNodes[i].InnerText; break; } case "guid": { rssItem.Guid = xmlNode.ChildNodes[i].InnerText; break; } } } return rssItem; } } #endregion #region Html creator class /// <summary> /// This class provides an easy method of converting a <see cref="RssFeed">RssFeed</see> /// object into a simple HTML document. This document can then be written to /// file, where it can be stored in a cached state (saving a feed request each /// time the feed is required). /// </summary> public class RssHtmlMaker { /// <summary> /// Restricts the number of items that are displayed and replaced /// using the %Items% token in the HTML template. /// </summary> public int MaxItems { get { return this.maxItems; } set { this.maxItems = value; } } /// <summary> /// Member for the public property. /// </summary> private int maxItems = 0; /// <summary> /// Creates a HTML document, or any format - this is only limited by /// the template you provide - from the provided /// <see cref="RssFeed">RssFeed</see> object. The tokens described in the /// remarks section are replaced with their values inside the template. /// The items in the RSS feed are replaced using the ItemPrefix and ItemSuffix /// templates, where the suffix is placed face, and the suffix is appended on the end. /// </summary> /// <remarks> /// The following are a list of tokens which are replaced inside the main Template, /// with their corresponding values from the provided <see cref="RssFeed">RssFeed</see> /// object. For details on each token, see its corresponding property in the /// <see cref="RssFeed">RssFeed</see> object. /// <list type="bullet"> /// <item>%Title%</item> /// <item>%Description%</item> /// <item>%Link%</item> /// <item>%Language%</item> /// <item>%Copyright%</item> /// <item>%Webmaster%</item> /// <item>%PubDate%</item> /// <item>%LastBuildDate%</item> /// <item>%Category%</item> /// <item>%Generator%</item> /// <item>%Ttl%</item> /// <item>%Rating%</item> /// <item>%Skiphours%</item> /// <item>%Skipdays%</item> /// <item>%Skipdays%</item> /// <item>%Items% - This is replaced by the parsed template of the items</item> /// </list> /// The following are a list of tokens which are replaced inside the ItemPrefix /// and ItemSuffix templates, with their corresponding values from the /// provided <see cref="RssItem">RssItem</see> object. For details /// on each token, see its corresponding property in /// the <see cref="RssItem">RssItem</see> object. /// <list type="bullet"> /// <item>%Title%</item> /// <item>%Description%</item> /// <item>%Link%</item> /// <item>%Author%</item> /// <item>%Comments%</item> /// <item>%Pubdate%</item> /// <item>%Guid%</item> /// </list> /// </remarks> /// <param name="Feed">The <see cref="RssFeed">RssFeed</see> object to /// get the tokens' data from.</param> /// <param name="Template">The overall HTML template (or any other format) /// to replace the tokens in.</param> /// <param name="ItemPrefix">A string template that is prepended to the beginning /// of each RSS item.</param> /// <param name="ItemSuffix">A string template that is apppended to the end /// of each RSS item.</param> /// <returns>A string with the templates provided parsed of their tokens, with /// the data values in their place.</returns> public string GetHtmlContents(RssFeed Feed,string Template,string ItemPrefix,string ItemSuffix) { string result = Template; // Replace all template tokens result = result.Replace("%Title%",Feed.Title); result = result.Replace("%Description%",Feed.Description); result = result.Replace("%Link%",Feed.Link); result = result.Replace("%Language%",Feed.Language); result = result.Replace("%Copyright%",Feed.Copyright); result = result.Replace("%Webmaster%",Feed.Webmaster); result = result.Replace("%PubDate%",Feed.PubDate); result = result.Replace("%LastBuildDate%",Feed.LastBuildDate); result = result.Replace("%Category%",Feed.Category); result = result.Replace("%Generator%",Feed.Generator); result = result.Replace("%Ttl%",Feed.Ttl); result = result.Replace("%Rating%",Feed.Rating); result = result.Replace("%Skiphours%",Feed.Skiphours); result = result.Replace("%Skipdays%",Feed.Skipdays); result = result.Replace("%Skipdays%",Feed.ManagingEditor); // Parse item template string itemsContent = ""; string tempContent = ""; if ( maxItems == 0 || maxItems > Feed.Items.Count ) { maxItems = Feed.Items.Count; } for (int i=0;i < maxItems;i++) { // Parse prefix template tempContent = ItemPrefix; tempContent = tempContent.Replace("%Title%",Feed.Items[i].Title); tempContent = tempContent.Replace("%Description%",Feed.Items[i].Description); tempContent = tempContent.Replace("%Link%",Feed.Items[i].Link); tempContent = tempContent.Replace("%Author%",Feed.Items[i].Author); tempContent = tempContent.Replace("%Comments%",Feed.Items[i].Comments); tempContent = tempContent.Replace("%Pubdate%",Feed.Items[i].Pubdate); tempContent = tempContent.Replace("%Guid%",Feed.Items[i].Guid); itemsContent += tempContent; // Parse suffix template tempContent = ItemSuffix; tempContent = tempContent.Replace("%Title%",Feed.Items[i].Title); tempContent = tempContent.Replace("%Description%",Feed.Items[i].Description); tempContent = tempContent.Replace("%Link%",Feed.Items[i].Link); tempContent = tempContent.Replace("%Author%",Feed.Items[i].Author); tempContent = tempContent.Replace("%Comments%",Feed.Items[i].Comments); tempContent = tempContent.Replace("%Pubdate%",Feed.Items[i].Pubdate); tempContent = tempContent.Replace("%Guid%",Feed.Items[i].Guid); itemsContent += tempContent; } // Replace %items% with items result = result.Replace("%Items%",itemsContent); return result; } } #endregion #region Data structures /// <summary> /// A data type to represent all properties of single RSS feed. /// (one XML document). The descriptions for /// the properties of RssItem are para-phrased from the /// <see href="http://blogs.law.harvard.edu/tech/rss">RSS 2 specification</see>. /// See <see cref="RssReader">RssReader</see> for properties which /// have not yet been implemented in this version of the /// the RssReader class. /// </summary> /// <remarks> /// The following elements of the RSS <channel> node aren't /// supported by this version of RssReader: /// <list type="bullet"> /// <item>image (has subelements: image,url,title,link)</item> /// <item>cloud (has attributes: domain,port,path,registerProcedure,protocol)</item> /// <item>textInput (has subelements: title,description,name,link)</item> /// </list> /// </remarks> [Serializable()] public struct RssFeed { /// <summary> /// The name of the channel. /// </summary> public string Title; /// <summary> /// Phrase or sentence describing the channel. /// </summary> public string Description; /// <summary> /// The URL to the HTML website corresponding to the channel. /// </summary> public string Link; // Optional items /// <summary> /// The language the channel is written in. This allows /// aggregators to group all Italian language sites, for example, on a single page. /// </summary> public string Language; /// <summary> /// Copyright notice for content in the channel. /// </summary> public string Copyright; /// <summary> /// Email address for person responsible for technical issues relating to channel. /// </summary> public string Webmaster; /// <summary> /// The publication date for the content in the channel. /// </summary> public string PubDate; /// <summary> /// The last time the content of the channel changed. /// </summary> public string LastBuildDate; /// <summary> /// Specify one or more categories that the channel belongs to. /// </summary> public string Category; /// <summary> /// A string indicating the program used to generate the channel. /// </summary> public string Generator; /// <summary> /// ttl stands for time to live. It's a number of minutes /// that indicates how long a channel can be cached before /// refreshing from the source /// </summary> public string Ttl; /// <summary> /// The <see href="http://www.w3.org/PICS/">PICS</see> rating for the channel. /// </summary> public string Rating; /// <summary> /// A hint for aggregators telling them which hours they can skip. /// </summary> public string Skiphours; /// <summary> /// A hint for aggregators telling them which days they can skip. /// </summary> public string Skipdays; /// <summary> /// Email address for person responsible for editorial content. /// </summary> public string ManagingEditor; /// <summary> /// A collection of RssItem datatypes, representing each /// item for the RSS feed. /// </summary> public RssItems Items; /// <summary> /// Contains any errors that occured during the loading or /// parsing of the XML document. Compare this to a blank string /// to see if any errors occured. /// </summary> public string ErrorMessage; } /// <summary> /// A data type to represent a single /// RSS item in a RSS feed. See <see cref="RssReader">RssReader</see> for /// properties of a RSS item which have not yet been implemented /// in this version of the the RssReader class. The descriptions for /// the properties of RssItem are para-phrased from the /// <see href="http://blogs.law.harvard.edu/tech/rss">RSS 2 specification.</see> /// </summary> /// <remarks> /// The following elements of a RSS item aren't /// supported by this version of RssReader: /// <list type="bullet"> /// <item>category (can have domain attribute)</item> /// <item>enclosure ( has attributes: url,length,type )</item> /// <item>source (has attributes: url)</item> /// </list> /// </remarks> [Serializable()] public struct RssItem { /// <summary> /// The title of the item. /// </summary> public string Title; /// <summary> /// The item synopsis. /// </summary> public string Description; /// <summary> /// The URL of the item. /// </summary> public string Link; /// <summary> /// Email address of the author of the item. /// </summary> public string Author; /// <summary> /// URL of a page for comments relating to the item /// </summary> public string Comments; /// <summary> /// Indicates when the item was published. /// </summary> public string Pubdate; /// <summary> /// A string that uniquely identifies the item. /// </summary> public string Guid; } /// <summary> /// Represents a collection of RSS items for /// the RSS feed. /// </summary> [Serializable()] public class RssItems : CollectionBase { public RssItem this[int item] { get { return this.getItem(item); } } public void Add(RssItem rssItem) { List.Add(rssItem); } public bool Remove(int index) { if (index > Count - 1 || index < 0) { return false; } else { List.RemoveAt(index); return true; } } private RssItem getItem(int Index) { return (RssItem) List[Index]; } } #endregion } --- NEW FILE: opmlhead.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: opmlbody.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rsstextinput.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: opml.xsx --- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout layoutVersion="2" viewPortLeft="-683" viewPortTop="0" zoom="100"> <body_XmlElement left="317" top="254" width="5292" height="2963" selected="0" zOrder="1" index="0" expanded="1"> <ref_x003D_outline_XmlElement left="317" top="3725" width="5292" height="2963" selected="0" zOrder="2" index="0" expanded="0" /> </body_XmlElement> <data_XmlElement left="6243" top="254" width="5292" height="847" selected="0" zOrder="5" index="1" expanded="1" /> <head_XmlElement left="12169" top="254" width="5292" height="2963" selected="0" zOrder="7" index="2" expanded="1"> <ref_x003D_metadata_XmlElement left="12169" top="3725" width="5292" height="2963" selected="0" zOrder="9" index="0" expanded="0" /> </head_XmlElement> <item_XmlElement left="18095" top="254" width="5292" height="2963" selected="0" zOrder="12" index="3" expanded="1" /> <metadata_XmlElement left="24021" top="254" width="5292" height="2963" selected="0" zOrder="14" index="4" expanded="1" /> <oml_XmlElement left="32910" top="254" width="5292" height="2963" selected="0" zOrder="15" index="5" expanded="1"> <ref_x003D_head_XmlElement left="29947" top="3725" width="5292" height="2963" selected="0" zOrder="16" index="0" expanded="0" /> <ref_x003D_body_XmlElement left="35873" top="3725" width="5292" height="2963" selected="0" zOrder="18" index="1" expanded="0" /> </oml_XmlElement> <outline_XmlElement left="44762" top="254" width="5292" height="2963" selected="0" zOrder="20" index="6" expanded="1"> <ref_x003D_item_XmlElement left="38836" top="3725" width="5292" height="2963" selected="0" zOrder="21" index="1" expanded="0" /> <ref_x003D_outline_XmlElement left="47725" top="3725" width="5292" height="2963" selected="0" zOrder="23" index="2" expanded="1"> <ref_x003D_item_XmlElement left="44762" top="7196" width="5292" height="2963" selected="0" zOrder="31" index="1" expanded="0" /> <ref_x003D_outline_XmlElement left="50688" top="7196" width="5292" height="2963" selected="0" zOrder="34" index="2" expanded="0" /> </ref_x003D_outline_XmlElement> </outline_XmlElement> </XSDDesignerLayout> --- NEW FILE: opml.xsd --- <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="opml" targetNamespace="http://tempuri.org/opml.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/opml.xsd" xmlns:mstns="http://tempuri.org/opml.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> </xs:schema> --- NEW FILE: rssguid.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: opmloutline.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: RssCacheManager.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rssimage.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rss.xsx --- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> <XSDDesignerLayout layoutVersion="2" viewPortLeft="0" viewPortTop="0" zoom="100"> <rss_XmlElement left="317" top="254" width="5292" height="2963" selected="0" zOrder="0" index="0" expanded="1"> <channel_XmlElement left="317" top="3725" width="5292" height="2963" selected="0" zOrder="54" index="0" expanded="1"> <_x0028_group1_x0029__XmlChoice left="-2646" top="7196" width="5292" height="2963" selected="0" zOrder="57" index="0" expanded="0" /> <item_XmlElement left="3280" top="7196" width="5292" height="2963" selected="0" zOrder="60" index="1" expanded="0" /> </channel_XmlElement> </rss_XmlElement> <tRss_XmlComplexType left="6243" top="254" width="5292" height="2963" selected="0" zOrder="1" index="1" expanded="1"> <channel_XmlElement left="6243" top="3725" width="5292" height="2963" selected="0" zOrder="3" index="0" expanded="0" /> </tRss_XmlComplexType> <tRssItem_XmlComplexType left="21058" top="254" width="5292" height="2963" selected="0" zOrder="6" index="2" expanded="1"> <_x0028_group1_x0029__XmlChoice left="21058" top="3725" width="5292" height="2963" selected="0" zOrder="7" index="0" expanded="1"> <category_XmlElement left="12169" top="7196" width="5292" height="2963" selected="0" zOrder="9" index="4" expanded="0" /> <enclosure_XmlElement left="18095" top="7196" width="5292" height="2963" selected="0" zOrder="12" index="6" expanded="0" /> <guid_XmlElement left="24021" top="7196" width="5292" height="2963" selected="0" zOrder="17" index="7" expanded="0" /> <source_XmlElement left="29947" top="7196" width="5292" height="2963" selected="0" zOrder="19" index="9" expanded="0" /> </_x0028_group1_x0029__XmlChoice> </tRssItem_XmlComplexType> <tRssChannel_XmlComplexType left="53651" top="254" width="5292" height="2963" selected="0" zOrder="21" index="3" expanded="1"> <_x0028_group1_x0029__XmlChoice left="50688" top="3725" width="5292" height="2963" selected="0" zOrder="22" index="0" expanded="1"> <category_XmlElement left="35873" top="7196" width="5292" height="2963" selected="0" zOrder="24" index="9" expanded="0" /> <cloud_XmlElement left="41799" top="7196" width="5292" height="2963" selected="0" zOrder="26" index="12" expanded="0" /> <image_XmlElement left="47725" top="7196" width="5292" height="2963" selected="0" zOrder="28" index="14" expanded="0" /> <textInput_XmlElement left="53651" top="7196" width="5292" height="2963" selected="0" zOrder="30" index="15" expanded="0" /> <skipHours_XmlElement left="59577" top="7196" width="5292" height="2963" selected="0" zOrder="32" index="16" expanded="0" /> <skipDays_XmlElement left="65503" top="7196" width="5292" height="2963" selected="0" zOrder="34" index="17" expanded="0" /> </_x0028_group1_x0029__XmlChoice> <item_XmlElement left="71429" top="3725" width="5292" height="2963" selected="0" zOrder="36" index="1" expanded="0" /> </tRssChannel_XmlComplexType> <tSkipHour_XmlSimpleType left="77355" top="254" width="5292" height="2963" selected="0" zOrder="38" index="4" expanded="1" /> <tSkipHoursList_XmlComplexType left="83281" top="254" width="5292" height="2963" selected="0" zOrder="39" index="5" expanded="1" /> <tSkipDay_XmlSimpleType left="89207" top="254" width="5292" height="2963" selected="0" zOrder="40" index="6" expanded="1" /> <tSkipDaysList_XmlComplexType left="95133" top="254" width="5292" height="2963" selected="0" zOrder="41" index="7" expanded="1" /> <tCategory_XmlComplexType left="101059" top="254" width="5292" height="2963" selected="0" zOrder="42" index="8" expanded="1" /> <tImage_XmlComplexType left="106985" top="254" width="5292" height="2963" selected="0" zOrder="43" index="9" expanded="1" /> <tImageHeight_XmlSimpleType left="112911" top="254" width="5292" height="2963" selected="0" zOrder="44" index="10" expanded="1" /> <tImageWidth_XmlSimpleType left="118837" top="254" width="5292" height="2963" selected="0" zOrder="45" index="11" expanded="1" /> <tCloud_XmlComplexType left="124763" top="254" width="5292" height="2963" selected="0" zOrder="46" index="12" expanded="1" /> <tCloudProtocol_XmlSimpleType left="130689" top="254" width="5292" height="2963" selected="0" zOrder="47" index="13" expanded="1" /> <tTextInput_XmlComplexType left="136615" top="254" width="5292" height="2963" selected="0" zOrder="48" index="14" expanded="1" /> <tEmailAddress_XmlSimpleType left="142541" top="254" width="5292" height="2963" selected="0" zOrder="49" index="15" expanded="1" /> <tRfc822FormatDate_XmlSimpleType left="148467" top="254" width="5292" height="2963" selected="0" zOrder="50" index="16" expanded="1" /> <tSource_XmlComplexType left="154393" top="254" width="5292" height="2963" selected="0" zOrder="51" index="17" expanded="1" /> <tEnclosure_XmlComplexType left="160319" top="254" width="5292" height="2963" selected="0" zOrder="52" index="18" expanded="1" /> <tGuid_XmlComplexType left="166245" top="254" width="5292" height="2963" selected="0" zOrder="53" index="19" expanded="1" /> </XSDDesignerLayout> --- NEW FILE: rss.xsd --- <?xml version="1.0" encoding="UTF-8" ?> <!-- XML Schema for RSS v2.0 Copyright (C) 2003 Jorgen Thelin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" version="2.0.1.10"> <xs:annotation> <xs:documentation>XML Schema for RSS v2.0 feed files.</xs:documentation> <xs:documentation>Revision: 10</xs:documentation> <xs:documentation>Date: 23-June-2003</xs:documentation> <xs:documentation>Based on the RSS 2.0 specification document at http://feeds.archive.org/validator/docs/rss2.html</xs:documentation> <xs:documentation>Author: Jorgen Thelin</xs:documentation> <xs:documentation>Feedback to: http://www.thearchitect.co.uk/weblog/archives/2003/03/000118.html</xs:documentation> </xs:annotation> <xs:element name="rss" type="tRss" /> <xs:complexType name="tRss"> <xs:sequence> <xs:element name="channel" type="tRssChannel" /> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="version" type="xs:decimal" use="required" fixed="2.0" /> <xs:anyAttribute namespace="##any" /> </xs:complexType> <xs:complexType name="tRssItem"> <xs:annotation> <xs:documentation>An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed), and the link and title may be omitted.</xs:documentation> </xs:annotation> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="title" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>The title of the item.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="description" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>The item synopsis.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="link" type="xs:anyURI" minOccurs="0"> <xs:annotation> <xs:documentation>The URL of the item.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="author" type="tEmailAddress" minOccurs="0"> <xs:annotation> <xs:documentation>Email address of the author of the item.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="category" type="tCategory" minOccurs="0"> <xs:annotation> <xs:documentation>Includes the item in one or more categories. </xs:documentation> </xs:annotation> </xs:element> <xs:element name="comments" type="xs:anyURI" minOccurs="0"> <xs:annotation> <xs:documentation>URL of a page for comments relating to the item.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="enclosure" type="tEnclosure" minOccurs="0"> <xs:annotation> <xs:documentation>Describes a media object that is attached to the item.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="guid" type="tGuid" minOccurs="0"> <xs:annotation> <xs:documentation>guid or permalink URL for this entry</xs:documentation> </xs:annotation> </xs:element> <xs:element name="pubDate" type="tRfc822FormatDate" minOccurs="0"> <xs:annotation> <xs:documentation>Indicates when the item was published.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="source" type="tSource" minOccurs="0"> <xs:annotation> <xs:documentation>The RSS channel that the item came from.</xs:documentation> </xs:annotation> </xs:element> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>Extensibility element.</xs:documentation> </xs:annotation> </xs:any> </xs:choice> </xs:sequence> <xs:anyAttribute namespace="##any" /> </xs:complexType> <xs:complexType name="tRssChannel"> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element name="title" type="xs:string"> <xs:annotation> <xs:documentation>The name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="link" type="xs:anyURI"> <xs:annotation> <xs:documentation>The URL to the HTML website corresponding to the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="description" type="xs:string"> <xs:annotation> <xs:documentation>Phrase or sentence describing the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="language" type="xs:language" minOccurs="0"> <xs:annotation> <xs:documentation>The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="copyright" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>Copyright notice for content in the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="managingEditor" type="tEmailAddress" minOccurs="0"> <xs:annotation> <xs:documentation>Email address for person responsible for editorial content.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="webMaster" type="tEmailAddress" minOccurs="0"> <xs:annotation> <xs:documentation>Email address for person responsible for technical issues relating to channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="pubDate" type="tRfc822FormatDate" minOccurs="0"> <xs:annotation> <xs:documentation>The publication date for the content in the channel. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred).</xs:documentation> </xs:annotation> </xs:element> <xs:element name="lastBuildDate" type="tRfc822FormatDate" minOccurs="0"> <xs:annotation> <xs:documentation>The last time the content of the channel changed.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="category" type="tCategory" minOccurs="0"> <xs:annotation> <xs:documentation>Specify one or more categories that the channel belongs to.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="generator" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>A string indicating the program used to generate the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="docs" type="xs:anyURI" minOccurs="0"> <xs:annotation> <xs:documentation>A URL that points to the documentation for the format used in the RSS file. It's probably a pointer to this page. It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="cloud" type="tCloud" minOccurs="0"> <xs:annotation> <xs:documentation>Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ttl" type="xs:nonNegativeInteger" minOccurs="0"> <xs:annotation> <xs:documentation>ttl stands for time to live. It's a number of minutes that indicates how long a channel can be cached before refreshing from the source.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="image" type="tImage" minOccurs="0"> <xs:annotation> <xs:documentation>Specifies a GIF, JPEG or PNG image that can be displayed with the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="textInput" type="tTextInput" minOccurs="0"> <xs:annotation> <xs:documentation>Specifies a text input box that can be displayed with the channel.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="skipHours" type="tSkipHoursList" minOccurs="0"> <xs:annotation> <xs:documentation>A hint for aggregators telling them which hours they can skip.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="skipDays" type="tSkipDaysList" minOccurs="0"> <xs:annotation> <xs:documentation>A hint for aggregators telling them which days they can skip.</xs:documentation> </xs:annotation> </xs:element> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>Extensibility element.</xs:documentation> </xs:annotation> </xs:any> </xs:choice> <xs:element name="item" type="tRssItem" maxOccurs="unbounded" /> <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation>Extensibility element.</xs:documentation> </xs:annotation> </xs:any> </xs:sequence> <xs:anyAttribute namespace="##any" /> </xs:complexType> <xs:simpleType name="tSkipHour"> <xs:annotation> <xs:documentation>A time in GMT when aggregators should not request the channel data. The hour beginning at midnight is hour zero.</xs:documentation> </xs:annotation> <xs:restriction base="xs:nonNegativeInteger"> <xs:minInclusive value="0" /> <xs:maxInclusive value="23" /> </xs:restriction> </xs:simpleType> <xs:complexType name="tSkipHoursList"> <xs:sequence> <xs:element name="hour" type="tSkipHour" minOccurs="0" maxOccurs="24" /> </xs:sequence> </xs:complexType> <xs:simpleType name="tSkipDay"> <xs:annotation> <xs:documentation>A day when aggregators should not request the channel data.</xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> <xs:enumeration value="Monday" /> <xs:enumeration value="Tuesday" /> <xs:enumeration value="Wednesday" /> <xs:enumeration value="Thursday" /> <xs:enumeration value="Friday" /> <xs:enumer... [truncated message content] |