xml-d.xsl 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  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,' xml-d/xmlelement ')]">
  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:text>&lt;</xsl:text>
  37. <xsl:apply-templates/>
  38. <xsl:text>&gt;</xsl:text>
  39. <!-- end add rev flagging styles -->
  40. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  41. </text:span>
  42. </text:span>
  43. </text:p>
  44. </xsl:when>
  45. <!-- nested by entry -->
  46. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  47. <!-- create p tag -->
  48. <text:p>
  49. <!-- alignment styles -->
  50. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  51. <xsl:call-template name="set_align_value"/>
  52. </xsl:if>
  53. <!-- cell belongs to thead -->
  54. <xsl:choose>
  55. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  56. <text:span text:style-name="bold">
  57. <text:span text:style-name="Courier_New">
  58. <text:span>
  59. <!-- start add rev flagging styles -->
  60. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  61. <xsl:text>&lt;</xsl:text>
  62. <xsl:apply-templates/>
  63. <xsl:text>&gt;</xsl:text>
  64. <!-- end add rev flagging styles -->
  65. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  66. </text:span>
  67. </text:span>
  68. </text:span>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <text:span text:style-name="Courier_New">
  72. <text:span>
  73. <!-- start add rev flagging styles -->
  74. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  75. <xsl:text>&lt;</xsl:text>
  76. <xsl:apply-templates/>
  77. <xsl:text>&gt;</xsl:text>
  78. <!-- end add rev flagging styles -->
  79. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  80. </text:span>
  81. </text:span>
  82. </xsl:otherwise>
  83. </xsl:choose>
  84. </text:p>
  85. </xsl:when>
  86. <!-- nested by stentry -->
  87. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  88. <text:p>
  89. <!-- cell belongs to sthead -->
  90. <xsl:choose>
  91. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  92. <text:span text:style-name="bold">
  93. <text:span text:style-name="Courier_New">
  94. <text:span>
  95. <!-- start add rev flagging styles -->
  96. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  97. <xsl:text>&lt;</xsl:text>
  98. <xsl:apply-templates/>
  99. <xsl:text>&gt;</xsl:text>
  100. <!-- end add rev flagging styles -->
  101. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  102. </text:span>
  103. </text:span>
  104. </text:span>
  105. </xsl:when>
  106. <xsl:otherwise>
  107. <text:span text:style-name="Courier_New">
  108. <text:span>
  109. <!-- start add rev flagging styles -->
  110. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  111. <xsl:text>&lt;</xsl:text>
  112. <xsl:apply-templates/>
  113. <xsl:text>&gt;</xsl:text>
  114. <!-- end add rev flagging styles -->
  115. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  116. </text:span>
  117. </text:span>
  118. </xsl:otherwise>
  119. </xsl:choose>
  120. </text:p>
  121. </xsl:when>
  122. <!-- nested by other tags -->
  123. <xsl:otherwise>
  124. <text:span text:style-name="Courier_New">
  125. <text:span>
  126. <!-- start add rev flagging styles -->
  127. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  128. <xsl:text>&lt;</xsl:text>
  129. <xsl:apply-templates/>
  130. <xsl:text>&gt;</xsl:text>
  131. <!-- end add rev flagging styles -->
  132. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  133. </text:span>
  134. </text:span>
  135. </xsl:otherwise>
  136. </xsl:choose>
  137. </xsl:template>
  138. <xsl:template match="*[contains(@class,' xml-d/xmlatt ')]">
  139. <xsl:choose>
  140. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  141. <text:p>
  142. <text:span text:style-name="Courier_New">
  143. <text:span>
  144. <!-- start add rev flagging styles -->
  145. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  146. <xsl:text>@</xsl:text>
  147. <xsl:apply-templates/>
  148. <!-- end add rev flagging styles -->
  149. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  150. </text:span>
  151. </text:span>
  152. </text:p>
  153. </xsl:when>
  154. <!-- nested by entry -->
  155. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  156. <!-- create p tag -->
  157. <text:p>
  158. <!-- alignment styles -->
  159. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  160. <xsl:call-template name="set_align_value"/>
  161. </xsl:if>
  162. <!-- cell belongs to thead -->
  163. <xsl:choose>
  164. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  165. <text:span text:style-name="bold">
  166. <text:span text:style-name="Courier_New">
  167. <text:span>
  168. <!-- start add rev flagging styles -->
  169. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  170. <xsl:text>@</xsl:text>
  171. <xsl:apply-templates/>
  172. <!-- end add rev flagging styles -->
  173. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  174. </text:span>
  175. </text:span>
  176. </text:span>
  177. </xsl:when>
  178. <xsl:otherwise>
  179. <text:span text:style-name="Courier_New">
  180. <text:span>
  181. <!-- start add rev flagging styles -->
  182. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  183. <xsl:text>@</xsl:text>
  184. <xsl:apply-templates/>
  185. <!-- end add rev flagging styles -->
  186. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  187. </text:span>
  188. </text:span>
  189. </xsl:otherwise>
  190. </xsl:choose>
  191. </text:p>
  192. </xsl:when>
  193. <!-- nested by stentry -->
  194. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  195. <text:p>
  196. <!-- cell belongs to sthead -->
  197. <xsl:choose>
  198. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  199. <text:span text:style-name="bold">
  200. <text:span text:style-name="Courier_New">
  201. <text:span>
  202. <!-- start add rev flagging styles -->
  203. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  204. <xsl:text>@</xsl:text>
  205. <xsl:apply-templates/>
  206. <!-- end add rev flagging styles -->
  207. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  208. </text:span>
  209. </text:span>
  210. </text:span>
  211. </xsl:when>
  212. <xsl:otherwise>
  213. <text:span text:style-name="Courier_New">
  214. <text:span>
  215. <!-- start add rev flagging styles -->
  216. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  217. <xsl:text>@</xsl:text>
  218. <xsl:apply-templates/>
  219. <!-- end add rev flagging styles -->
  220. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  221. </text:span>
  222. </text:span>
  223. </xsl:otherwise>
  224. </xsl:choose>
  225. </text:p>
  226. </xsl:when>
  227. <!-- nested by other tags -->
  228. <xsl:otherwise>
  229. <text:span text:style-name="Courier_New">
  230. <text:span>
  231. <!-- start add rev flagging styles -->
  232. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  233. <xsl:text>@</xsl:text>
  234. <xsl:apply-templates/>
  235. <!-- end add rev flagging styles -->
  236. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  237. </text:span>
  238. </text:span>
  239. </xsl:otherwise>
  240. </xsl:choose>
  241. </xsl:template>
  242. <xsl:template match="*[contains(@class,' xml-d/textentity ')]">
  243. <xsl:choose>
  244. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  245. <text:p>
  246. <text:span text:style-name="Courier_New">
  247. <text:span>
  248. <!-- start add rev flagging styles -->
  249. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  250. <xsl:text>&amp;</xsl:text>
  251. <xsl:apply-templates/>
  252. <xsl:text>;</xsl:text>
  253. <!-- end add rev flagging styles -->
  254. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  255. </text:span>
  256. </text:span>
  257. </text:p>
  258. </xsl:when>
  259. <!-- nested by entry -->
  260. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  261. <!-- create p tag -->
  262. <text:p>
  263. <!-- alignment styles -->
  264. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  265. <xsl:call-template name="set_align_value"/>
  266. </xsl:if>
  267. <!-- cell belongs to thead -->
  268. <xsl:choose>
  269. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  270. <text:span text:style-name="bold">
  271. <text:span text:style-name="Courier_New">
  272. <text:span>
  273. <!-- start add rev flagging styles -->
  274. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  275. <xsl:text>&amp;</xsl:text>
  276. <xsl:apply-templates/>
  277. <xsl:text>;</xsl:text>
  278. <!-- end add rev flagging styles -->
  279. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  280. </text:span>
  281. </text:span>
  282. </text:span>
  283. </xsl:when>
  284. <xsl:otherwise>
  285. <text:span text:style-name="Courier_New">
  286. <text:span>
  287. <!-- start add rev flagging styles -->
  288. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  289. <xsl:text>&amp;</xsl:text>
  290. <xsl:apply-templates/>
  291. <xsl:text>;</xsl:text>
  292. <!-- end add rev flagging styles -->
  293. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  294. </text:span>
  295. </text:span>
  296. </xsl:otherwise>
  297. </xsl:choose>
  298. </text:p>
  299. </xsl:when>
  300. <!-- nested by stentry -->
  301. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  302. <text:p>
  303. <!-- cell belongs to sthead -->
  304. <xsl:choose>
  305. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  306. <text:span text:style-name="bold">
  307. <text:span text:style-name="Courier_New">
  308. <text:span>
  309. <!-- start add rev flagging styles -->
  310. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  311. <xsl:text>&amp;</xsl:text>
  312. <xsl:apply-templates/>
  313. <xsl:text>;</xsl:text>
  314. <!-- end add rev flagging styles -->
  315. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  316. </text:span>
  317. </text:span>
  318. </text:span>
  319. </xsl:when>
  320. <xsl:otherwise>
  321. <text:span text:style-name="Courier_New">
  322. <text:span>
  323. <!-- start add rev flagging styles -->
  324. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  325. <xsl:text>&amp;</xsl:text>
  326. <xsl:apply-templates/>
  327. <xsl:text>;</xsl:text>
  328. <!-- end add rev flagging styles -->
  329. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  330. </text:span>
  331. </text:span>
  332. </xsl:otherwise>
  333. </xsl:choose>
  334. </text:p>
  335. </xsl:when>
  336. <!-- nested by other tags -->
  337. <xsl:otherwise>
  338. <text:span text:style-name="Courier_New">
  339. <text:span>
  340. <!-- start add rev flagging styles -->
  341. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  342. <xsl:text>&amp;</xsl:text>
  343. <xsl:apply-templates/>
  344. <xsl:text>;</xsl:text>
  345. <!-- end add rev flagging styles -->
  346. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  347. </text:span>
  348. </text:span>
  349. </xsl:otherwise>
  350. </xsl:choose>
  351. </xsl:template>
  352. <xsl:template match="*[contains(@class,' xml-d/parameterentity ')]">
  353. <xsl:choose>
  354. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  355. <text:p>
  356. <text:span text:style-name="Courier_New">
  357. <text:span>
  358. <!-- start add rev flagging styles -->
  359. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  360. <xsl:text>%</xsl:text>
  361. <xsl:apply-templates/>
  362. <xsl:text>;</xsl:text>
  363. <!-- end add rev flagging styles -->
  364. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  365. </text:span>
  366. </text:span>
  367. </text:p>
  368. </xsl:when>
  369. <!-- nested by entry -->
  370. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  371. <!-- create p tag -->
  372. <text:p>
  373. <!-- alignment styles -->
  374. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  375. <xsl:call-template name="set_align_value"/>
  376. </xsl:if>
  377. <!-- cell belongs to thead -->
  378. <xsl:choose>
  379. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  380. <text:span text:style-name="bold">
  381. <text:span text:style-name="Courier_New">
  382. <text:span>
  383. <!-- start add rev flagging styles -->
  384. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  385. <xsl:text>%</xsl:text>
  386. <xsl:apply-templates/>
  387. <xsl:text>;</xsl:text>
  388. <!-- end add rev flagging styles -->
  389. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  390. </text:span>
  391. </text:span>
  392. </text:span>
  393. </xsl:when>
  394. <xsl:otherwise>
  395. <text:span text:style-name="Courier_New">
  396. <text:span>
  397. <!-- start add rev flagging styles -->
  398. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  399. <xsl:text>%</xsl:text>
  400. <xsl:apply-templates/>
  401. <xsl:text>;</xsl:text>
  402. <!-- end add rev flagging styles -->
  403. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  404. </text:span>
  405. </text:span>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. </text:p>
  409. </xsl:when>
  410. <!-- nested by stentry -->
  411. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  412. <text:p>
  413. <!-- cell belongs to sthead -->
  414. <xsl:choose>
  415. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  416. <text:span text:style-name="bold">
  417. <text:span text:style-name="Courier_New">
  418. <text:span>
  419. <!-- start add rev flagging styles -->
  420. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  421. <xsl:text>%</xsl:text>
  422. <xsl:apply-templates/>
  423. <xsl:text>;</xsl:text>
  424. <!-- end add rev flagging styles -->
  425. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  426. </text:span>
  427. </text:span>
  428. </text:span>
  429. </xsl:when>
  430. <xsl:otherwise>
  431. <text:span text:style-name="Courier_New">
  432. <text:span>
  433. <!-- start add rev flagging styles -->
  434. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  435. <xsl:text>%</xsl:text>
  436. <xsl:apply-templates/>
  437. <xsl:text>;</xsl:text>
  438. <!-- end add rev flagging styles -->
  439. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  440. </text:span>
  441. </text:span>
  442. </xsl:otherwise>
  443. </xsl:choose>
  444. </text:p>
  445. </xsl:when>
  446. <!-- nested by other tags -->
  447. <xsl:otherwise>
  448. <text:span text:style-name="Courier_New">
  449. <text:span>
  450. <!-- start add rev flagging styles -->
  451. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  452. <xsl:text>%</xsl:text>
  453. <xsl:apply-templates/>
  454. <xsl:text>;</xsl:text>
  455. <!-- end add rev flagging styles -->
  456. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  457. </text:span>
  458. </text:span>
  459. </xsl:otherwise>
  460. </xsl:choose>
  461. </xsl:template>
  462. <xsl:template match="*[contains(@class,' xml-d/numcharref ')]">
  463. <xsl:choose>
  464. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  465. <text:p>
  466. <text:span text:style-name="Courier_New">
  467. <text:span>
  468. <!-- start add rev flagging styles -->
  469. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  470. <xsl:text>&amp;#</xsl:text>
  471. <xsl:apply-templates/>
  472. <xsl:text>;</xsl:text>
  473. <!-- end add rev flagging styles -->
  474. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  475. </text:span>
  476. </text:span>
  477. </text:p>
  478. </xsl:when>
  479. <!-- nested by entry -->
  480. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  481. <!-- create p tag -->
  482. <text:p>
  483. <!-- alignment styles -->
  484. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  485. <xsl:call-template name="set_align_value"/>
  486. </xsl:if>
  487. <!-- cell belongs to thead -->
  488. <xsl:choose>
  489. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  490. <text:span text:style-name="bold">
  491. <text:span text:style-name="Courier_New">
  492. <text:span>
  493. <!-- start add rev flagging styles -->
  494. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  495. <xsl:text>&amp;#</xsl:text>
  496. <xsl:apply-templates/>
  497. <xsl:text>;</xsl:text>
  498. <!-- end add rev flagging styles -->
  499. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  500. </text:span>
  501. </text:span>
  502. </text:span>
  503. </xsl:when>
  504. <xsl:otherwise>
  505. <text:span text:style-name="Courier_New">
  506. <text:span>
  507. <!-- start add rev flagging styles -->
  508. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  509. <xsl:text>&amp;#</xsl:text>
  510. <xsl:apply-templates/>
  511. <xsl:text>;</xsl:text>
  512. <!-- end add rev flagging styles -->
  513. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  514. </text:span>
  515. </text:span>
  516. </xsl:otherwise>
  517. </xsl:choose>
  518. </text:p>
  519. </xsl:when>
  520. <!-- nested by stentry -->
  521. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  522. <text:p>
  523. <!-- cell belongs to sthead -->
  524. <xsl:choose>
  525. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  526. <text:span text:style-name="bold">
  527. <text:span text:style-name="Courier_New">
  528. <text:span>
  529. <!-- start add rev flagging styles -->
  530. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  531. <xsl:text>&amp;#</xsl:text>
  532. <xsl:apply-templates/>
  533. <xsl:text>;</xsl:text>
  534. <!-- end add rev flagging styles -->
  535. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  536. </text:span>
  537. </text:span>
  538. </text:span>
  539. </xsl:when>
  540. <xsl:otherwise>
  541. <text:span text:style-name="Courier_New">
  542. <text:span>
  543. <!-- start add rev flagging styles -->
  544. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  545. <xsl:text>&amp;#</xsl:text>
  546. <xsl:apply-templates/>
  547. <xsl:text>;</xsl:text>
  548. <!-- end add rev flagging styles -->
  549. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  550. </text:span>
  551. </text:span>
  552. </xsl:otherwise>
  553. </xsl:choose>
  554. </text:p>
  555. </xsl:when>
  556. <!-- nested by other tags -->
  557. <xsl:otherwise>
  558. <text:span text:style-name="Courier_New">
  559. <text:span>
  560. <!-- start add rev flagging styles -->
  561. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  562. <xsl:text>&amp;#</xsl:text>
  563. <xsl:apply-templates/>
  564. <xsl:text>;</xsl:text>
  565. <!-- end add rev flagging styles -->
  566. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  567. </text:span>
  568. </text:span>
  569. </xsl:otherwise>
  570. </xsl:choose>
  571. </xsl:template>
  572. <xsl:template match="*[contains(@class,' xml-d/xmlnsname ')]">
  573. <xsl:choose>
  574. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  575. <text:p>
  576. <text:span text:style-name="Courier_New">
  577. <text:span>
  578. <!-- start add rev flagging styles -->
  579. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  580. <xsl:apply-templates/>
  581. <!-- end add rev flagging styles -->
  582. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  583. </text:span>
  584. </text:span>
  585. </text:p>
  586. </xsl:when>
  587. <!-- nested by entry -->
  588. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  589. <!-- create p tag -->
  590. <text:p>
  591. <!-- alignment styles -->
  592. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  593. <xsl:call-template name="set_align_value"/>
  594. </xsl:if>
  595. <!-- cell belongs to thead -->
  596. <xsl:choose>
  597. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  598. <text:span text:style-name="bold">
  599. <text:span text:style-name="Courier_New">
  600. <text:span>
  601. <!-- start add rev flagging styles -->
  602. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  603. <xsl:apply-templates/>
  604. <!-- end add rev flagging styles -->
  605. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  606. </text:span>
  607. </text:span>
  608. </text:span>
  609. </xsl:when>
  610. <xsl:otherwise>
  611. <text:span text:style-name="Courier_New">
  612. <text:span>
  613. <!-- start add rev flagging styles -->
  614. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  615. <xsl:apply-templates/>
  616. <!-- end add rev flagging styles -->
  617. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  618. </text:span>
  619. </text:span>
  620. </xsl:otherwise>
  621. </xsl:choose>
  622. </text:p>
  623. </xsl:when>
  624. <!-- nested by stentry -->
  625. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  626. <text:p>
  627. <!-- cell belongs to sthead -->
  628. <xsl:choose>
  629. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  630. <text:span text:style-name="bold">
  631. <text:span text:style-name="Courier_New">
  632. <text:span>
  633. <!-- start add rev flagging styles -->
  634. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  635. <xsl:apply-templates/>
  636. <!-- end add rev flagging styles -->
  637. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  638. </text:span>
  639. </text:span>
  640. </text:span>
  641. </xsl:when>
  642. <xsl:otherwise>
  643. <text:span text:style-name="Courier_New">
  644. <text:span>
  645. <!-- start add rev flagging styles -->
  646. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  647. <xsl:apply-templates/>
  648. <!-- end add rev flagging styles -->
  649. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  650. </text:span>
  651. </text:span>
  652. </xsl:otherwise>
  653. </xsl:choose>
  654. </text:p>
  655. </xsl:when>
  656. <!-- nested by other tags -->
  657. <xsl:otherwise>
  658. <text:span text:style-name="Courier_New">
  659. <text:span>
  660. <!-- start add rev flagging styles -->
  661. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  662. <xsl:apply-templates/>
  663. <!-- end add rev flagging styles -->
  664. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  665. </text:span>
  666. </text:span>
  667. </xsl:otherwise>
  668. </xsl:choose>
  669. </xsl:template>
  670. <xsl:template match="*[contains(@class,' xml-d/xmlnsname ')] | *[contains(@class,' xml-d/xmlpi ')]">
  671. <xsl:choose>
  672. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  673. <text:p>
  674. <text:span text:style-name="Courier_New">
  675. <text:span>
  676. <!-- start add rev flagging styles -->
  677. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  678. <xsl:apply-templates/>
  679. <!-- end add rev flagging styles -->
  680. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  681. </text:span>
  682. </text:span>
  683. </text:p>
  684. </xsl:when>
  685. <!-- nested by entry -->
  686. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  687. <!-- create p tag -->
  688. <text:p>
  689. <!-- alignment styles -->
  690. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  691. <xsl:call-template name="set_align_value"/>
  692. </xsl:if>
  693. <!-- cell belongs to thead -->
  694. <xsl:choose>
  695. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  696. <text:span text:style-name="bold">
  697. <text:span text:style-name="Courier_New">
  698. <text:span>
  699. <!-- start add rev flagging styles -->
  700. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  701. <xsl:apply-templates/>
  702. <!-- end add rev flagging styles -->
  703. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  704. </text:span>
  705. </text:span>
  706. </text:span>
  707. </xsl:when>
  708. <xsl:otherwise>
  709. <text:span text:style-name="Courier_New">
  710. <text:span>
  711. <!-- start add rev flagging styles -->
  712. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  713. <xsl:apply-templates/>
  714. <!-- end add rev flagging styles -->
  715. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  716. </text:span>
  717. </text:span>
  718. </xsl:otherwise>
  719. </xsl:choose>
  720. </text:p>
  721. </xsl:when>
  722. <!-- nested by stentry -->
  723. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  724. <text:p>
  725. <!-- cell belongs to sthead -->
  726. <xsl:choose>
  727. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  728. <text:span text:style-name="bold">
  729. <text:span text:style-name="Courier_New">
  730. <text:span>
  731. <!-- start add rev flagging styles -->
  732. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  733. <xsl:apply-templates/>
  734. <!-- end add rev flagging styles -->
  735. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  736. </text:span>
  737. </text:span>
  738. </text:span>
  739. </xsl:when>
  740. <xsl:otherwise>
  741. <text:span text:style-name="Courier_New">
  742. <text:span>
  743. <!-- start add rev flagging styles -->
  744. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  745. <xsl:apply-templates/>
  746. <!-- end add rev flagging styles -->
  747. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  748. </text:span>
  749. </text:span>
  750. </xsl:otherwise>
  751. </xsl:choose>
  752. </text:p>
  753. </xsl:when>
  754. <!-- nested by other tags -->
  755. <xsl:otherwise>
  756. <text:span text:style-name="Courier_New">
  757. <text:span>
  758. <!-- start add rev flagging styles -->
  759. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  760. <xsl:apply-templates/>
  761. <!-- end add rev flagging styles -->
  762. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  763. </text:span>
  764. </text:span>
  765. </xsl:otherwise>
  766. </xsl:choose>
  767. </xsl:template>
  768. </xsl:stylesheet>