lfs-navigational.xsl 7.9 KB

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