lfs-navigational.xsl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. <p>
  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. </p>
  31. <xsl:if test="$up != $home">
  32. <p><b>
  33. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  34. </b></p>
  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:text>Prev</xsl:text>
  48. </a>
  49. </li>
  50. </xsl:if>
  51. <xsl:if test="count($next)&gt;0">
  52. <li class="next">
  53. <a accesskey="n">
  54. <xsl:attribute name="href">
  55. <xsl:call-template name="href.target">
  56. <xsl:with-param name="object" select="$next"/>
  57. </xsl:call-template>
  58. </xsl:attribute>
  59. <xsl:text>Next</xsl:text>
  60. </a>
  61. </li>
  62. </xsl:if>
  63. <xsl:if test="count($up)&gt;0 and $up != $home">
  64. <li class="up">
  65. <a accesskey="u">
  66. <xsl:attribute name="href">
  67. <xsl:call-template name="href.target">
  68. <xsl:with-param name="object" select="$up"/>
  69. </xsl:call-template>
  70. </xsl:attribute>
  71. <xsl:text>Up</xsl:text>
  72. </a>
  73. </li>
  74. </xsl:if>
  75. <li class="home">
  76. <a accesskey="h">
  77. <xsl:attribute name="href">
  78. <xsl:call-template name="href.target">
  79. <xsl:with-param name="object" select="$home"/>
  80. </xsl:call-template>
  81. </xsl:attribute>
  82. <xsl:text>Home</xsl:text>
  83. </a>
  84. </li>
  85. </ul>
  86. </div>
  87. </xsl:if>
  88. </xsl:template>
  89. <!-- Footer Navigation-->
  90. <xsl:template name="footer.navigation">
  91. <xsl:param name="prev" select="/foo"/>
  92. <xsl:param name="next" select="/foo"/>
  93. <xsl:param name="nav.context"/>
  94. <xsl:variable name="home" select="/*[1]"/>
  95. <xsl:variable name="up" select="parent::*"/>
  96. <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
  97. or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
  98. <xsl:if test="$row">
  99. <div class="navfooter">
  100. <ul>
  101. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  102. <li class="prev">
  103. <a accesskey="p">
  104. <xsl:attribute name="href">
  105. <xsl:call-template name="href.target">
  106. <xsl:with-param name="object" select="$prev"/>
  107. </xsl:call-template>
  108. </xsl:attribute>
  109. <xsl:text>Prev</xsl:text>
  110. </a>
  111. <p>
  112. <xsl:apply-templates select="$prev" mode="object.title.markup"/>
  113. </p>
  114. </li>
  115. </xsl:if>
  116. <xsl:if test="count($next)&gt;0">
  117. <li class="next">
  118. <a accesskey="n">
  119. <xsl:attribute name="href">
  120. <xsl:call-template name="href.target">
  121. <xsl:with-param name="object" select="$next"/>
  122. </xsl:call-template>
  123. </xsl:attribute>
  124. <xsl:text>Next</xsl:text>
  125. </a>
  126. <p>
  127. <xsl:apply-templates select="$next" mode="object.title.markup"/>
  128. </p>
  129. </li>
  130. </xsl:if>
  131. <xsl:if test="count($up)&gt;0 and $up != $home">
  132. <li class="up">
  133. <a accesskey="u">
  134. <xsl:attribute name="href">
  135. <xsl:call-template name="href.target">
  136. <xsl:with-param name="object" select="$up"/>
  137. </xsl:call-template>
  138. </xsl:attribute>
  139. <xsl:text>Up</xsl:text>
  140. </a>
  141. </li>
  142. </xsl:if>
  143. <xsl:if test="$home != .">
  144. <li class="home">
  145. <a accesskey="h">
  146. <xsl:attribute name="href">
  147. <xsl:call-template name="href.target">
  148. <xsl:with-param name="object" select="$home"/>
  149. </xsl:call-template>
  150. </xsl:attribute>
  151. <xsl:text>Home</xsl:text>
  152. </a>
  153. </li>
  154. </xsl:if>
  155. </ul>
  156. </div>
  157. </xsl:if>
  158. </xsl:template>
  159. </xsl:stylesheet>