tabular.xsl 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:html='http://www.w3.org/1999/xhtml'
  4. xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
  5. exclude-result-prefixes="html doc"
  6. version="1.0">
  7. <xsl:import href="website-common.xsl"/>
  8. <xsl:include href="toc-tabular.xsl"/>
  9. <xsl:output method="html"
  10. indent="no"
  11. doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
  12. doctype-system="http://www.w3.org/TR/html4/loose.dtd"
  13. />
  14. <xsl:param name="autolayout" select="document($autolayout-file, /*)"/>
  15. <!-- ==================================================================== -->
  16. <!-- Netscape gets badly confused if it sees a CSS style... -->
  17. <xsl:param name="admon.style" select="''"/>
  18. <xsl:param name="admon.graphics" select="1"/>
  19. <xsl:param name="admon.graphics.path">graphics/</xsl:param>
  20. <xsl:param name="admon.graphics.extension">.gif</xsl:param>
  21. <xsl:attribute-set name="table.properties">
  22. <xsl:attribute name="border">0</xsl:attribute>
  23. <xsl:attribute name="cellpadding">0</xsl:attribute>
  24. <xsl:attribute name="cellspacing">0</xsl:attribute>
  25. <xsl:attribute name="width">100%</xsl:attribute>
  26. </xsl:attribute-set>
  27. <xsl:attribute-set name="table.navigation.cell.properties">
  28. <xsl:attribute name="valign">top</xsl:attribute>
  29. <xsl:attribute name="align">left</xsl:attribute>
  30. <!-- width is set with $navotocwidth -->
  31. <xsl:attribute name="bgcolor">
  32. <xsl:choose>
  33. <xsl:when test="/webpage/config[@param='navbgcolor']/@value[. != '']">
  34. <xsl:value-of select="/webpage/config[@param='navbgcolor']/@value"/>
  35. </xsl:when>
  36. <xsl:when test="$autolayout/autolayout/config[@param='navbgcolor']/@value[. != '']">
  37. <xsl:value-of select="$autolayout/autolayout/config[@param='navbgcolor']/@value"/>
  38. </xsl:when>
  39. <xsl:otherwise>
  40. <xsl:value-of select="$navbgcolor"/>
  41. </xsl:otherwise>
  42. </xsl:choose>
  43. </xsl:attribute>
  44. </xsl:attribute-set>
  45. <xsl:attribute-set name="table.body.cell.properties">
  46. <xsl:attribute name="valign">top</xsl:attribute>
  47. <xsl:attribute name="align">left</xsl:attribute>
  48. <!-- width is set with $navobodywidth -->
  49. <xsl:attribute name="bgcolor">
  50. <xsl:value-of select="$textbgcolor"/>
  51. </xsl:attribute>
  52. </xsl:attribute-set>
  53. <xsl:param name="body.columns" select="2"/>
  54. <!-- ==================================================================== -->
  55. <xsl:template match="/">
  56. <xsl:apply-templates/>
  57. </xsl:template>
  58. <xsl:template name="home.navhead">
  59. <xsl:text>Navhead</xsl:text>
  60. </xsl:template>
  61. <xsl:template name="home.navhead.upperright">
  62. <xsl:text>Upper-right</xsl:text>
  63. </xsl:template>
  64. <xsl:template name="home.navhead.cell">
  65. <td width="50%" valign="middle" align="left">
  66. <xsl:call-template name="home.navhead"/>
  67. </td>
  68. </xsl:template>
  69. <xsl:template name="home.navhead.upperright.cell">
  70. <td width="50%" valign="middle" align="right">
  71. <xsl:call-template name="home.navhead.upperright"/>
  72. </td>
  73. </xsl:template>
  74. <xsl:template name="home.navhead.separator">
  75. <hr/>
  76. </xsl:template>
  77. <xsl:template match="webpage">
  78. <xsl:variable name="id">
  79. <xsl:call-template name="object.id"/>
  80. </xsl:variable>
  81. <xsl:variable name="relpath">
  82. <xsl:call-template name="root-rel-path">
  83. <xsl:with-param name="webpage" select="."/>
  84. </xsl:call-template>
  85. </xsl:variable>
  86. <xsl:variable name="tocentry" select="$autolayout/autolayout//*[$id=@id]"/>
  87. <xsl:variable name="toc" select="($tocentry/ancestor-or-self::toc
  88. |$autolayout/autolayout/toc[1])[last()]"/>
  89. <html>
  90. <xsl:apply-templates select="head" mode="head.mode"/>
  91. <xsl:apply-templates select="config" mode="head.mode"/>
  92. <body class="tabular">
  93. <xsl:call-template name="body.attributes"/>
  94. <div class="{name(.)}">
  95. <a name="{$id}"/>
  96. <xsl:call-template name="allpages.banner"/>
  97. <table xsl:use-attribute-sets="table.properties" border="0">
  98. <xsl:if test="$nav.table.summary!=''">
  99. <xsl:attribute name="summary">
  100. <xsl:value-of select="normalize-space($nav.table.summary)"/>
  101. </xsl:attribute>
  102. </xsl:if>
  103. <tr>
  104. <td xsl:use-attribute-sets="table.navigation.cell.properties">
  105. <img src="{$relpath}{$table.spacer.image}" alt=" " width="1" height="1"/>
  106. </td>
  107. <xsl:call-template name="hspacer">
  108. <xsl:with-param name="vspacer" select="1"/>
  109. </xsl:call-template>
  110. <td rowspan="2" xsl:use-attribute-sets="table.body.cell.properties">
  111. <xsl:if test="$navbodywidth != ''">
  112. <xsl:attribute name="width">
  113. <xsl:value-of select="$navbodywidth"/>
  114. </xsl:attribute>
  115. </xsl:if>
  116. <xsl:if test="$autolayout/autolayout/toc[1]/@id = $id">
  117. <table border="0" summary="home page extra headers"
  118. cellpadding="0" cellspacing="0" width="100%">
  119. <tr>
  120. <xsl:call-template name="home.navhead.cell"/>
  121. <xsl:call-template name="home.navhead.upperright.cell"/>
  122. </tr>
  123. </table>
  124. <xsl:call-template name="home.navhead.separator"/>
  125. </xsl:if>
  126. <xsl:if test="$autolayout/autolayout/toc[1]/@id != $id
  127. or $suppress.homepage.title = 0">
  128. <xsl:apply-templates select="./head/title" mode="title.mode"/>
  129. </xsl:if>
  130. <xsl:apply-templates select="child::node()[not(self::webpage)]"/>
  131. <xsl:call-template name="process.footnotes"/>
  132. <br/>
  133. </td>
  134. </tr>
  135. <tr>
  136. <td xsl:use-attribute-sets="table.navigation.cell.properties">
  137. <xsl:if test="$navtocwidth != ''">
  138. <xsl:attribute name="width">
  139. <xsl:choose>
  140. <xsl:when test="/webpage/config[@param='navtocwidth']/@value[. != '']">
  141. <xsl:value-of select="/webpage/config[@param='navtocwidth']/@value"/>
  142. </xsl:when>
  143. <xsl:when test="$autolayout/autolayout/config[@param='navtocwidth']/@value[. != '']">
  144. <xsl:value-of select="$autolayout/autolayout/config[@param='navtocwidth']/@value"/>
  145. </xsl:when>
  146. <xsl:otherwise>
  147. <xsl:value-of select="$navtocwidth"/>
  148. </xsl:otherwise>
  149. </xsl:choose>
  150. </xsl:attribute>
  151. </xsl:if>
  152. <xsl:choose>
  153. <xsl:when test="$toc">
  154. <p class="navtoc">
  155. <xsl:apply-templates select="$toc">
  156. <xsl:with-param name="pageid" select="@id"/>
  157. </xsl:apply-templates>
  158. </p>
  159. </xsl:when>
  160. <xsl:otherwise>&#160;</xsl:otherwise>
  161. </xsl:choose>
  162. </td>
  163. <xsl:call-template name="hspacer"/>
  164. </tr>
  165. <xsl:call-template name="webpage.table.footer"/>
  166. </table>
  167. <xsl:call-template name="webpage.footer"/>
  168. </div>
  169. </body>
  170. </html>
  171. </xsl:template>
  172. <xsl:template name="hspacer">
  173. <xsl:param name="vspacer" select="0"/>
  174. <!-- nop -->
  175. </xsl:template>
  176. <xsl:template match="config[@param='filename']" mode="head.mode">
  177. </xsl:template>
  178. <xsl:template match="webtoc">
  179. <!-- nop -->
  180. </xsl:template>
  181. </xsl:stylesheet>