task.xsl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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$
  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. <fo:block id="{$id}"
  35. xsl:use-attribute-sets="formal.object.properties">
  36. <xsl:call-template name="anchor"/>
  37. <xsl:if test="title and $placement = 'before'">
  38. <xsl:call-template name="formal.object.heading"/>
  39. </xsl:if>
  40. <xsl:apply-templates select="$preamble"/>
  41. <xsl:if test="title and $placement != 'before'">
  42. <xsl:call-template name="formal.object.heading"/>
  43. </xsl:if>
  44. </fo:block>
  45. </xsl:template>
  46. <xsl:template match="task/title">
  47. <!-- nop -->
  48. </xsl:template>
  49. <xsl:template match="tasksummary">
  50. <xsl:call-template name="semiformal.object"/>
  51. </xsl:template>
  52. <xsl:template match="tasksummary/title"/>
  53. <xsl:template match="taskprerequisites">
  54. <xsl:call-template name="semiformal.object"/>
  55. </xsl:template>
  56. <xsl:template match="taskprerequisites/title"/>
  57. <xsl:template match="taskrelated">
  58. <xsl:call-template name="semiformal.object"/>
  59. </xsl:template>
  60. <xsl:template match="taskrelated/title"/>
  61. </xsl:stylesheet>