lfs-navigational.xsl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns="http://www.w3.org/1999/xhtml"
  5. version="1.0">
  6. <!-- Dropping the HEAD links -->
  7. <xsl:template name="html.head">
  8. <head>
  9. <xsl:call-template name="system.head.content"/>
  10. <xsl:call-template name="head.content"/>
  11. <xsl:call-template name="user.head.content"/>
  12. </head>
  13. </xsl:template>
  14. <!-- Header Navigation-->
  15. <xsl:template name="header.navigation">
  16. <xsl:param name="prev" select="/foo"/>
  17. <xsl:param name="next" select="/foo"/>
  18. <xsl:param name="nav.context"/>
  19. <xsl:variable name="home" select="/*[1]"/>
  20. <xsl:variable name="up" select="parent::*"/>
  21. <xsl:variable name="row" select="count($prev) &gt; 0 or (count($up) &gt; 0
  22. and generate-id($up) != generate-id($home)) or count($next) &gt; 0"/>
  23. <xsl:if test="$row and $home != .">
  24. <div class="navheader">
  25. <xsl:if test="$home != .">
  26. <div class="headertitles">
  27. <p>
  28. <xsl:apply-templates select="$home" mode="object.title.markup"/>
  29. <xsl:text> - </xsl:text>
  30. <xsl:apply-templates select="$home" mode="object.subtitle.markup"/>
  31. </p>
  32. <xsl:if test="$up != $home">
  33. <p><b>
  34. <xsl:apply-templates select="$up" mode="object.title.markup"/>
  35. </b></p>
  36. </xsl:if>
  37. </div>
  38. </xsl:if>
  39. <ul class="headerlinks">
  40. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  41. <li class="prev">
  42. <a accesskey="p">
  43. <xsl:attribute name="href">
  44. <xsl:call-template name="href.target">
  45. <xsl:with-param name="object" select="$prev"/>
  46. </xsl:call-template>
  47. </xsl:attribute>
  48. <xsl:text>Prev</xsl:text>
  49. </a>
  50. </li>
  51. </xsl:if>
  52. <xsl:if test="count($next)&gt;0">
  53. <li class="next">
  54. <a accesskey="n">
  55. <xsl:attribute name="href">
  56. <xsl:call-template name="href.target">
  57. <xsl:with-param name="object" select="$next"/>
  58. </xsl:call-template>
  59. </xsl:attribute>
  60. <xsl:text>Next</xsl:text>
  61. </a>
  62. </li>
  63. <li class="home">
  64. <a accesskey="h">
  65. <xsl:attribute name="href">
  66. <xsl:call-template name="href.target">
  67. <xsl:with-param name="object" select="$home"/>
  68. </xsl:call-template>
  69. </xsl:attribute>
  70. <xsl:text>Home</xsl:text>
  71. </a>
  72. </li>
  73. </xsl:if>
  74. </ul>
  75. </div>
  76. </xsl:if>
  77. </xsl:template>
  78. <!-- Footer Navigation-->
  79. <xsl:template name="footer.navigation">
  80. <xsl:param name="prev" select="/foo"/>
  81. <xsl:param name="next" select="/foo"/>
  82. <xsl:param name="nav.context"/>
  83. <xsl:variable name="home" select="/*[1]"/>
  84. <xsl:variable name="up" select="parent::*"/>
  85. <xsl:variable name="row" select="count($prev) &gt; 0 or count($up) &gt; 0
  86. or count($next) &gt; 0 or generate-id($home) != generate-id(.)"/>
  87. <xsl:if test="$row">
  88. <div class="navfooter">
  89. <ul>
  90. <xsl:if test="count($prev)&gt;0 and $prev != $home">
  91. <li class="prev">
  92. <a accesskey="p">
  93. <xsl:attribute name="href">
  94. <xsl:call-template name="href.target">
  95. <xsl:with-param name="object" select="$prev"/>
  96. </xsl:call-template>
  97. </xsl:attribute>
  98. <xsl:text>Prev</xsl:text>
  99. </a>
  100. <p>
  101. <xsl:apply-templates select="$prev" mode="object.title.markup"/>
  102. </p>
  103. </li>
  104. </xsl:if>
  105. <xsl:if test="count($next)&gt;0">
  106. <li class="next">
  107. <a accesskey="n">
  108. <xsl:attribute name="href">
  109. <xsl:call-template name="href.target">
  110. <xsl:with-param name="object" select="$next"/>
  111. </xsl:call-template>
  112. </xsl:attribute>
  113. <xsl:text>Next</xsl:text>
  114. </a>
  115. <p>
  116. <xsl:apply-templates select="$next" mode="object.title.markup"/>
  117. </p>
  118. </li>
  119. </xsl:if>
  120. <xsl:if test="count($up)&gt;0 and $up != $home">
  121. <li class="up">
  122. <a accesskey="u">
  123. <xsl:attribute name="href">
  124. <xsl:call-template name="href.target">
  125. <xsl:with-param name="object" select="$up"/>
  126. </xsl:call-template>
  127. </xsl:attribute>
  128. <xsl:text>Up</xsl:text>
  129. </a>
  130. </li>
  131. </xsl:if>
  132. <xsl:if test="$home != .">
  133. <li class="home">
  134. <a accesskey="h">
  135. <xsl:attribute name="href">
  136. <xsl:call-template name="href.target">
  137. <xsl:with-param name="object" select="$home"/>
  138. </xsl:call-template>
  139. </xsl:attribute>
  140. <xsl:text>Home</xsl:text>
  141. </a>
  142. </li>
  143. </xsl:if>
  144. </ul>
  145. </div>
  146. </xsl:if>
  147. </xsl:template>
  148. </xsl:stylesheet>