markup-d.xsl 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- This file is part of the DITA Open Toolkit project.
  3. See the accompanying license.txt file for applicable licenses.-->
  4. <xsl:stylesheet
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
  7. xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
  8. xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
  9. xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
  10. xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
  11. xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
  12. xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/"
  13. xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
  14. xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
  15. xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
  16. xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
  17. xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
  18. xmlns:math="http://www.w3.org/1998/Math/MathML"
  19. xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
  20. xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
  21. xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms"
  22. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  23. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  24. xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
  25. xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
  26. xmlns:prodtools="http://www.ibm.com/xmlns/prodtools"
  27. version="2.0">
  28. <xsl:template match="*[contains(@class,' markup-d/markupname ')]">
  29. <xsl:choose>
  30. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  31. <text:p>
  32. <text:span text:style-name="Courier_New">
  33. <text:span>
  34. <!-- start add rev flagging styles -->
  35. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  36. <xsl:apply-templates/>
  37. <!-- end add rev flagging styles -->
  38. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  39. </text:span>
  40. </text:span>
  41. </text:p>
  42. </xsl:when>
  43. <!-- nested by entry -->
  44. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  45. <!-- create p tag -->
  46. <text:p>
  47. <!-- alignment styles -->
  48. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  49. <xsl:call-template name="set_align_value"/>
  50. </xsl:if>
  51. <!-- cell belongs to thead -->
  52. <xsl:choose>
  53. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  54. <text:span text:style-name="bold">
  55. <text:span text:style-name="Courier_New">
  56. <text:span>
  57. <!-- start add rev flagging styles -->
  58. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  59. <xsl:apply-templates/>
  60. <!-- end add rev flagging styles -->
  61. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  62. </text:span>
  63. </text:span>
  64. </text:span>
  65. </xsl:when>
  66. <xsl:otherwise>
  67. <text:span text:style-name="Courier_New">
  68. <text:span>
  69. <!-- start add rev flagging styles -->
  70. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  71. <xsl:apply-templates/>
  72. <!-- end add rev flagging styles -->
  73. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  74. </text:span>
  75. </text:span>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </text:p>
  79. </xsl:when>
  80. <!-- nested by stentry -->
  81. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  82. <text:p>
  83. <!-- cell belongs to sthead -->
  84. <xsl:choose>
  85. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  86. <text:span text:style-name="bold">
  87. <text:span text:style-name="Courier_New">
  88. <text:span>
  89. <!-- start add rev flagging styles -->
  90. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  91. <xsl:apply-templates/>
  92. <!-- end add rev flagging styles -->
  93. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  94. </text:span>
  95. </text:span>
  96. </text:span>
  97. </xsl:when>
  98. <xsl:otherwise>
  99. <text:span text:style-name="Courier_New">
  100. <text:span>
  101. <!-- start add rev flagging styles -->
  102. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  103. <xsl:apply-templates/>
  104. <!-- end add rev flagging styles -->
  105. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  106. </text:span>
  107. </text:span>
  108. </xsl:otherwise>
  109. </xsl:choose>
  110. </text:p>
  111. </xsl:when>
  112. <!-- nested by other tags -->
  113. <xsl:otherwise>
  114. <text:span text:style-name="Courier_New">
  115. <text:span>
  116. <!-- start add rev flagging styles -->
  117. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  118. <xsl:apply-templates/>
  119. <!-- end add rev flagging styles -->
  120. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  121. </text:span>
  122. </text:span>
  123. </xsl:otherwise>
  124. </xsl:choose>
  125. </xsl:template>
  126. </xsl:stylesheet>