plain-titlepage.xsl 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
  3. <!-- This stylesheet was created by template/titlepage.xsl-->
  4. <xsl:template name="slides.titlepage.recto">
  5. <xsl:choose>
  6. <xsl:when test="slidesinfo/title">
  7. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/title"/>
  8. </xsl:when>
  9. <xsl:when test="docinfo/title">
  10. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/title"/>
  11. </xsl:when>
  12. <xsl:when test="info/title">
  13. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/title"/>
  14. </xsl:when>
  15. <xsl:when test="title">
  16. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="title"/>
  17. </xsl:when>
  18. </xsl:choose>
  19. <xsl:choose>
  20. <xsl:when test="slidesinfo/subtitle">
  21. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/subtitle"/>
  22. </xsl:when>
  23. <xsl:when test="docinfo/subtitle">
  24. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
  25. </xsl:when>
  26. <xsl:when test="info/subtitle">
  27. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/subtitle"/>
  28. </xsl:when>
  29. <xsl:when test="subtitle">
  30. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="subtitle"/>
  31. </xsl:when>
  32. </xsl:choose>
  33. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/corpauthor"/>
  34. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
  35. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/corpauthor"/>
  36. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/authorgroup"/>
  37. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
  38. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/authorgroup"/>
  39. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/author"/>
  40. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/author"/>
  41. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/author"/>
  42. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="slidesinfo/pubdate"/>
  43. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
  44. <xsl:apply-templates mode="slides.titlepage.recto.auto.mode" select="info/pubdate"/>
  45. </xsl:template>
  46. <xsl:template name="slides.titlepage.verso">
  47. </xsl:template>
  48. <xsl:template name="slides.titlepage.separator">
  49. </xsl:template>
  50. <xsl:template name="slides.titlepage.before.recto">
  51. </xsl:template>
  52. <xsl:template name="slides.titlepage.before.verso">
  53. </xsl:template>
  54. <xsl:template name="slides.titlepage">
  55. <block>
  56. <xsl:variable name="recto.content">
  57. <xsl:call-template name="slides.titlepage.before.recto"/>
  58. <xsl:call-template name="slides.titlepage.recto"/>
  59. </xsl:variable>
  60. <xsl:variable name="recto.elements.count">
  61. <xsl:choose>
  62. <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
  63. <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
  64. <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
  65. <xsl:otherwise>1</xsl:otherwise>
  66. </xsl:choose>
  67. </xsl:variable>
  68. <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
  69. <block><xsl:copy-of select="$recto.content"/></block>
  70. </xsl:if>
  71. <xsl:variable name="verso.content">
  72. <xsl:call-template name="slides.titlepage.before.verso"/>
  73. <xsl:call-template name="slides.titlepage.verso"/>
  74. </xsl:variable>
  75. <xsl:variable name="verso.elements.count">
  76. <xsl:choose>
  77. <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
  78. <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
  79. <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
  80. <xsl:otherwise>1</xsl:otherwise>
  81. </xsl:choose>
  82. </xsl:variable>
  83. <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
  84. <block><xsl:copy-of select="$verso.content"/></block>
  85. </xsl:if>
  86. <xsl:call-template name="slides.titlepage.separator"/>
  87. </block>
  88. </xsl:template>
  89. <xsl:template match="*" mode="slides.titlepage.recto.mode">
  90. <!-- if an element isn't found in this mode, -->
  91. <!-- try the generic titlepage.mode -->
  92. <xsl:apply-templates select="." mode="titlepage.mode"/>
  93. </xsl:template>
  94. <xsl:template match="*" mode="slides.titlepage.verso.mode">
  95. <!-- if an element isn't found in this mode, -->
  96. <!-- try the generic titlepage.mode -->
  97. <xsl:apply-templates select="." mode="titlepage.mode"/>
  98. </xsl:template>
  99. <xsl:template match="title" mode="slides.titlepage.recto.auto.mode">
  100. <block xsl:use-attribute-sets="slides.titlepage.title.properties">
  101. <xsl:call-template name="presentation.title">
  102. </xsl:call-template>
  103. </block>
  104. </xsl:template>
  105. <xsl:template match="subtitle" mode="slides.titlepage.recto.auto.mode">
  106. <block xsl:use-attribute-sets="slides.titlepage.subtitle.properties">
  107. <xsl:apply-templates select="." mode="slides.titlepage.recto.mode"/>
  108. </block>
  109. </xsl:template>
  110. <xsl:template match="corpauthor" mode="slides.titlepage.recto.auto.mode">
  111. <block xsl:use-attribute-sets="slides.titlepage.corpauthor.properties">
  112. <xsl:apply-templates select="." mode="slides.titlepage.recto.mode"/>
  113. </block>
  114. </xsl:template>
  115. <xsl:template match="authorgroup" mode="slides.titlepage.recto.auto.mode">
  116. <block xsl:use-attribute-sets="slides.titlepage.authorgroup.properties">
  117. <xsl:apply-templates select="." mode="slides.titlepage.recto.mode"/>
  118. </block>
  119. </xsl:template>
  120. <xsl:template match="author" mode="slides.titlepage.recto.auto.mode">
  121. <block xsl:use-attribute-sets="slides.titlepage.author.properties">
  122. <xsl:apply-templates select="." mode="slides.titlepage.recto.mode"/>
  123. </block>
  124. </xsl:template>
  125. <xsl:template match="pubdate" mode="slides.titlepage.recto.auto.mode">
  126. <block xsl:use-attribute-sets="slides.titlepage.pubdate.properties">
  127. <xsl:apply-templates select="." mode="slides.titlepage.recto.mode"/>
  128. </block>
  129. </xsl:template>
  130. </xsl:stylesheet>