task.xsl 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. version="1.0">
  4. <!-- ********************************************************************
  5. $Id: task.xsl 9363 2012-05-12 23:42:32Z bobstayton $
  6. ********************************************************************
  7. This file is part of the XSL DocBook Stylesheet distribution.
  8. See ../README or http://docbook.sf.net/release/xsl/current/ for
  9. copyright and other information.
  10. ******************************************************************** -->
  11. <!-- ==================================================================== -->
  12. <xsl:template match="task">
  13. <xsl:variable name="param.placement"
  14. select="substring-after(normalize-space($formal.title.placement),
  15. concat(local-name(.), ' '))"/>
  16. <xsl:variable name="placement">
  17. <xsl:choose>
  18. <xsl:when test="contains($param.placement, ' ')">
  19. <xsl:value-of select="substring-before($param.placement, ' ')"/>
  20. </xsl:when>
  21. <xsl:when test="$param.placement = ''">before</xsl:when>
  22. <xsl:otherwise>
  23. <xsl:value-of select="$param.placement"/>
  24. </xsl:otherwise>
  25. </xsl:choose>
  26. </xsl:variable>
  27. <xsl:variable name="preamble"
  28. select="*[not(self::title
  29. or self::titleabbrev)]"/>
  30. <div>
  31. <xsl:apply-templates select="." mode="common.html.attributes"/>
  32. <xsl:call-template name="id.attribute"/>
  33. <xsl:call-template name="anchor"/>
  34. <xsl:if test="(title or info/title) and $placement = 'before'">
  35. <xsl:call-template name="formal.object.heading"/>
  36. </xsl:if>
  37. <xsl:apply-templates select="$preamble"/>
  38. <xsl:if test="(title or info/title) and $placement != 'before'">
  39. <xsl:call-template name="formal.object.heading"/>
  40. </xsl:if>
  41. </div>
  42. </xsl:template>
  43. <xsl:template match="task/title">
  44. <!-- nop -->
  45. </xsl:template>
  46. <xsl:template match="tasksummary">
  47. <xsl:call-template name="semiformal.object"/>
  48. </xsl:template>
  49. <xsl:template match="tasksummary/title"/>
  50. <xsl:template match="taskprerequisites">
  51. <xsl:call-template name="semiformal.object"/>
  52. </xsl:template>
  53. <xsl:template match="taskprerequisites/title"/>
  54. <xsl:template match="taskrelated">
  55. <xsl:call-template name="semiformal.object"/>
  56. </xsl:template>
  57. <xsl:template match="taskrelated/title"/>
  58. </xsl:stylesheet>