searches.xsl 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0"?>
  2. <!-- this stylesheet builds the API*.html , it works based on libxml2-refs.xml
  3. -->
  4. <xsl:stylesheet version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:exsl="http://exslt.org/common"
  7. extension-element-prefixes="exsl"
  8. exclude-result-prefixes="exsl">
  9. <!-- Import the rest of the site stylesheets -->
  10. <xsl:import href="site.xsl"/>
  11. <!-- Generate XHTML-1.0 transitional -->
  12. <xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
  13. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  14. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
  15. <xsl:variable name="href_base" select="''"/>
  16. <xsl:template name="statistics">
  17. <h2> weekly statistics: </h2>
  18. <p><xsl:value-of select="@total"/> total words,
  19. <xsl:value-of select="@uniq"/> uniq words.</p>
  20. <p> Top <xsl:value-of select="@nr"/> queries:</p>
  21. </xsl:template>
  22. <xsl:template match="query">
  23. <br/><a href="search.php?query={string(.)}"><xsl:value-of
  24. select="string(.)"/></a>
  25. <xsl:text> </xsl:text><xsl:value-of select="@count"/> times.
  26. </xsl:template>
  27. <xsl:template match="queries">
  28. <xsl:variable name="date" select="@date"/>
  29. <xsl:variable name="title">Search statistics for <xsl:value-of select="$date"/></xsl:variable>
  30. <xsl:document href="searches.html" method="xml" encoding="ISO-8859-1"
  31. doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  32. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  33. <html>
  34. <head>
  35. <xsl:call-template name="style"/>
  36. <xsl:element name="title">
  37. <xsl:value-of select="$title"/>
  38. </xsl:element>
  39. </head>
  40. <body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
  41. <xsl:call-template name="titlebox">
  42. <xsl:with-param name="title" select="$title"/>
  43. </xsl:call-template>
  44. <table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
  45. <tr>
  46. <td bgcolor="#8b7765">
  47. <table border="0" cellspacing="0" cellpadding="2" width="100%">
  48. <tr>
  49. <td valign="top" width="200" bgcolor="#8b7765">
  50. <xsl:call-template name="toc"/>
  51. </td>
  52. <td valign="top" bgcolor="#8b7765">
  53. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  54. <tr>
  55. <td>
  56. <table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
  57. <tr>
  58. <td>
  59. <table border="0" cellpadding="3" cellspacing="1" width="100%">
  60. <tr>
  61. <td bgcolor="#fffacd">
  62. <xsl:call-template name="statistics"/>
  63. <p>
  64. <xsl:apply-templates select="query"/>
  65. </p>
  66. <p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
  67. </td>
  68. </tr>
  69. </table>
  70. </td>
  71. </tr>
  72. </table>
  73. </td>
  74. </tr>
  75. </table>
  76. </td>
  77. </tr>
  78. </table>
  79. </td>
  80. </tr>
  81. </table>
  82. </body>
  83. </html>
  84. </xsl:document>
  85. </xsl:template>
  86. <xsl:template match="/">
  87. <xsl:apply-templates select="queries"/>
  88. </xsl:template>
  89. </xsl:stylesheet>