Advertisement
Guest User

bashwork

a guest
Nov 5th, 2008
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.97 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"
  3.     xmlns:atom="http://www.w3.org/2005/Atom"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:gd="http://schemas.google.com/g/2005"
  6.     xmlns:gr="http://www.google.com/schemas/reader/atom/">
  7. <!--
  8.     generic atom feed schema
  9.     xmlns:atom="http://purl.org/atom/ns#"
  10.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  11.     xmlns:dc="http://purl.org/dc/elements/1.1/">
  12. -->
  13.  
  14. <xsl:output method="html"/>
  15.  
  16. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  17. <!-- Root Match                                         -->
  18. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  19. <xsl:template match="/">
  20. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  21.     <head>
  22.         <link rel="stylesheet" type="text/css" href="style.css"/>
  23.         <script type="text/javascript" src="jquery.js"></script>
  24.         <script type="text/javascript" src="custom.js"></script>
  25.     </head>
  26.     <body>
  27.         <xsl:apply-templates select="/atom:feed"/>
  28.     </body>
  29. </html>
  30. </xsl:template>
  31.  
  32. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  33. <!-- Atom Feed Match                                    -->
  34. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  35. <xsl:template match="/atom:feed">
  36.     <div id="header">
  37.         <h2><xsl:value-of select="atom:title"/></h2>
  38.         <a href="{atom:link[@rel='self']/@href}">
  39.             <xsl:value-of select="substring(atom:updated, 0, 11)"/>
  40.         </a>
  41.     </div>
  42.     <div id="content">
  43.         <xsl:apply-templates select="atom:entry"/>
  44.     </div>
  45. </xsl:template>
  46.  
  47. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  48. <!-- Atom Entry Match                                   -->
  49. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  50. <xsl:template match="atom:entry">
  51.     <div class="entry">
  52.         <div class="ehead">
  53.         <a href="{atom:link[@rel='alternate']/@href}" title="{substring(atom:published, 0, 11)}">
  54.             <xsl:value-of select="atom:title"/>
  55.         </a>
  56.         </div>
  57.         <div class="ebody">
  58.         <xsl:choose>
  59.             <xsl:when test="atom:content != ''">
  60.                 <p><xsl:value-of select="atom:content" disable-output-escaping="yes" /></p>
  61.             </xsl:when>
  62.             <xsl:otherwise>
  63.                 <p><xsl:value-of select="atom:summary" disable-output-escaping="yes" /></p>
  64.             </xsl:otherwise>
  65.         </xsl:choose>
  66.         </div>
  67.         <div class="efoot">
  68.             <xsl:apply-templates select="atom:author"/>
  69.         </div>
  70.     </div>
  71. </xsl:template>
  72.  
  73. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  74. <!-- Atom Entry Author Match                            -->
  75. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  76. <xsl:template match="atom:author">
  77.     <xsl:choose>
  78.     <xsl:when test="@gr:unknown-author='true'">
  79.         <p>Author Unknown</p>
  80.     </xsl:when>
  81.     <xsl:otherwise>
  82.         <p><xsl:value-of select="atom:name" /></p>
  83.     </xsl:otherwise>
  84.     </xsl:choose>
  85. </xsl:template>
  86.  
  87. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  88. <!-- Please use the stylesheet to control formatting    -->
  89. <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
  90. </xsl:stylesheet>
  91.  
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement