<?xml version="1.0" encoding="UTF-8"?>
<!--
    XML Schema for RSS v2.0
    Copyright (C) 2003,2008  Jorgen Thelin

Microsoft Public License (Ms-PL)

This license governs use of the accompanying software. 
If you use the software, you accept this license. 
If you do not accept the license, do not use the software.

1. Definitions

The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.

    A "contribution" is the original software, or any additions or changes to the software.

    A "contributor" is any person that distributes its contribution under this license.

    "Licensed patents" are a contributor's patent claims that read directly on its contribution.

2. Grant of Rights

    (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

    (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.

3. Conditions and Limitations

    (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.

    (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.

    (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

    (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

    (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. 

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
	version="2.0.1.11">
	<xs:annotation>
		<xs:documentation>XML Schema for RSS v2.0 feed files.</xs:documentation>
		<xs:documentation>Revision: 11</xs:documentation>
		<xs:documentation>Date: 01-Jan-2008</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:enumeration value="Saturday"/>
			<xs:enumeration value="Sunday"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="tSkipDaysList">
		<xs:sequence>
			<xs:element name="day" type="tSkipDay" minOccurs="0" maxOccurs="7">
				<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:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="tCategory">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="domain" type="xs:string" use="optional"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="tImage">
		<xs:all>
			<xs:element name="url" type="xs:anyURI">
				<xs:annotation>
					<xs:documentation>The URL of the image file.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="title" type="xs:string">
				<xs:annotation>
					<xs:documentation>Describes the image, it's used in the ALT attribute of the
						HTML &lt;img&gt; tag when the channel is rendered in
					HTML.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="link" type="xs:anyURI">
				<xs:annotation>
					<xs:documentation>The URL of the site, when the channel is rendered, the image
						is a link to the site. (Note, in practice the image &lt;title&gt;
						and &lt;link&gt; should have the same value as the channel's
						&lt;title&gt; and &lt;link&gt;. </xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="width" type="tImageWidth" default="88" minOccurs="0">
				<xs:annotation>
					<xs:documentation>The width of the image in pixels.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="height" type="tImageHeight" default="31" minOccurs="0">
				<xs:annotation>
					<xs:documentation>The height of the image in pixels.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="description" type="xs:string" minOccurs="0">
				<xs:annotation>
					<xs:documentation>Text that is included in the TITLE attribute of the link
						formed around the image in the HTML rendering.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:all>
	</xs:complexType>
	<xs:simpleType name="tImageHeight">
		<xs:annotation>
			<xs:documentation>The height of the image in pixels.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:positiveInteger">
			<xs:maxInclusive value="400"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="tImageWidth">
		<xs:annotation>
			<xs:documentation>The width of the image in pixels.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:positiveInteger">
			<xs:maxInclusive value="144"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="tCloud">
		<xs:annotation>
			<xs:documentation>Specifies a web service that supports the rssCloud interface which can
				be implemented in HTTP-POST, XML-RPC or SOAP 1.1. Its purpose is to allow 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:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="port" type="xs:positiveInteger" use="required"/>
		<xs:attribute name="path" type="xs:string" use="required"/>
		<xs:attribute name="registerProcedure" type="xs:string" use="required"/>
		<xs:attribute name="protocol" type="tCloudProtocol" use="required"/>
	</xs:complexType>
	<xs:simpleType name="tCloudProtocol">
		<xs:restriction base="xs:string">
			<xs:enumeration value="xml-rpc"/>
			<xs:enumeration value="http-post"/>
			<xs:enumeration value="soap"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="tTextInput">
		<xs:annotation>
			<xs:documentation>The purpose of this element is something of a mystery! You can use it
				to specify a search engine box. Or to allow a reader to provide feedback. Most
				aggregators ignore it.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="title" type="xs:string">
				<xs:annotation>
					<xs:documentation>The label of the Submit button in the text input
					area.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="description" type="xs:string">
				<xs:annotation>
					<xs:documentation>Explains the text input area.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="name" type="xs:string">
				<xs:annotation>
					<xs:documentation>The name of the text object in the text input
					area.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="link" type="xs:anyURI">
				<xs:annotation>
					<xs:documentation>The URL of the CGI script that processes text input
					requests.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:all>
	</xs:complexType>
	<xs:simpleType name="tEmailAddress">
		<xs:annotation>
			<xs:documentation>Using the regexp definiton of E-Mail Address by Lucadean from the .NET
				RegExp Pattern Repository at http://www.3leaf.com/default/NetRegExpRepository.aspx
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern
				value="([a-zA-Z0-9_\-])([a-zA-Z0-9_\-\.]*)@(\[((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}|((([a-zA-Z0-9\-]+)\.)+))([a-zA-Z]{2,}|(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\])"
			/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="tRfc822FormatDate">
		<xs:annotation>
			<xs:documentation>A date-time displayed in RFC-822 format.</xs:documentation>
			<xs:documentation>Using the regexp definiton of rfc-822 date by Sam Ruby at
				http://www.intertwingly.net/blog/1360.html </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern
				value="(((Mon)|(Tue)|(Wed)|(Thu)|(Fri)|(Sat)|(Sun)), *)?\d\d? +((Jan)|(Feb)|(Mar)|(Apr)|(May)|(Jun)|(Jul)|(Aug)|(Sep)|(Oct)|(Nov)|(Dec)) +\d\d(\d\d)? +\d\d:\d\d(:\d\d)? +(([+\-]?\d\d\d\d)|(UT)|(GMT)|(EST)|(EDT)|(CST)|(CDT)|(MST)|(MDT)|(PST)|(PDT)|\w)"
			/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="tSource">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="url" type="xs:anyURI"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="tEnclosure">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="url" type="xs:anyURI" use="required">
					<xs:annotation>
						<xs:documentation>URL where the enclosure is located</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="length" type="xs:nonNegativeInteger" use="required">
					<xs:annotation>
						<xs:documentation>Size in bytes</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="type" type="xs:string" use="required">
					<xs:annotation>
						<xs:documentation>MIME media-type of the enclosure</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="tGuid">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="isPermaLink" type="xs:boolean" use="optional" default="true"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<!--
TODO:
- Need to add regexp pattern for MIME media-type value of tEnclosure/type
- Need to add regexp pattern for checking contents of guid is a URL when isPermaLink=true"
- Need to add some form of constraint to check on an item that one, or other, or both of title and description are present.
- Need some way to enforce cardinality constraints preventing repeated elements in channels or items
-->

	<!--
Change Log:
Date			Revision		Description
31-Mar-2003		1			Initial version released for comment
31-Mar-2003		2			Changes based on feedback from Gudge:
								- Remove targetNamespace="" and use elemenfFormDefault="unqualified" 
								  instead
								- Use namespace="##other" on <any>'s to create a more deterministic data 
								  model.
								- Added missing xs:documentation inside xs:annotation at the schema level.
								- Use xs:language for ISO Language Codes in <language> element.
								- Change guid to a single declaration.  This loses some of the checking of the 
								  URL when the contents of the guid is a permaLink, so we will need to add 
								  that back in with a regexp pattern.
14-Apr-2003		3			Changes to solve some element ordering problems.
								- Use xs:all in place of xs:sequence to support flexible ordering of elements.
									Although the ordering constraints for elements is not clear from the 
									original specification, the custom and practice seems to be that 
									element ordering is freeform.
								- Use elemenfFormDefault="qualified" for explicit intent.
15-Apr-2003		4			Changes to solve some element ordering problems.
								- Use xs:choice in place of xs:all as previous usage of <all> was invalid.
									This creates the problem that unsufficient constraints can be applied 
									by the schema - for example, it can't prevent two title elements for an item.
								- Use elemenfFormDefault="unqualified" for to get the correct behavious 
								        when importing and combining schemas.
15-Apr-2003		5			Putting the extensibility element inside the repeating choice solves 
                                                            all problems with element ordering.
15-Apr-2003		6       - skipHours and skipDays should contain a nested list of values, 
                                                            not just a single value.
                                                      - Added version attribute to schema definition.
                                                      - Corrected type of the cloud element
25-Apr-2003		7     - Add regexp for RFC-822 date suggested by Sam Ruby
                                                    - I had to leave the base type of the tRfc822FormatDate type 
                                                    		as xs:string due to the problems with using 
                                                    		a pattern with xs:dateTime described at
                                                    		http://www.thearchitect.co.uk/weblog/archives/2003/04/000142.html
19-Jun-2003		8    - Fixed a bug the Oxygen XML Editor spotted in the regexp for RFC-822 dates
23-Jun-2003		9    - Added legal boilerplate license text for LGPL.
                                                  - Minor formatting changes.
24-Jun-2003	            10    - Missing types for item/title and item/description - Spotted by Andreas Schwotzer.
01-Jan-2008	       11    - Copy made available under the Microsoft Public License (MS-PL).
-->

</xs:schema>
