lfs-navigational.xsl 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns="http://www.w3.org/1999/xhtml"
  4. version="1.0">
  5. <!-- Dropping the HEAD links -->
  6. <xsl:template name="html.head">
  7. <head>
  8. <xsl:call-template name="system.head.content"/>
  9. <xsl:call-template name="head.content"/>
  10. <xsl:call-template name="user.head.content"/>
  11. </head>
  12. </xsl:template>
  13. <!-- Header Navigation-->
  14. <xsl:template name="header.navigation">
  15. <xsl:param name="prev" select="/foo"/>
  16. <xsl:param name="next" select="/foo"/>
  17. <xsl:param name="nav.context"/>
  18. <xsl:variable name="home" select="/*[1]"/>
  19. <xsl:variable name="up" select="parent::*"/>
  20. <xsl:variable name="row" select="count($prev) &gt; 0 or (count($up) &gt; 0
  21. and generate-id($up) != generate-id($home)) or count($next) &gt; 0"/>
  22. <xsl:if test="$row and $home != .">
  23. <div class="navheader">
  24. <xsl:if test="$home != .">
  25. <div class="headertitles">
  26. <h4>
  27. <xsl:apply-templates select="$home" mode="object.title.markup"/>
  28. <xsl:text> - </xsl:text>
  29. <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
  30. </h4>
  31. <xsl:if test="$up != $home">
  32. <h3>
  33. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  34. </h3>
  35. </xsl:if>
  36. </div>
  37. </xsl:if>
  38. <ul class="headerlinks">
  39. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  40. <li class="prev">
  41. <a accesskey="p">
  42. <xsl:attribute name="href">
  43. <xsl:call-template name="href.target">
  44. <xsl:with-param name="object" select="$prev"/>
  45. </xsl:call-template>
  46. </xsl:attribute>
  47. <xsl:attribute name="title">
  48. <xsl:value-of select="$prev/title"/>
  49. </xsl:attribute>
  50. <xsl:call-template name="navig.content">
  51. <xsl:with-param name="direction" select="'prev'"/>
  52. </xsl:call-template>
  53. </a>
  54. <p>
  55. <xsl:value-of select="$prev/title"/>
  56. </p>
  57. </li>
  58. </xsl:if>
  59. <xsl:if test="count($next)&gt;0">
  60. <li class="next">
  61. <a accesskey="n">
  62. <xsl:attribute name="href">
  63. <xsl:call-template name="href.target">
  64. <xsl:with-param name="object" select="$next"/>
  65. </xsl:call-template>
  66. </xsl:attribute>
  67. <xsl:attribute name="title">
  68. <xsl:choose>
  69. <xsl:when test="local-name($next)='index'">
  70. <xsl:call-template name="gentext">
  71. <xsl:with-param name="key">Index</xsl:with-param>
  72. </xsl:call-template>
  73. </xsl:when>
  74. <xsl:otherwise>
  75. <xsl:value-of select="$next/title"/>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:attribute>
  79. <xsl:call-template name="navig.content">
  80. <xsl:with-param name="direction" select="'next'"/>
  81. </xsl:call-template>
  82. </a>
  83. <p>
  84. <xsl:choose>
  85. <xsl:when test="local-name($next)='index'">
  86. <xsl:call-template name="gentext">
  87. <xsl:with-param name="key">Index</xsl:with-param>
  88. </xsl:call-template>
  89. </xsl:when>
  90. <xsl:otherwise>
  91. <xsl:value-of select="$next/title"/>
  92. </xsl:otherwise>
  93. </xsl:choose>
  94. </p>
  95. </li>
  96. </xsl:if>
  97. <li class="up">
  98. <xsl:if test="count($up)&gt;0 and $up != $home">
  99. <a accesskey="u">
  100. <xsl:attribute name="href">
  101. <xsl:call-template name="href.target">
  102. <xsl:with-param name="object" select="$up"/>
  103. </xsl:call-template>
  104. </xsl:attribute>
  105. <xsl:attribute name="title">
  106. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  107. </xsl:attribute>
  108. <xsl:call-template name="navig.content">
  109. <xsl:with-param name="direction" select="'up'"/>
  110. </xsl:call-template>
  111. </a>
  112. </xsl:if>
  113. <xsl:text>.</xsl:text>
  114. </li>
  115. <li class="home">
  116. <a accesskey="h">
  117. <xsl:attribute name="href">
  118. <xsl:call-template name="href.target">
  119. <xsl:with-param name="object" select="$home"/>
  120. </xsl:call-template>
  121. </xsl:attribute>
  122. <xsl:attribute name="title">
  123. <xsl:value-of select="$home/bookinfo/title"/>
  124. <xsl:text> - </xsl:text>
  125. <xsl:value-of select="$home/bookinfo/subtitle"/>
  126. </xsl:attribute>
  127. <xsl:call-template name="navig.content">
  128. <xsl:with-param name="direction" select="'home'"/>
  129. </xsl:call-template>
  130. </a>
  131. </li>
  132. </ul>
  133. </div>
  134. </xsl:if>
  135. </xsl:template>
  136. <!-- Footer Navigation-->
  137. <xsl:template name="footer.navigation">
  138. <xsl:param name="prev" select="/foo"/>
  139. <xsl:param name="next" select="/foo"/>
  140. <xsl:param name="nav.context"/>
  141. <xsl:variable name="home" select="/*[1]"/>
  142. <xsl:variable name="up" select="parent::*"/>
  143. <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
  144. or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
  145. <xsl:if test="$row">
  146. <div class="navfooter">
  147. <ul>
  148. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  149. <li class="prev">
  150. <a accesskey="p">
  151. <xsl:attribute name="href">
  152. <xsl:call-template name="href.target">
  153. <xsl:with-param name="object" select="$prev"/>
  154. </xsl:call-template>
  155. </xsl:attribute>
  156. <xsl:attribute name="title">
  157. <xsl:value-of select="$prev/title"/>
  158. </xsl:attribute>
  159. <xsl:call-template name="navig.content">
  160. <xsl:with-param name="direction" select="'prev'"/>
  161. </xsl:call-template>
  162. </a>
  163. <p>
  164. <xsl:value-of select="$prev/title"/>
  165. </p>
  166. </li>
  167. </xsl:if>
  168. <xsl:if test="count($next)&gt;0">
  169. <li class="next">
  170. <a accesskey="n">
  171. <xsl:attribute name="href">
  172. <xsl:call-template name="href.target">
  173. <xsl:with-param name="object" select="$next"/>
  174. </xsl:call-template>
  175. </xsl:attribute>
  176. <xsl:attribute name="title">
  177. <xsl:choose>
  178. <xsl:when test="local-name($next)='index'">
  179. <xsl:call-template name="gentext">
  180. <xsl:with-param name="key">Index</xsl:with-param>
  181. </xsl:call-template>
  182. </xsl:when>
  183. <xsl:otherwise>
  184. <xsl:value-of select="$next/title"/>
  185. </xsl:otherwise>
  186. </xsl:choose>
  187. </xsl:attribute>
  188. <xsl:call-template name="navig.content">
  189. <xsl:with-param name="direction" select="'next'"/>
  190. </xsl:call-template>
  191. </a>
  192. <p>
  193. <xsl:choose>
  194. <xsl:when test="local-name($next)='index'">
  195. <xsl:call-template name="gentext">
  196. <xsl:with-param name="key">Index</xsl:with-param>
  197. </xsl:call-template>
  198. </xsl:when>
  199. <xsl:otherwise>
  200. <xsl:value-of select="$next/title"/>
  201. </xsl:otherwise>
  202. </xsl:choose>
  203. </p>
  204. </li>
  205. </xsl:if>
  206. <li class="up">
  207. <xsl:if test="count($up)&gt;0 and $up != $home">
  208. <a accesskey="u">
  209. <xsl:attribute name="href">
  210. <xsl:call-template name="href.target">
  211. <xsl:with-param name="object" select="$up"/>
  212. </xsl:call-template>
  213. </xsl:attribute>
  214. <xsl:attribute name="title">
  215. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  216. </xsl:attribute>
  217. <xsl:call-template name="navig.content">
  218. <xsl:with-param name="direction" select="'up'"/>
  219. </xsl:call-template>
  220. </a>
  221. </xsl:if>
  222. <xsl:text>.</xsl:text>
  223. </li>
  224. <li class="home">
  225. <xsl:if test="$home != .">
  226. <a accesskey="h">
  227. <xsl:attribute name="href">
  228. <xsl:call-template name="href.target">
  229. <xsl:with-param name="object" select="$home"/>
  230. </xsl:call-template>
  231. </xsl:attribute>
  232. <xsl:attribute name="title">
  233. <xsl:value-of select="$home/bookinfo/title"/>
  234. <xsl:text> - </xsl:text>
  235. <xsl:value-of select="$home/bookinfo/subtitle"/>
  236. </xsl:attribute>
  237. <xsl:call-template name="navig.content">
  238. <xsl:with-param name="direction" select="'home'"/>
  239. </xsl:call-template>
  240. </a>
  241. </xsl:if>
  242. <xsl:text>.</xsl:text>
  243. </li>
  244. </ul>
  245. </div>
  246. </xsl:if>
  247. </xsl:template>
  248. </xsl:stylesheet>