subtitles.xsl 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
  4. exclude-result-prefixes="doc"
  5. version='1.0'>
  6. <!-- ********************************************************************
  7. $Id$
  8. ********************************************************************
  9. This file is part of the XSL DocBook Stylesheet distribution.
  10. See ../README or http://docbook.sf.net/release/xsl/current/ for
  11. copyright and other information.
  12. ******************************************************************** -->
  13. <!-- ==================================================================== -->
  14. <!-- subtitle markup -->
  15. <doc:mode mode="subtitle.markup" xmlns="">
  16. <refpurpose>Provides access to element subtitles</refpurpose>
  17. <refdescription id="subtitle.markup-desc">
  18. <para>Processing an element in the
  19. <literal role="mode">subtitle.markup</literal> mode produces the
  20. subtitle of the element.
  21. </para>
  22. </refdescription>
  23. </doc:mode>
  24. <xsl:template match="*" mode="subtitle.markup">
  25. <xsl:message>
  26. <xsl:text>Request for subtitle of unexpected element: </xsl:text>
  27. <xsl:value-of select="local-name(.)"/>
  28. </xsl:message>
  29. <xsl:text>???SUBTITLE???</xsl:text>
  30. </xsl:template>
  31. <xsl:template match="subtitle" mode="subtitle.markup">
  32. <xsl:param name="allow-anchors" select="'0'"/>
  33. <xsl:apply-templates/>
  34. </xsl:template>
  35. <xsl:template match="set" mode="subtitle.markup">
  36. <xsl:param name="allow-anchors" select="'0'"/>
  37. <xsl:apply-templates select="(setinfo/subtitle|info/subtitle|subtitle)[1]"
  38. mode="subtitle.markup">
  39. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  40. </xsl:apply-templates>
  41. </xsl:template>
  42. <xsl:template match="book" mode="subtitle.markup">
  43. <xsl:param name="allow-anchors" select="'0'"/>
  44. <xsl:apply-templates select="(bookinfo/subtitle|info/subtitle|subtitle)[1]"
  45. mode="subtitle.markup">
  46. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  47. </xsl:apply-templates>
  48. </xsl:template>
  49. <xsl:template match="part" mode="subtitle.markup">
  50. <xsl:param name="allow-anchors" select="'0'"/>
  51. <xsl:apply-templates select="(partinfo/subtitle
  52. |docinfo/subtitle
  53. |info/subtitle
  54. |subtitle)[1]"
  55. mode="subtitle.markup">
  56. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  57. </xsl:apply-templates>
  58. </xsl:template>
  59. <xsl:template match="preface|chapter|appendix" mode="subtitle.markup">
  60. <xsl:param name="allow-anchors" select="'0'"/>
  61. <xsl:apply-templates select="(docinfo/subtitle
  62. |info/subtitle
  63. |prefaceinfo/subtitle
  64. |chapterinfo/subtitle
  65. |appendixinfo/subtitle
  66. |subtitle)[1]"
  67. mode="subtitle.markup">
  68. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  69. </xsl:apply-templates>
  70. </xsl:template>
  71. <xsl:template match="article" mode="subtitle.markup">
  72. <xsl:param name="allow-anchors" select="'0'"/>
  73. <xsl:apply-templates select="(artheader/subtitle
  74. |articleinfo/subtitle
  75. |info/subtitle
  76. |subtitle)[1]"
  77. mode="subtitle.markup">
  78. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  79. </xsl:apply-templates>
  80. </xsl:template>
  81. <xsl:template match="dedication|colophon" mode="subtitle.markup">
  82. <xsl:param name="allow-anchors" select="'0'"/>
  83. <xsl:apply-templates select="(subtitle|info/subtitle)[1]"
  84. mode="subtitle.markup">
  85. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  86. </xsl:apply-templates>
  87. </xsl:template>
  88. <xsl:template match="reference" mode="subtitle.markup">
  89. <xsl:param name="allow-anchors" select="'0'"/>
  90. <xsl:apply-templates select="(referenceinfo/subtitle
  91. |docinfo/subtitle
  92. |info/subtitle
  93. |subtitle)[1]"
  94. mode="subtitle.markup">
  95. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  96. </xsl:apply-templates>
  97. </xsl:template>
  98. <xsl:template match="qandaset" mode="subtitle.markup">
  99. <xsl:param name="allow-anchors" select="'0'"/>
  100. <xsl:apply-templates select="(blockinfo/subtitle|info/subtitle)[1]"
  101. mode="subtitle.markup">
  102. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  103. </xsl:apply-templates>
  104. </xsl:template>
  105. <xsl:template match="refentry" mode="subtitle.markup">
  106. <xsl:param name="allow-anchors" select="'0'"/>
  107. <xsl:apply-templates select="(refentryinfo/subtitle
  108. |info/subtitle
  109. |docinfo/subtitle)[1]"
  110. mode="subtitle.markup">
  111. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  112. </xsl:apply-templates>
  113. </xsl:template>
  114. <xsl:template match="section
  115. |sect1|sect2|sect3|sect4|sect5
  116. |refsect1|refsect2|refsect3
  117. |simplesect"
  118. mode="subtitle.markup">
  119. <xsl:param name="allow-anchors" select="'0'"/>
  120. <xsl:apply-templates select="(info/subtitle
  121. |sectioninfo/subtitle
  122. |sect1info/subtitle
  123. |sect2info/subtitle
  124. |sect3info/subtitle
  125. |sect4info/subtitle
  126. |sect5info/subtitle
  127. |refsect1info/subtitle
  128. |refsect2info/subtitle
  129. |refsect3info/subtitle
  130. |subtitle)[1]"
  131. mode="subtitle.markup">
  132. <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  133. </xsl:apply-templates>
  134. </xsl:template>
  135. </xsl:stylesheet>