render.xslt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. +========================================================================+
  4. | Licensed Materials - Property of IBM
  5. |
  6. | IBM Cognos Products: BUX
  7. |
  8. | (C) Copyright IBM Corp. 2009, 2011
  9. |
  10. | US Government Users Restricted Rights - Use, duplication or
  11. | disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. |
  13. +========================================================================+
  14. -->
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  16. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
  17. <xsl:template match="/">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19. <head>
  20. <title>Index of images</title>
  21. <style type="text/css">
  22. table { font-family: verdana; font-size:8pt; border:1px solid #000; }
  23. td { border-bottom:1px solid #eee; border-right:1px solid #eee; text-align:center }
  24. th { background-color: #eeeef8 }
  25. .flags { background-color: #cccce8 }
  26. </style>
  27. <script type="text/javascript">
  28. function recoverError(source, suffix)
  29. {
  30. source.onerror = "";
  31. source.src = "icon_missing"+suffix+".gif";
  32. return true;
  33. }
  34. </script>
  35. </head>
  36. <body>
  37. <table border="0" cellpadding="4" cellspacing="0">
  38. <tbody>
  39. <tr>
  40. <th>name</th>
  41. <th>16</th>
  42. <th>16r</th>
  43. <th>32</th>
  44. <th>32r</th>
  45. <th>64</th>
  46. <th>64r</th>
  47. </tr>
  48. <xsl:apply-templates select="/images/image">
  49. <xsl:sort select="."/>
  50. </xsl:apply-templates>
  51. </tbody>
  52. </table>
  53. </body>
  54. </html>
  55. </xsl:template>
  56. <xsl:template match="image">
  57. <tr>
  58. <td>
  59. <xsl:if test="@flags">
  60. <xsl:attribute name="class">flags</xsl:attribute>
  61. </xsl:if>
  62. <xsl:value-of select="."/>
  63. </td>
  64. <td>
  65. <xsl:if test="contains(@flags,'B')">
  66. <xsl:attribute name="class">flags</xsl:attribute>
  67. </xsl:if>
  68. <img alt="" src="{.}.gif" onerror="recoverError(this,'')"/>
  69. </td>
  70. <td>
  71. <xsl:if test="contains(@flags,'S')">
  72. <xsl:attribute name="class">flags</xsl:attribute>
  73. </xsl:if>
  74. <img alt="" src="{.}_ref.gif" onerror="recoverError(this,'_ref')"/>
  75. </td>
  76. <td>
  77. <img alt="" src="{.}_32.gif" onerror="recoverError(this,'_32')"/>
  78. </td>
  79. <td>
  80. <img alt="" src="{.}_ref_32.gif" onerror="recoverError(this,'_ref_32')"/>
  81. </td>
  82. <td>
  83. <xsl:if test="contains(@flags,'B')">
  84. <xsl:attribute name="class">flags</xsl:attribute>
  85. </xsl:if>
  86. <img alt="" src="{.}_64.gif" onerror="recoverError(this,'_64')"/>
  87. </td>
  88. <td>
  89. <xsl:if test="contains(@flags,'S')">
  90. <xsl:attribute name="class">flags</xsl:attribute>
  91. </xsl:if>
  92. <img alt="" src="{.}_ref_64.gif" onerror="recoverError(this,'_ref_64')"/>
  93. </td>
  94. </tr>
  95. </xsl:template>
  96. </xsl:stylesheet>