home *** CD-ROM | disk | FTP | other *** search
/ Freelog 64 / Freelog064.iso / Dossier / SimpleBrowser / simpleBrowser.msi / _D82D16C5E4F5BFCBD7413D2074124C56 / _230D00014A744D2095E83E99944BBAB4 < prev    next >
Extensible Markup Language  |  2004-01-05  |  10KB  |  337 lines

  1. <?xml version="1.0" ?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/" xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/">
  3.  
  4. <xsl:output method="html"  indent="yes"/>
  5. <xsl:template match="/rss/channel">
  6. <html>
  7. <head>
  8. <title><xsl:value-of select="title"/></title>
  9. </head>
  10. <body bgcolor="#ffffff" link="#006699" vlink="#ecac00">
  11. <p>
  12. <strong><font size="5" face="arial,verdana"><a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  13. <xsl:value-of select="title"/></a></font></strong>
  14. </p>
  15.  
  16.     <xsl:if test="image">
  17.     <!--
  18.      --> 
  19.         <p><img><xsl:attribute name="src"><xsl:value-of select="image/url"/></xsl:attribute> 
  20.         <xsl:if test="image/width">
  21.             <xsl:attribute name="width"><xsl:value-of select="image/width"/></xsl:attribute> 
  22.         </xsl:if>
  23.         <xsl:if test="image/height">
  24.             <xsl:attribute name="height"><xsl:value-of select="image/height"/></xsl:attribute>
  25.         </xsl:if>
  26.         </img></p>
  27.     </xsl:if>
  28.  
  29.     <xsl:if test="description">
  30.         <strong><font size="4" face="arial,verdana">
  31.         <xsl:value-of select="description"/>
  32.         </font></strong>
  33.     </xsl:if>
  34. <p>
  35. <font size="3" face="arial,verdana" color="#666666">
  36.     <xsl:if test="lastBuildDate">
  37.         <strong>Last Modified:  
  38.         <xsl:value-of select="lastBuildDate"/>
  39.         </strong>
  40.     </xsl:if>
  41.     <xsl:if test="pubDate">
  42.         <p></p><strong>    Publication Date:  
  43.         <xsl:value-of select="pubDate"/>
  44.         </strong>
  45.     </xsl:if>
  46. </font>
  47. </p>
  48.  
  49. <HR size="5" color="darkblue" />
  50. <p></p>
  51. <table width="100%" border="1">
  52. <dl>
  53. <xsl:for-each select="item">
  54.  <tr> 
  55.     
  56.     <xsl:choose>
  57.     <xsl:when test="position() mod 2 = 1">
  58.       <td bgcolor="#eeeeee">
  59.             <strong><font size="5" face="arial,verdana">
  60.          <dt>
  61.             <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  62.               <xsl:value-of select="title"/>  </a>
  63.     <xsl:if test="author">
  64.             (<xsl:value-of select="author"/>)
  65.     </xsl:if>
  66.     
  67.        </dt>
  68.     </font></strong>
  69.     <p></p>
  70.       <dd>
  71.     <font size="5" face="arial,verdana">
  72.              <xsl:value-of select="description"/> 
  73.              </font>
  74.              <br></br>
  75.     <font size="4" face="arial,verdana" color="#666666">
  76.         <xsl:if test="pubDate">
  77.             (<xsl:value-of select="pubDate"/>)
  78.         </xsl:if>
  79.         
  80.         </font>
  81.        </dd>
  82.     <p></p>
  83.     </td>
  84.     </xsl:when>
  85.     <xsl:otherwise>
  86.       <td>
  87.          <strong><font size="5" face="arial,verdana">
  88.                <dt>
  89.                  <a><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
  90.                   <xsl:value-of select="title"/>  </a>
  91.             <xsl:if test="author">
  92.             (<xsl:value-of select="author"/>)
  93.             </xsl:if>
  94.  
  95.               </dt>
  96.      </font></strong>
  97.      <p></p>
  98.            <dd>
  99.     <font size="5" face="arial,verdana">
  100.                 <xsl:value-of select="description"/> 
  101.     </font>
  102.     <br></br>
  103.     <font size="4" face="arial,verdana" color="#666666">
  104.         <xsl:if test="pubDate">
  105.             (<xsl:value-of select="pubDate"/>)
  106.         </xsl:if>
  107.         
  108.         </font>
  109.            </dd>
  110.     <p></p>
  111.           </td>
  112.     </xsl:otherwise>
  113.     </xsl:choose>
  114.         
  115.     
  116.  </tr> 
  117. </xsl:for-each>
  118. </dl>
  119. </table>
  120. <p>
  121. <!--  ***************** Copyright ***************
  122. <xsl:value-of select="copyright"/>
  123.   --> 
  124.  
  125. </p>
  126. </body>
  127. </html>
  128. </xsl:template>
  129.  
  130. <xsl:template match="/rdf:RDF">
  131. <html>
  132. <head>
  133. <title><xsl:value-of select="rss09:channel/rss09:title"/><xsl:value-of select="rss:channel/rss:title"/></title>
  134. </head>
  135. <body bgcolor="#eeeeee" link="##006699" vlink="#006699">
  136. <p>
  137. <strong><font size="5" face="arial,verdana"><a><xsl:attribute name="href"><xsl:value-of select="rss:channel/rss:link"/><xsl:value-of select="rss09:channel/rss09:link"/></xsl:attribute>
  138. <xsl:value-of select="rss:channel/rss:title"/><xsl:value-of select="rss09:channel/rss09:title"/></a>
  139. <p></p>
  140. <xsl:if test="rss:image">
  141. <!--
  142.  --> 
  143.     <p><img><xsl:attribute name="src"><xsl:value-of select="rss:image/rss:url"/></xsl:attribute> </img></p>
  144.  
  145. </xsl:if>
  146.  
  147.  
  148. <xsl:value-of select="rss:channel/rss:description"/><xsl:value-of select="rss09:channel/rss09:description"/>
  149. </font></strong>
  150.  
  151. </p>
  152.  
  153. <strong>
  154. <p>
  155.  
  156. <!-- Make the date presentable -->
  157. <xsl:if test="rss:channel/dc:date">
  158.     Date: 
  159.     <xsl:variable name="datetime" select="rss:channel/dc:date"/>
  160.     <xsl:variable name="day" select="substring($datetime, 9, 2)"/>
  161.     <xsl:variable name="month" select="substring($datetime, 6, 2)"/>
  162.     <xsl:variable name="year" select="substring($datetime, 0, 5)"/>
  163.     <xsl:value-of select="concat($day, '/', $month, '/', $year)"/> - 
  164.     <xsl:value-of select="substring($datetime, 12, 5)"/>
  165. </xsl:if>
  166. <xsl:if test="rss:channel/dc:publisher">
  167.     <p></p>Publisher:  <xsl:value-of select="rss:channel/dc:publisher"/>
  168.     <xsl:if test="rss:channel/dc:publisher">
  169.      Subject: <xsl:value-of select="rss:channel/dc:subject"/>
  170.     </xsl:if>
  171.  
  172. </xsl:if>
  173.  
  174. </p>
  175. </strong>
  176. <HR size="5" color="darkblue" />
  177. <table width="100%" border="1">
  178.  
  179. <dl>
  180. <xsl:for-each select="rss:item">
  181.  
  182. <tr> 
  183.     
  184.     <xsl:choose>
  185.     <xsl:when test="position() mod 2 = 1">
  186.     <td bgcolor="#cccccc">
  187.  
  188.        <strong><font size="5" face="arial,verdana">
  189.  
  190.               <dt>
  191.                   <a><xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
  192.                  <xsl:value-of select="rss:title"/></a>
  193.     <xsl:if test="dc:subject">
  194.                - <xsl:value-of select="dc:subject"/> 
  195.     </xsl:if>
  196.     <xsl:if test="dc:creator">
  197.                - (Author: <xsl:value-of select="dc:creator"/>) 
  198.     </xsl:if>
  199.  
  200.              </dt>
  201.              </font></strong>
  202.            <dd>
  203.     <font size="5" face="arial,verdana">
  204.  
  205.               <xsl:if test="rss:description">
  206.               <xsl:value-of select="rss:description"/> 
  207.     </xsl:if>
  208.  
  209.               <!-- Format the publish date -->
  210.     <xsl:if test="dc:date">
  211.                 (<xsl:variable name="pubdate" select="dc:date"/>
  212.                 <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  213.                 <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  214.                 <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  215.                 <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  216.                 <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  217.     </xsl:if>
  218.  
  219.     </font>
  220.          </dd>
  221.        </td>
  222.       </xsl:when>
  223.       <xsl:otherwise>
  224.       <td>
  225.  
  226.     <strong><font size="5" face="arial,verdana">
  227.  
  228.         <dt>
  229.             <a><xsl:attribute name="href"><xsl:value-of select="rss:link"/></xsl:attribute>
  230.             <xsl:value-of select="rss:title"/></a>
  231.         </dt>
  232.     </font></strong>
  233.         <dd>
  234.              <font size="5" face="arial,verdana">
  235.     <xsl:if test="rss:description">
  236.               <xsl:value-of select="rss:description"/> 
  237.     </xsl:if>
  238.  
  239.             <!-- Format the publish date -->
  240.     <xsl:if test="dc:date">
  241.               (<xsl:variable name="pubdate" select="dc:date"/>
  242.               <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  243.               <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  244.               <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  245.               <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  246.               <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  247.     </xsl:if>
  248.            </font>
  249.          </dd>
  250.        </td>
  251.       </xsl:otherwise>
  252.       </xsl:choose>
  253.      </tr>
  254.     </xsl:for-each>
  255.  
  256. <!--Now do it for the 0.9 type RDF feeds-->
  257.  
  258. <xsl:for-each select="rss09:item">
  259.  
  260. <tr> 
  261.     
  262.     <xsl:choose>
  263.     <xsl:when test="position() mod 2 = 1">
  264.     <td bgcolor="#eeeeee">
  265.  
  266.        <strong><font size="5" face="arial,verdana">
  267.  
  268.               <dt>
  269.                   <a><xsl:attribute name="href"><xsl:value-of select="rss09:link"/></xsl:attribute>
  270.                  <xsl:value-of select="rss09:title"/></a>
  271.              </dt>
  272.              </font></strong>
  273.            <dd>
  274.     <font size="5">
  275.  
  276.               <xsl:if test="rss09:description">
  277.               <xsl:value-of select="rss09:description"/> 
  278.     </xsl:if>
  279.  
  280.               <!-- Format the publish date -->
  281.     <xsl:if test="dc:date">
  282.                 (<xsl:variable name="pubdate" select="dc:date"/>
  283.                 <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  284.                 <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  285.                 <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  286.                 <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  287.                 <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  288.     </xsl:if>
  289.  
  290.     </font>
  291.          </dd>
  292.        </td>
  293.       </xsl:when>
  294.       <xsl:otherwise>
  295.       <td>
  296.  
  297.     <strong><font size="5" face="arial,verdana">
  298.  
  299.         <dt>
  300.             <a><xsl:attribute name="href"><xsl:value-of select="rss09:link"/></xsl:attribute>
  301.             <xsl:value-of select="rss09:title"/></a>
  302.         </dt>
  303.     </font></strong>
  304.         <dd>
  305.              <font size="5" face="arial,verdana">
  306.     <xsl:if test="rss09:description">
  307.               <xsl:value-of select="rss09:description"/> 
  308.     </xsl:if>
  309.  
  310.             <!-- Format the publish date -->
  311.     <xsl:if test="dc:date">
  312.               (<xsl:variable name="pubdate" select="dc:date"/>
  313.               <xsl:variable name="pubday" select="substring($pubdate, 9, 2)"/>
  314.               <xsl:variable name="pubmonth" select="substring($pubdate, 6, 2)"/>
  315.               <xsl:variable name="pubyear" select="substring($pubdate, 0, 5)"/>
  316.               <xsl:value-of select="concat($pubday, '/', $pubmonth, '/', $pubyear)"/> - 
  317.               <xsl:value-of select="substring($pubdate, 12, 5)"/>)
  318.     </xsl:if>
  319.            </font>
  320.          </dd>
  321.        </td>
  322.       </xsl:otherwise>
  323.       </xsl:choose>
  324.      </tr>
  325.     </xsl:for-each>
  326.  
  327.  
  328. </dl>
  329. </table>
  330.  
  331. </body>
  332. </html>
  333.  
  334. </xsl:template>
  335.  
  336. </xsl:stylesheet>
  337.