divzero.xsl (842B)
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 2 <xsl:output method="html"/> 3 4 <xsl:template match="/icestats"> 5 <!-- only show the first source --> 6 <xsl:apply-templates select="source[1]"/> 7 </xsl:template> 8 9 <xsl:template match="source"> 10 <html> 11 <head> 12 <link rel="stylesheet" href="https://www.2f30.org/css/style.css" /> 13 </head> 14 <body> 15 <table class="table table-bordered table-striped"> 16 <tr><td>What</td><td> 17 <xsl:choose> 18 <xsl:when test="title or artist"> 19 <xsl:if test="artist"><xsl:value-of select="artist" /> - </xsl:if> 20 <xsl:value-of select="title" /> 21 </xsl:when> 22 <xsl:otherwise>SIGFPE</xsl:otherwise> 23 </xsl:choose> 24 </td></tr> 25 <tr><td>Listeners</td><td><xsl:value-of select="listeners"/></td></tr> 26 <tr><td>Who</td><td><xsl:value-of select="server_name"/></td></tr> 27 </table> 28 </body> 29 </html> 30 </xsl:template> 31 32 </xsl:stylesheet>