html5-chunk-mods.xsl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:exsl="http://exslt.org/common"
  5. xmlns="http://www.w3.org/1999/xhtml"
  6. exclude-result-prefixes="exsl"
  7. version="1.0">
  8. <!-- $Id: html5-chunk-mods.xsl,v 1.1 2011-09-16 21:44:00 bobs Exp $ -->
  9. <!-- call HTML5 header and footer templates for navigation -->
  10. <xsl:template name="chunk-element-content">
  11. <xsl:param name="prev"/>
  12. <xsl:param name="next"/>
  13. <xsl:param name="nav.context"/>
  14. <xsl:param name="content">
  15. <xsl:apply-imports/>
  16. </xsl:param>
  17. <xsl:call-template name="user.preroot"/>
  18. <html>
  19. <xsl:call-template name="root.attributes"/>
  20. <xsl:call-template name="html.head">
  21. <xsl:with-param name="prev" select="$prev"/>
  22. <xsl:with-param name="next" select="$next"/>
  23. </xsl:call-template>
  24. <body>
  25. <xsl:call-template name="body.attributes"/>
  26. <xsl:call-template name="html5.header.navigation">
  27. <xsl:with-param name="prev" select="$prev"/>
  28. <xsl:with-param name="next" select="$next"/>
  29. <xsl:with-param name="nav.context" select="$nav.context"/>
  30. </xsl:call-template>
  31. <xsl:call-template name="user.header.content"/>
  32. <xsl:copy-of select="$content"/>
  33. <xsl:call-template name="user.footer.content"/>
  34. <xsl:call-template name="html5.footer.navigation">
  35. <xsl:with-param name="prev" select="$prev"/>
  36. <xsl:with-param name="next" select="$next"/>
  37. <xsl:with-param name="nav.context" select="$nav.context"/>
  38. </xsl:call-template>
  39. </body>
  40. </html>
  41. <xsl:value-of select="$chunk.append"/>
  42. </xsl:template>
  43. <!-- Add HTML5 <header> wrapper, and convert some attributes to styles -->
  44. <xsl:template name="html5.header.navigation">
  45. <xsl:param name="prev" select="/foo"/>
  46. <xsl:param name="next" select="/foo"/>
  47. <xsl:param name="nav.context"/>
  48. <xsl:variable name="content">
  49. <header>
  50. <xsl:call-template name="user.header.navigation">
  51. <xsl:with-param name="prev" select="$prev"/>
  52. <xsl:with-param name="next" select="$next"/>
  53. <xsl:with-param name="nav.context" select="$nav.context"/>
  54. </xsl:call-template>
  55. <xsl:call-template name="header.navigation">
  56. <xsl:with-param name="prev" select="$prev"/>
  57. <xsl:with-param name="next" select="$next"/>
  58. <xsl:with-param name="nav.context" select="$nav.context"/>
  59. </xsl:call-template>
  60. </header>
  61. </xsl:variable>
  62. <!-- And fix up any style atts -->
  63. <xsl:call-template name="convert.styles">
  64. <xsl:with-param name="content" select="$content"/>
  65. </xsl:call-template>
  66. </xsl:template>
  67. <!-- Add HTML5 <footer> wrapper, and convert some attributes to styles -->
  68. <xsl:template name="html5.footer.navigation">
  69. <xsl:param name="prev" select="/foo"/>
  70. <xsl:param name="next" select="/foo"/>
  71. <xsl:param name="nav.context"/>
  72. <xsl:variable name="content">
  73. <footer>
  74. <xsl:call-template name="user.footer.navigation">
  75. <xsl:with-param name="prev" select="$prev"/>
  76. <xsl:with-param name="next" select="$next"/>
  77. <xsl:with-param name="nav.context" select="$nav.context"/>
  78. </xsl:call-template>
  79. <xsl:call-template name="footer.navigation">
  80. <xsl:with-param name="prev" select="$prev"/>
  81. <xsl:with-param name="next" select="$next"/>
  82. <xsl:with-param name="nav.context" select="$nav.context"/>
  83. </xsl:call-template>
  84. </footer>
  85. </xsl:variable>
  86. <!-- And fix up any style atts -->
  87. <xsl:call-template name="convert.styles">
  88. <xsl:with-param name="content" select="$content"/>
  89. </xsl:call-template>
  90. </xsl:template>
  91. </xsl:stylesheet>