task.xsl 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. version="1.0">
  5. <!-- ********************************************************************
  6. $Id: task.xsl 9122 2011-10-09 07:21:49Z bobstayton $
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <xsl:template match="task">
  14. <xsl:variable name="id">
  15. <xsl:call-template name="object.id"/>
  16. </xsl:variable>
  17. <xsl:variable name="param.placement"
  18. select="substring-after(normalize-space($formal.title.placement),
  19. concat(local-name(.), ' '))"/>
  20. <xsl:variable name="placement">
  21. <xsl:choose>
  22. <xsl:when test="contains($param.placement, ' ')">
  23. <xsl:value-of select="substring-before($param.placement, ' ')"/>
  24. </xsl:when>
  25. <xsl:when test="$param.placement = ''">before</xsl:when>
  26. <xsl:otherwise>
  27. <xsl:value-of select="$param.placement"/>
  28. </xsl:otherwise>
  29. </xsl:choose>
  30. </xsl:variable>
  31. <xsl:variable name="preamble"
  32. select="*[not(self::title
  33. or self::titleabbrev)]"/>
  34. <xsl:variable name="keep.together">
  35. <xsl:call-template name="pi.dbfo_keep-together"/>
  36. </xsl:variable>
  37. <fo:block id="{$id}"
  38. xsl:use-attribute-sets="task.properties">
  39. <xsl:if test="$keep.together != ''">
  40. <xsl:attribute name="keep-together.within-column"><xsl:value-of
  41. select="$keep.together"/></xsl:attribute>
  42. </xsl:if>
  43. <xsl:call-template name="anchor"/>
  44. <xsl:if test="title and $placement = 'before'">
  45. <xsl:call-template name="formal.object.heading"/>
  46. </xsl:if>
  47. <xsl:apply-templates select="$preamble"/>
  48. <xsl:if test="title and $placement != 'before'">
  49. <xsl:call-template name="formal.object.heading"/>
  50. </xsl:if>
  51. </fo:block>
  52. </xsl:template>
  53. <xsl:template match="task/title">
  54. <!-- nop -->
  55. </xsl:template>
  56. <xsl:template match="tasksummary">
  57. <xsl:call-template name="semiformal.object"/>
  58. </xsl:template>
  59. <xsl:template match="tasksummary/title"/>
  60. <xsl:template match="taskprerequisites">
  61. <xsl:call-template name="semiformal.object"/>
  62. </xsl:template>
  63. <xsl:template match="taskprerequisites/title"/>
  64. <xsl:template match="taskrelated">
  65. <xsl:call-template name="semiformal.object"/>
  66. </xsl:template>
  67. <xsl:template match="taskrelated/title"/>
  68. </xsl:stylesheet>