]> granicus.if.org Git - docbook-dsssl/commitdiff
Support cvs: date in RSS and updated 1.0 sources
authorNorman Walsh <ndw@nwalsh.com>
Sun, 15 Sep 2002 21:12:14 +0000 (21:12 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sun, 15 Sep 2002 21:12:14 +0000 (21:12 +0000)
website/xsl/rss.xsl

index 166f6d27d160ed21adc536f13543d385667382cc..9ea7fbd767fb183d6f47f23c777066fb8ed2b4d6 100644 (file)
@@ -2,7 +2,10 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:rss="http://purl.org/rss/1.0/"
                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-                exclude-result-prefixes="rss rdf"
+                xmlns:cvsf="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.CVS"
+                xmlns:cvs="http://nwalsh.com/rdf/cvs#"
+                xmlns:dc="http://purl.org/dc/elements/1.1/"
+                exclude-result-prefixes="rss rdf cvs dc cvsf"
                 version="1.0">
 
 <xsl:output method="html"/>
         <xsl:apply-templates/>
       </xsl:otherwise>
     </xsl:choose>
+
+    <xsl:if test="../dc:date|../cvs:date">
+      <xsl:choose>
+        <xsl:when test="../dc:date">
+          <xsl:text> (</xsl:text>
+          <xsl:value-of select="../dc:date[1]"/>
+          <xsl:text>)</xsl:text>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:variable name="timeString" select="cvsf:localTime(../cvs:date[1])"/>
+          <xsl:text> (</xsl:text>
+          <xsl:value-of select="substring($timeString, 1, 3)"/>
+          <xsl:text>, </xsl:text>
+          <xsl:value-of select="substring($timeString, 9, 2)"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="substring($timeString, 5, 3)"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="substring($timeString, 25, 4)"/>
+          <xsl:text>)</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
   </xsl:element>
 </xsl:template>
 
 
 <xsl:template match="rss:items">
   <dl>
-    <xsl:for-each select="rdf:Seq/rdf:li[@rdf:resource and @rdf:resource != '']">
-      <xsl:variable name="resource" select="@rdf:resource"/>
+    <xsl:for-each select="rdf:Seq/rdf:li[@resource and @resource != '']">
+      <xsl:variable name="resource" select="@resource"/>
       <xsl:variable name="item" select="//rss:item[@rdf:about = $resource]"/>
       <xsl:if test="not($item)">
         <xsl:message>