lfs-sections.xsl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <xsl:param name="chunk.first.sections" select="1"/>
  9. <!-- sect1:
  10. When there is a role attibute, use it as the class value.
  11. Removed unused code. -->
  12. <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
  13. <xsl:template match="sect1">
  14. <div>
  15. <xsl:choose>
  16. <xsl:when test="@role">
  17. <xsl:attribute name="class">
  18. <xsl:value-of select="@role"/>
  19. </xsl:attribute>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <xsl:apply-templates select="." mode="class.attribute"/>
  23. </xsl:otherwise>
  24. </xsl:choose>
  25. <xsl:call-template name="language.attribute"/>
  26. <xsl:call-template name="sect1.titlepage"/>
  27. <xsl:apply-templates/>
  28. <xsl:call-template name="process.chunk.footnotes"/>
  29. </div>
  30. </xsl:template>
  31. <!-- sect2:
  32. When there is a role attibute, use it as the class value.
  33. Removed unused code. -->
  34. <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
  35. <xsl:template match="sect2">
  36. <div>
  37. <xsl:choose>
  38. <xsl:when test="@role">
  39. <xsl:attribute name="class">
  40. <xsl:value-of select="@role"/>
  41. </xsl:attribute>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <xsl:attribute name="class">
  45. <xsl:value-of select="name(.)"/>
  46. </xsl:attribute>
  47. </xsl:otherwise>
  48. </xsl:choose>
  49. <xsl:call-template name="language.attribute"/>
  50. <xsl:call-template name="sect2.titlepage"/>
  51. <xsl:apply-templates/>
  52. <xsl:call-template name="process.chunk.footnotes"/>
  53. </div>
  54. </xsl:template>
  55. </xsl:stylesheet>