lfs-navigational.xsl 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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:value-of select="$next/title"/>
  69. </xsl:attribute>
  70. <xsl:call-template name="navig.content">
  71. <xsl:with-param name="direction" select="'next'"/>
  72. </xsl:call-template>
  73. </a>
  74. <p>
  75. <xsl:value-of select="$next/title"/>
  76. </p>
  77. </li>
  78. </xsl:if>
  79. <li class="up">
  80. <xsl:if test="count($up)&gt;0 and $up != $home">
  81. <a accesskey="u">
  82. <xsl:attribute name="href">
  83. <xsl:call-template name="href.target">
  84. <xsl:with-param name="object" select="$up"/>
  85. </xsl:call-template>
  86. </xsl:attribute>
  87. <xsl:attribute name="title">
  88. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  89. </xsl:attribute>
  90. <xsl:call-template name="navig.content">
  91. <xsl:with-param name="direction" select="'up'"/>
  92. </xsl:call-template>
  93. </a>
  94. </xsl:if>
  95. <xsl:text>.</xsl:text>
  96. </li>
  97. <li class="home">
  98. <a accesskey="h">
  99. <xsl:attribute name="href">
  100. <xsl:call-template name="href.target">
  101. <xsl:with-param name="object" select="$home"/>
  102. </xsl:call-template>
  103. </xsl:attribute>
  104. <xsl:attribute name="title">
  105. <xsl:value-of select="$home/bookinfo/title"/>
  106. <xsl:text> - </xsl:text>
  107. <xsl:value-of select="$home/bookinfo/subtitle"/>
  108. </xsl:attribute>
  109. <xsl:call-template name="navig.content">
  110. <xsl:with-param name="direction" select="'home'"/>
  111. </xsl:call-template>
  112. </a>
  113. </li>
  114. </ul>
  115. </div>
  116. </xsl:if>
  117. </xsl:template>
  118. <!-- Footer Navigation-->
  119. <xsl:template name="footer.navigation">
  120. <xsl:param name="prev" select="/foo"/>
  121. <xsl:param name="next" select="/foo"/>
  122. <xsl:param name="nav.context"/>
  123. <xsl:variable name="home" select="/*[1]"/>
  124. <xsl:variable name="up" select="parent::*"/>
  125. <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
  126. or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
  127. <xsl:if test="$row">
  128. <div class="navfooter">
  129. <ul>
  130. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  131. <li class="prev">
  132. <a accesskey="p">
  133. <xsl:attribute name="href">
  134. <xsl:call-template name="href.target">
  135. <xsl:with-param name="object" select="$prev"/>
  136. </xsl:call-template>
  137. </xsl:attribute>
  138. <xsl:attribute name="title">
  139. <xsl:value-of select="$prev/title"/>
  140. </xsl:attribute>
  141. <xsl:call-template name="navig.content">
  142. <xsl:with-param name="direction" select="'prev'"/>
  143. </xsl:call-template>
  144. </a>
  145. <p>
  146. <xsl:value-of select="$prev/title"/>
  147. </p>
  148. </li>
  149. </xsl:if>
  150. <xsl:if test="count($next)&gt;0">
  151. <li class="next">
  152. <a accesskey="n">
  153. <xsl:attribute name="href">
  154. <xsl:call-template name="href.target">
  155. <xsl:with-param name="object" select="$next"/>
  156. </xsl:call-template>
  157. </xsl:attribute>
  158. <xsl:attribute name="title">
  159. <xsl:value-of select="$next/title"/>
  160. </xsl:attribute>
  161. <xsl:call-template name="navig.content">
  162. <xsl:with-param name="direction" select="'next'"/>
  163. </xsl:call-template>
  164. </a>
  165. <p>
  166. <xsl:value-of select="$next/title"/>
  167. </p>
  168. </li>
  169. </xsl:if>
  170. <li class="up">
  171. <xsl:if test="count($up)&gt;0 and $up != $home">
  172. <a accesskey="u">
  173. <xsl:attribute name="href">
  174. <xsl:call-template name="href.target">
  175. <xsl:with-param name="object" select="$up"/>
  176. </xsl:call-template>
  177. </xsl:attribute>
  178. <xsl:attribute name="title">
  179. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  180. </xsl:attribute>
  181. <xsl:call-template name="navig.content">
  182. <xsl:with-param name="direction" select="'up'"/>
  183. </xsl:call-template>
  184. </a>
  185. </xsl:if>
  186. <xsl:text>.</xsl:text>
  187. </li>
  188. <li class="home">
  189. <xsl:if test="$home != .">
  190. <a accesskey="h">
  191. <xsl:attribute name="href">
  192. <xsl:call-template name="href.target">
  193. <xsl:with-param name="object" select="$home"/>
  194. </xsl:call-template>
  195. </xsl:attribute>
  196. <xsl:attribute name="title">
  197. <xsl:value-of select="$home/bookinfo/title"/>
  198. <xsl:text> - </xsl:text>
  199. <xsl:value-of select="$home/bookinfo/subtitle"/>
  200. </xsl:attribute>
  201. <xsl:call-template name="navig.content">
  202. <xsl:with-param name="direction" select="'home'"/>
  203. </xsl:call-template>
  204. </a>
  205. </xsl:if>
  206. <xsl:text>.</xsl:text>
  207. </li>
  208. </ul>
  209. </div>
  210. </xsl:if>
  211. </xsl:template>
  212. </xsl:stylesheet>