lfs-sections.xsl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. <!-- This stylesheet controls how sections are handled -->
  6. <!-- Chunk the first top-level section? 1 = yes, 0 = no
  7. If chapters TOC are generated, this must be 1.
  8. See also sect1.titlepage template in lfs-titles.xsl -->
  9. <xsl:param name="chunk.first.sections" select="1"></xsl:param>
  10. <!-- sect1:
  11. When there is a role attibute, use it as the class value.
  12. Removed unused code. -->
  13. <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
  14. <xsl:template match="sect1">
  15. <div>
  16. <xsl:choose>
  17. <xsl:when test="@role">
  18. <xsl:attribute name="class">
  19. <xsl:value-of select="@role"/>
  20. </xsl:attribute>
  21. </xsl:when>
  22. <xsl:otherwise>
  23. <xsl:apply-templates select="." mode="class.attribute"/>
  24. </xsl:otherwise>
  25. </xsl:choose>
  26. <xsl:call-template name="language.attribute"/>
  27. <xsl:call-template name="sect1.titlepage"/>
  28. <xsl:apply-templates/>
  29. <xsl:call-template name="process.chunk.footnotes"/>
  30. </div>
  31. </xsl:template>
  32. <!-- sect2:
  33. When there is a role attibute, use it as the class value.
  34. Removed unused code. -->
  35. <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
  36. <xsl:template match="sect2">
  37. <div>
  38. <xsl:choose>
  39. <xsl:when test="@role">
  40. <xsl:attribute name="class">
  41. <xsl:value-of select="@role"/>
  42. </xsl:attribute>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:attribute name="class">
  46. <xsl:value-of select="name(.)"/>
  47. </xsl:attribute>
  48. </xsl:otherwise>
  49. </xsl:choose>
  50. <xsl:call-template name="language.attribute"/>
  51. <xsl:call-template name="sect2.titlepage"/>
  52. <xsl:apply-templates/>
  53. <xsl:call-template name="process.chunk.footnotes"/>
  54. </div>
  55. </xsl:template>
  56. </xsl:stylesheet>