dbk2ooo.xsl 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <xsl:stylesheet version="1.0"
  2. xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  3. xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
  4. xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
  5. xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
  6. xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
  7. xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
  8. xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
  9. xmlns:xlink="http://www.w3.org/1999/xlink"
  10. xmlns:dc="http://purl.org/dc/elements/1.1/"
  11. xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
  12. xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
  13. xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
  14. xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
  15. xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
  16. xmlns:math="http://www.w3.org/1998/Math/MathML"
  17. xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
  18. xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
  19. xmlns:ooo="http://openoffice.org/2004/office"
  20. xmlns:ooow="http://openoffice.org/2004/writer"
  21. xmlns:oooc="http://openoffice.org/2004/calc"
  22. xmlns:dom="http://www.w3.org/2001/xml-events"
  23. xmlns:xforms="http://www.w3.org/2002/xforms"
  24. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  25. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  26. xmlns:doc='http://docbook.org/ns/docbook'
  27. exclude-result-prefixes='doc'>
  28. <xsl:import href='dbk2wp.xsl'/>
  29. <xsl:output method="xml" indent='yes'/>
  30. <!-- ********************************************************************
  31. $Id: dbk2ooo.xsl 9396 2012-06-02 21:56:19Z bobstayton $
  32. ********************************************************************
  33. This file is part of the XSL DocBook Stylesheet distribution.
  34. See ../README or http://docbook.sf.net/release/xsl/current/ for
  35. copyright and other information.
  36. ******************************************************************** -->
  37. <xsl:include href='../VERSION.xsl'/>
  38. <xsl:template match="/" name='ooo.top'>
  39. <xsl:param name='doc' select='/'/>
  40. <office:document-content
  41. office:version='1.0'>
  42. <office:script/>
  43. <office:font-face-decls>
  44. <style:font-face style:name="Nimbus Roman No9 L"
  45. svg:font-family="'Nimbus Roman No9 L'"
  46. style:font-family-generic="roman"
  47. style:font-pitch="variable"/>
  48. <style:font-face style:name="Nimbus Sans L"
  49. svg:font-family="'Nimbus Sans L'"
  50. style:font-family-generic="swiss"
  51. style:font-pitch="variable"/>
  52. <style:font-face style:name="DejaVu LGC Sans"
  53. svg:font-family="'DejaVu LGC Sans'"
  54. style:font-family-generic="system"
  55. style:font-pitch="variable"/>
  56. </office:font-face-decls>
  57. <office:automatic-styles/>
  58. <xsl:apply-templates select='$doc/*'
  59. mode='doc:toplevel'/>
  60. </office:document-content>
  61. </xsl:template>
  62. <xsl:template name='doc:make-body'>
  63. <xsl:param name='content'>
  64. <xsl:apply-templates mode='doc:body'/>
  65. </xsl:param>
  66. <office:body>
  67. <office:text>
  68. <office-forms form:automatic-focus='false'
  69. form:apply-design-mode='false'/>
  70. <text:sequence-decls>
  71. <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
  72. <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
  73. <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
  74. <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
  75. </text:sequence-decls>
  76. <xsl:copy-of select='$content'/>
  77. </office:text>
  78. </office:body>
  79. </xsl:template>
  80. <xsl:template name='doc:make-subsection'>
  81. <xsl:param name='content'>
  82. <xsl:apply-templates mode='doc:body'/>
  83. </xsl:param>
  84. <xsl:copy-of select='$content'/>
  85. </xsl:template>
  86. <xsl:template name='doc:make-paragraph'>
  87. <xsl:param name='style' select='"unknown"'/>
  88. <xsl:param name='content'>
  89. <xsl:apply-templates mode='doc:body'/>
  90. </xsl:param>
  91. <xsl:param name='outline.level' select='0'/>
  92. <xsl:param name='attributes.node' select='.'/>
  93. <text:p text:style-name='{$style}'>
  94. <xsl:call-template name='attributes'>
  95. <xsl:with-param name='node' select='$attributes.node'/>
  96. </xsl:call-template>
  97. <xsl:copy-of select='$content'/>
  98. </text:p>
  99. </xsl:template>
  100. <xsl:template name='doc:make-phrase'>
  101. <xsl:param name='style' select='"unknown"'/>
  102. <xsl:param name='content'>
  103. <xsl:apply-templates mode='doc:body'/>
  104. </xsl:param>
  105. <text:span text:style-name='{$style}'>
  106. <xsl:copy-of select='$content'/>
  107. </text:span>
  108. </xsl:template>
  109. <xsl:template name='doc:make-hyperlink'/>
  110. <xsl:template name='doc:make-hyperlink-not-implemented'>
  111. <xsl:param name='target'/>
  112. <xsl:param name='content'>
  113. <xsl:apply-templates mode='doc:body'/>
  114. </xsl:param>
  115. <text:link href='{$target}'>
  116. </text:link>
  117. </xsl:template>
  118. <xsl:template name='doc:make-table'/>
  119. <xsl:template name='doc:make-table-not-yet-implemented'>
  120. <xsl:param name='columns'/>
  121. <xsl:param name='content'>
  122. <xsl:apply-templates mode='doc:body'/>
  123. </xsl:param>
  124. </xsl:template>
  125. <xsl:template name='doc:make-table-row'>
  126. <xsl:param name='content'>
  127. <xsl:apply-templates mode='doc:body'/>
  128. </xsl:param>
  129. <xsl:param name='is-header' select='false()'/>
  130. </xsl:template>
  131. <xsl:template name='doc:make-table-cell'>
  132. <xsl:param name='width' select='0'/>
  133. <xsl:param name='hidden' select='false()'/>
  134. <xsl:param name='rowspan' select='1'/>
  135. <xsl:param name='colspan' select='1'/>
  136. <xsl:param name='content'>
  137. <xsl:apply-templates mode='doc:body'/>
  138. </xsl:param>
  139. </xsl:template>
  140. <xsl:template name='doc:make-soft-break'>
  141. <text:br/>
  142. </xsl:template>
  143. <xsl:template name='attributes'>
  144. <xsl:param name='node' select='.'/>
  145. </xsl:template>
  146. </xsl:stylesheet>