Copyright © tutorialspoint.com
Here is the structure of an RSS 1.0 document:
<?xml version="1.0"?> <rdf:RDF> <channel> <title>...</title> <link>...</link> <description>...</description> <image /> <items>...</items> <textInput /> <image> <title>...</title> <url>...</url> <link>...</link> </image> <item> <title>...</title> <link>...</link> <description>...</description> </item> ......More item tags..... <textInput> <title>...</title> <description>...</description> <name>...</name> <link>...</link> </textInput> </rdf:RDF> |
Here is the detail of all optional and mandatory tags related to RSS 1.0. Check out given example to prepare a RSS v1.0 feed for your website.
NOTE: All the tag are case sensitive and should be used carefully.
As an XML application, an RSS document is not required to begin with an XML declaration. It should start with XML version identifier tag.
Here is list of RSS v1.0 Supported Encodings.
Always and exact. Optional encoding attribute (default is UTF-8).
The outermost level in every RSS 1.0 compliant document is the RDF element. The opening RDF tag assocaties the rdf: namespace prefix with the RDF syntax schema and establishes the RSS 1.0 schema as the default namespace for the document.
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">
Always and exact.
The channel element contains metadata describing the channel itself, including a title, brief description, and URL link to the described resource (the channel provider's home page, for instance).
The {resource} URL of the channel element's rdf:about attribute must be unique with respect to any other rdf:about attributes in the RSS document and is a URI which identifies the channel. Most commonly, this is either the URL of the homepage being described or a URL where the RSS file can be found.
<channel rdf:about="{resource}">
Required. Maximum 1 per RSS file.
An identifying string for a resource. When used in an item, this is the name of the item's link. When used in an image, this is the Alt text for the image. When used in a channel, this is the channel's title. When used in a textinput, this is the the textinput's title.
<title>TutorialsPoint</title>
Required.
1-40 characters.
The URL to which an HTML rendering of the channel title will link, commonly the parent site's home or news page
<link>http://www.tutorialspoint.com</link>
Required.
1-500 characters.
A channel will have a description tag as described below:
<description>Your source for tutorials, references and manuals!</description>
Required.
1-500 characters.
Establishes an RDF association between the optional image element and this particular RSS channel. The rdf:resource's {image_uri} must be the same as the image element's rdf:about {image_uri}.
<image rdf:resource="{image_uri}" />
Required only if image element present in document body
An RDF table of contents, associating the document's items with this particular RSS channel. Each item's rdf:resource {item_uri} must be the same as the associated item element's rdf:about {item_uri}.
An RDF Seq (sequence) is used to contain all the items rather than an RDF Bag to denote item order for rendering and reconstruction.
Note that items appearing in the document but not as members of the channel level items sequence are likely to be discarded by RDF parsers.
<items><rdf:Seq><rdf:li resource="{item_uri}" /> ... </rdf:Seq></items>
Required
Establishes an RDF association between the optional textinput element and this particular RSS channel. The {textinput_uri} rdf:resource must be the same as the textinput element's rdf:about {textinput_uri}.
<textinput rdf:resource="{textinput_uri}" />
Required only if texinput element present
One end channel is required for a channel start tag.
</channel>
An image to be associated with an HTML rendering of the channel. This image should be of a format supported by the majority of Web browsers. While the later 0.91 specification allowed for a width of 1-144 and height of 1-400, convention (and the 0.9 specification) dictate 88x31.
<image rdf:about="{image_uri}">
Optional; if present, must also be present in channel element
The alternative text ("alt" attribute) associated with the channel's image tag when rendered as HTML.
<title>{image_alt_text}</title>
Required if the image element is present
1-40 characters.
The URL of the image to used in the "src" attribute of the channel's image tag when rendered as HTML.
<url>{image_url}</url>
Required if the image element is present
1-500 characters.
The URL to which an HTML rendering of the channel image will link. This, as with the channel's title link, is commonly the parent site's home or news page.
<link>{image_link}</link>
Required if the image element is present
1-500 characters.
Closing tag for image tag.
</image>
Required; if image tag is present
While commonly a news headline, with RSS 1.0's modular extensibility, this can be just about anything: discussion posting, job listing, software patch -- any object with a URI. There may be a minimum of one item per RSS document. While RSS 1.0 does not enforce an upper limit, for backward compatibility with RSS 0.9 and 0.91, a maximum of fifteen items is recommended.
item_uri} must be unique with respect to any other rdf:about attributes in the RSS document and is a URI which identifies the item. {item_uri} should be identical to the value of the <link> sub-element of the <item> element, if possible.
Recommended number of items per feed are 1-15.
<item rdf:about="{item_uri}">
Required 1 or more.
The item's title.
<title>{item_title}</title>
Required; with each item tag
1-100 characters.
The item's URL.
<link>{item_link}</link>
Required; with each item tag
1-500 characters.
A brief description/abstract of the item.
<description>{item_description}</description>
Optional; with an item tag
1-500 characters.
Closing tag for item tag.
</item>
Required; for each item tag
An input field for the purpose of allowing users to submit queries back to the publisher's site. This element should have a title, a link (to a cgi or other processor), a description containing some instructions, and a name, to be used as the name in the HTML tag <input type=text name="[name]">
<textinput rdf:about="{textinput_uri}">
Optional; if present, must also be present in channel element
A descriptive title for the textinput field. For example: "Subscribe" or "Search!".
<title>{textinput_title}</title>
Required if textinput is present
1-40 characters.
A brief description of the textinput field's purpose. For example: "Subscribe to our newsletter for..." or "Search our site's archive of...".
<description>{textinput_description}</description>
Required if textinput is present
1-100 characters.
The text input field's (variable) name.
<name>{textinput_varname}</name>
Required if textinput is present
1-500 characters.
The URL to which a textinput submission will be directed (using GET).
<link>{textinput_action_url}</link>
Required if textinput is present
1-500 characters.
CLosing tag for textInput.
</textInput>
Required with textinput
This is closing tag for an RSS1.0 document.
</rdf:RDF>
Required
Although an RSS 1.0 file is an XML document, RSS 0.91 extends XML by supporting a full set of HTML entities. If you want to use special characters such as ampersands (&) in <url> or <link> tags, you must substitute the appropriate decimal or HTML entities for those characters.
Check for a complete set of HTML entities.
Here is the example feed files which shows how to write RSS Feed using version 1.0.
<?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/"> <channel rdf:about="http://www.tutorialspoint.com"> <title>TutorialsPoint</title> <link>http://tutorialspoint.com/rss</link> <description> Online Tutorials and Reference Manuals </description> <image rdf:resource= "http://tutorialspoint.com/images/tp-logo.gif" /> <items> <rdf:Seq> <rdf:li resource="http://tutorialspoint.com/rss/index.htm" /> <rdf:li resource="http://tutorialspoint.com/php/index.htm" /> </rdf:Seq> </items> <textinput rdf:resource= "http://www.tutorialspoint.com/cgi-bin/tp-contact.cgi" /> </channel> <image rdf:about="http://tutorialspoint.com/images/tp-logo.gif"> <title>TutorialsPoint Logo</title> <link>http://tutorialspoint.com</link> <url>http://tutorialspoint.com/images/tp-logo.gif</url> </image> <item rdf:about="http://tutorialspoint.com/rss/index.htm"> <title>A simple RSS tutorial</title> <link>http://tutorialspoint.com/rss/index.htm</link> <description> Learn RSS in simple and easy steps. </description> </item> <item rdf:about="http://tutorialspoint.com/php/index.htm"> <title>A complete guide for PHP Programmers</title> <link>http://tutorialspoint.com/php/index.htm</link> <description> A free online guide for PHP. Learn PHP in very easy steps. </description> </item> <textinput rdf:about= "http://www.tutorialspoint.com/cgi-bin/tp-contact.cgi"> <title>Contact TutorialsPoint</title> <description> Contact TutorialsPoint for more detail </description> <name>s</name> <link> http://www.tutorialspoint.com/cgi-bin/tp-contact.cgi </link> </textinput> </rdf:RDF> |
A specific file-extension for an RSS 1.0 document is not required. Either .rdf or .xml is recommended, the former being preferred.
RSS 1.0 modules are maintained in separate documents, available online at RSS 1.0 modules.
Copyright © tutorialspoint.com