step1-task.xsl 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0"?>
  2. <!-- This file is part of the DITA Open Toolkit project hosted on
  3. Sourceforge.net. See the accompanying license.txt file for
  4. applicable licenses.-->
  5. <!-- (c) Copyright IBM Corp. 2004, 2006 All Rights Reserved. -->
  6. <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  7. <xsl:output method="xml"/>
  8. <xsl:template match="*[contains(@class,' task/steps ') or contains(@class,' task/steps-unordered ')]" name="topic.task.steps">
  9. <xsl:choose>
  10. <xsl:when test="not(*[2])">
  11. <block><xsl:call-template name="commonatts"/><xsl:apply-templates/></block>
  12. </xsl:when>
  13. <xsl:otherwise>
  14. <xsl:apply-imports/>
  15. </xsl:otherwise>
  16. </xsl:choose>
  17. </xsl:template>
  18. <xsl:template match="*[contains(@class,' task/step ')]/@importance |
  19. *[contains(@class,' task/substep ')]/@importance">
  20. <xsl:if test=".='optional' or .='required'">
  21. <text style="bold"><xsl:call-template name="commonatts"/>
  22. <xsl:if test=".='optional'">
  23. <xsl:call-template name="getVariable"><xsl:with-param name="id" select="'Optional'"/></xsl:call-template>
  24. </xsl:if>
  25. <xsl:if test=".='required'">
  26. <xsl:call-template name="getVariable"><xsl:with-param name="id" select="'Required'"/></xsl:call-template>
  27. </xsl:if>
  28. <xsl:call-template name="getVariable"><xsl:with-param name="id" select="'ColonSymbol'"/></xsl:call-template>
  29. </text>
  30. <xsl:text> </xsl:text>
  31. </xsl:if>
  32. </xsl:template>
  33. <xsl:template match="*[contains(@class,' task/step ')]">
  34. <xsl:choose>
  35. <xsl:when test="following-sibling::*|preceding-sibling::*">
  36. <xsl:variable name="listintro">
  37. <xsl:choose>
  38. <xsl:when test="parent::*[contains(@class,' task/steps-unordered ')]">* </xsl:when>
  39. <xsl:otherwise>
  40. <xsl:apply-templates select="." mode="get-list-number"/><xsl:text> </xsl:text>
  41. </xsl:otherwise>
  42. </xsl:choose>
  43. </xsl:variable>
  44. <block leadin="{$listintro}" indent="{string-length($listintro)}">
  45. <xsl:call-template name="commonatts"/>
  46. <xsl:if test="parent::*[@compact='yes']">
  47. <xsl:attribute name="compact">yes</xsl:attribute>
  48. </xsl:if>
  49. <xsl:apply-templates select="@importance"/>
  50. <xsl:apply-templates/>
  51. </block>
  52. </xsl:when>
  53. <xsl:otherwise>
  54. <xsl:apply-templates select="@importance"/>
  55. <xsl:apply-templates/>
  56. </xsl:otherwise>
  57. </xsl:choose>
  58. </xsl:template>
  59. <xsl:template match="*[contains(@class,' task/substep ')]">
  60. <xsl:variable name="listintro">
  61. <xsl:apply-templates select="." mode="get-list-number"/><xsl:text> </xsl:text>
  62. </xsl:variable>
  63. <block leadin="{$listintro}" indent="{string-length($listintro)}">
  64. <xsl:call-template name="commonatts"/>
  65. <xsl:if test="parent::*[@compact='yes']"><xsl:attribute name="compact">yes</xsl:attribute></xsl:if>
  66. <xsl:apply-templates select="@importance"/>
  67. <xsl:apply-templates/>
  68. </block>
  69. </xsl:template>
  70. <xsl:template match="*[contains(@class,' task/choicetable ')]" mode="default-simpletable-headers">
  71. <xsl:value-of select="$newline"/>
  72. <thead><xsl:call-template name="commonatts"/>
  73. <row><xsl:call-template name="commonatts"/>
  74. <xsl:value-of select="$newline"/>
  75. <entry><xsl:call-template name="commonatts"/>
  76. <xsl:call-template name="getVariable">
  77. <xsl:with-param name="id" select="'Option'"/>
  78. </xsl:call-template>
  79. </entry>
  80. <xsl:value-of select="$newline"/>
  81. <entry><xsl:call-template name="commonatts"/>
  82. <xsl:call-template name="getVariable">
  83. <xsl:with-param name="id" select="'Description'"/>
  84. </xsl:call-template>
  85. </entry>
  86. </row>
  87. </thead>
  88. </xsl:template>
  89. </xsl:stylesheet>