XML Syndication

This page contains information on XML syndication using RSS 1.0

RSS 1.0

RDF = Resource Description Framework
RSS = RDF Site Summary

<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:rss='http://purl.org/rss/1.0/"
         <!-- Darwin Core -->
         xmlns:dc='http://purl.org/dc/elements/1.1/'
         <!-- Syndication Module -->
         xmlns:sy='http://purl.org/rss/,odules/syndication/'
         <!-- Own namespace -->
         xmlns:rev="http://www.example.com/reviews'

  <rss:channel rdf:about='URL ADDRESS FOR CHANNEL'>
     <rss:title>TITLE</rss:title>
     <rss:link>URL address</rss:link>
     <rss:description>DESCRIPTION</rss:description>

     <sy:updatePeriod>daily</sy:updatePeriod>
     <sy:updateFrequency>1</sy:updateFrequency>
     <sy:updateBase>STARTDATE-TIME</sy:updateBase>

     <rss:items>
       <rss:seq>  <!-- OR <rss:Bag />, <rss:Alt />
          <rdf:li resource='URL address/review/Page1' />
          <rdf:li resource='URL address/review/Page2' />
       </rss:seq>
      </rss:items>

   </rss:channel>

   <rss:item rdf:about='URL address/review/Page1'>
     <rss:title>TITLE</rss:title>
     <rss:link>URL address/review/Page1</rss:link>
     <rss:description>DESCRIPTION</rss:description>
     <dc:creator>NAME</dc:creator>
     <dc:date>DATE</dc:date>
     <dc:rights>Copyright NAME</dc:rights>
     <rev:other>TEXT</rev:other>
   </rss:item>

   <rss:item rdf:about='URL address/review/Page2'>
     <rss:title>TITLE</rss:title>
     <rss:link>URL address/review/Page2</rss:link>
     <rss:description>DESCRIPTION</rss:description>
     <dc:creator>NAME</dc:creator>
     <dc:date>DATE</dc:date>
     <dc:rights>Copyright NAME</dc:rights>
     <rev:other>TEXT</rev:other>
   </rss:item>

</rdf:RDF>

XSLT stylesheet to format RSS 1.0 XML document

<!-- XSLT stylesheet example -->
<xsl:stylesheet version='1.0'
         xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
         xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:rss='http://purl.org/rss/1.0/"
         xmlns:dc='http://purl.org/dc/elements/1.1/'
         xmlns:rev="http://www.example.com/reviews'
         exclude-result-prefixes='rdf rss dc rev'
  <xsl:strip-space elements='*' />
  <xsl:output indent='yes' />

  <xsl:template match='rdf:RDF'>
   <channel>
     <xsl:apply-templates select='rss:channel' />
     <xsl:apply-templates select='rss:item'>
       <xsl:sort select='position()' order='descending' data-type='number' />
     </xsl:apply-templates>
   </channel>
  <xsl:template>

  <xsl:template match='rss:channel'>
    <xsl:apply-templates select='rss:title' />
  </xsl:template>

  <xsl:template match='rss:title'>
    <Name><xsl:value-of select='.' /></Name>
  </xsl:template>

  <xsl:template match='rss:item'>
    <Program attribute='{dc:idenitifier}'>
      <xsl:apply templates select='@rdf:about' />
      <xsl:apply-templates select='rss:title' />
      <xsl:apply-templates select='rss:description' />
    </Program>
  </xsl:template>

  <xsl:template match='rss:title'>
   <Title><xsl:value-of select='.' /></Title>
  </xsl:template>

  <xsl:template match='rss:description'>
   <Description><xsl:value-of select='.' /></Description>
  </xsl:template>

  <xsl:template match='@rdf:about'>
   <Start><xsl:value-of select="substring-after(., '#')" /></Start>
  </xsl:template>

</xsl:stylesheet>

Darwin Core module

  • <dc:title />
  • <dc:creator />
  • <dc:subject />
  • <dc:description />
  • <dc:publisher />
  • <dc:date />
  • <dc:type />
  • <dc:format />
  • <dc:identifier />
  • <dc:source />
  • <dc:language />
  • <dc:relation />
  • <dc:coverage />
  • <dc:rights />
Page tags: rdf rss xml
page_revision: 3, last_edited: 1254471205|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License