dita2odtImpl.xsl 129 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266
  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. <!-- (c) Copyright IBM Corp. 2005, 2006 All Rights Reserved. -->
  5. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  7. xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
  8. xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
  9. xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
  10. xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
  11. xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
  12. xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
  13. xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/"
  14. xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
  15. xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
  16. xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
  17. xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
  18. xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
  19. xmlns:math="http://www.w3.org/1998/Math/MathML"
  20. xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
  21. xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
  22. xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms"
  23. xmlns:xsd="http://www.w3.org/2001/XMLSchema" 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. xmlns:styleUtils="org.dita.dost.util.StyleUtils"
  28. xmlns:ditamsg="http://dita-ot.sourceforge.net/ns/200704/ditamsg"
  29. exclude-result-prefixes="xs styleUtils ditamsg"
  30. version="2.0">
  31. <xsl:output method="xml"/>
  32. <xsl:output indent="yes"/>
  33. <xsl:strip-space elements="*"/>
  34. <!-- Deprecated since 2.3 -->
  35. <xsl:variable name="msgprefix">DOTX</xsl:variable>
  36. <!-- =========== "GLOBAL" DECLARATIONS =========== -->
  37. <!-- The document tree of filterfile returned by document($FILTERFILE,/)-->
  38. <xsl:variable name="FILTERFILEURL">
  39. <xsl:choose>
  40. <xsl:when test="not($FILTERFILE)"/> <!-- If no filterfile leave empty -->
  41. <xsl:when test="starts-with($FILTERFILE,'file:')">
  42. <xsl:value-of select="$FILTERFILE"/>
  43. </xsl:when>
  44. <xsl:otherwise>
  45. <xsl:choose>
  46. <xsl:when test="starts-with($FILTERFILE,'/')">
  47. <xsl:text>file://</xsl:text><xsl:value-of select="$FILTERFILE"/>
  48. </xsl:when>
  49. <xsl:otherwise>
  50. <xsl:text>file:/</xsl:text><xsl:value-of select="$FILTERFILE"/>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:otherwise>
  54. </xsl:choose>
  55. </xsl:variable>
  56. <xsl:variable name="FILTERDOC" select="document($FILTERFILEURL,/)"/>
  57. <!-- Define a newline character -->
  58. <xsl:variable name="newline"><xsl:text>
  59. </xsl:text></xsl:variable>
  60. <!--Check the file Url Definition of HDF HDR FTR-->
  61. <!--
  62. <xsl:variable name="HDFFILE">
  63. <xsl:choose>
  64. <xsl:when test="not($HDF)"/>
  65. <xsl:when test="starts-with($HDF,'file:')">
  66. <xsl:value-of select="$HDF"/>
  67. </xsl:when>
  68. <xsl:otherwise>
  69. <xsl:choose>
  70. <xsl:when test="starts-with($HDF,'/')">
  71. <xsl:text>file://</xsl:text><xsl:value-of select="$HDF"/>
  72. </xsl:when>
  73. <xsl:otherwise>
  74. <xsl:text>file:/</xsl:text><xsl:value-of select="$HDF"/>
  75. </xsl:otherwise>
  76. </xsl:choose>
  77. </xsl:otherwise>
  78. </xsl:choose>
  79. </xsl:variable>
  80. <xsl:variable name="HDRFILE">
  81. <xsl:choose>
  82. <xsl:when test="not($HDR)"/>
  83. <xsl:when test="starts-with($HDR,'file:')">
  84. <xsl:value-of select="$HDR"/>
  85. </xsl:when>
  86. <xsl:otherwise>
  87. <xsl:choose>
  88. <xsl:when test="starts-with($HDR,'/')">
  89. <xsl:text>file://</xsl:text><xsl:value-of select="$HDR"/>
  90. </xsl:when>
  91. <xsl:otherwise>
  92. <xsl:text>file:/</xsl:text><xsl:value-of select="$HDR"/>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:otherwise>
  96. </xsl:choose>
  97. </xsl:variable>
  98. <xsl:variable name="FTRFILE">
  99. <xsl:choose>
  100. <xsl:when test="not($FTR)"/>
  101. <xsl:when test="starts-with($FTR,'file:')">
  102. <xsl:value-of select="$FTR"/>
  103. </xsl:when>
  104. <xsl:otherwise>
  105. <xsl:choose>
  106. <xsl:when test="starts-with($FTR,'/')">
  107. <xsl:text>file://</xsl:text><xsl:value-of select="$FTR"/>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <xsl:text>file:/</xsl:text><xsl:value-of select="$FTR"/>
  111. </xsl:otherwise>
  112. </xsl:choose>
  113. </xsl:otherwise>
  114. </xsl:choose>
  115. </xsl:variable>
  116. -->
  117. <!-- Filler for A-name anchors - was &nbsp;-->
  118. <xsl:variable name="afill"/>
  119. <!-- these elements are never processed in a conventional presentation. can be overridden. -->
  120. <xsl:template match="*[contains(@class,' topic/no-topic-nesting ')]"/>
  121. <xsl:template match="*[contains(@class,' topic/topic ')]">
  122. <!--
  123. <xsl:apply-templates/>
  124. -->
  125. <xsl:variable name="topicType">
  126. <xsl:call-template name="determineTopicType"/>
  127. </xsl:variable>
  128. <xsl:choose>
  129. <xsl:when test="$topicType = 'topicChapter'">
  130. <xsl:call-template name="processTopicChapter"/>
  131. </xsl:when>
  132. <xsl:when test="$topicType = 'topicAppendix'">
  133. <xsl:apply-templates/>
  134. </xsl:when>
  135. <xsl:when test="$topicType = 'topicPart'">
  136. <xsl:apply-templates/>
  137. </xsl:when>
  138. <xsl:when test="$topicType = 'topicPreface'">
  139. <xsl:apply-templates/>
  140. </xsl:when>
  141. <xsl:when test="$topicType = 'topicNotices'">
  142. <!-- Suppressed in normal processing, since it goes at the beginning of the book. -->
  143. <!-- <xsl:call-template name="processTopicNotices"/> -->
  144. </xsl:when>
  145. <xsl:when test="$topicType = 'topicSimple'">
  146. <xsl:apply-templates/>
  147. </xsl:when>
  148. <!--BS: skipp abstract (copyright) from usual content. It will be processed from the front-matter-->
  149. <xsl:when test="$topicType = 'topicAbstract'"/>
  150. <xsl:otherwise>
  151. <xsl:apply-templates/>
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. </xsl:template>
  155. <xsl:template match="*[contains(@class, ' topic/body ')]">
  156. <!-- Added for DITA 1.1 "Shortdesc proposal" -->
  157. <!-- get the abstract para -->
  158. <xsl:apply-templates select="preceding-sibling::*[contains(@class,' topic/abstract ')]" mode="outofline"/>
  159. <!-- get the shortdesc para -->
  160. <xsl:apply-templates select="preceding-sibling::*[contains(@class,' topic/shortdesc ')]" mode="outofline"/>
  161. <!-- Insert pre-req links - after shortdesc - unless there is a prereq section about -->
  162. <xsl:apply-templates select="following-sibling::*[contains(@class,' topic/related-links ')]" mode="prereqs"/>
  163. <xsl:apply-templates/>
  164. </xsl:template>
  165. <xsl:template match="*[contains(@class, ' topic/bodydiv ')]">
  166. <xsl:choose>
  167. <!-- direct child of body -->
  168. <xsl:when test="parent::*[contains(@class, ' topic/body ')]">
  169. <text:p>
  170. <xsl:apply-templates/>
  171. </text:p>
  172. </xsl:when>
  173. <xsl:otherwise>
  174. <text:span>
  175. <xsl:apply-templates/>
  176. </text:span>
  177. </xsl:otherwise>
  178. </xsl:choose>
  179. </xsl:template>
  180. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]">
  181. <xsl:variable name="depth" select="count(ancestor::*[contains(@class,' topic/topic ')])" as="xs:integer"/>
  182. <xsl:call-template name="block-title">
  183. <xsl:with-param name="depth" select="$depth"/>
  184. </xsl:call-template>
  185. </xsl:template>
  186. <xsl:template match="synsect"/>
  187. <xsl:template match="*[contains(@class,' topic/section ')]">
  188. <xsl:choose>
  189. <!-- nested by body -->
  190. <xsl:when test="parent::*[contains(@class, ' topic/body ')]">
  191. <text:p text:style-name="indent_paragraph_style">
  192. <text:line-break/>
  193. <text:span>
  194. <!-- start add flagging styles -->
  195. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  196. <!-- if has title tag -->
  197. <xsl:if test="child::*[contains(@class, ' topic/title ')]">
  198. <xsl:apply-templates select="child::*[contains(@class, ' topic/title ')]" mode="render_section_title"/>
  199. </xsl:if>
  200. <xsl:apply-templates select="*[not(contains(@class,' topic/title '))] | text() | comment() | processing-instruction()"/>
  201. <!-- end add flagging styles -->
  202. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  203. </text:span>
  204. </text:p>
  205. </xsl:when>
  206. <!-- nested by other tags -->
  207. <xsl:otherwise>
  208. <text:span>
  209. <text:line-break/>
  210. <text:span>
  211. <!-- start add flagging styles -->
  212. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  213. <xsl:apply-templates/>
  214. <!-- end add flagging styles -->
  215. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  216. </text:span>
  217. </text:span>
  218. </xsl:otherwise>
  219. </xsl:choose>
  220. </xsl:template>
  221. <xsl:template match="*[contains(@class,' topic/sectiondiv ')]">
  222. <text:span>
  223. <xsl:apply-templates/>
  224. </text:span>
  225. </xsl:template>
  226. <xsl:template match="*[contains(@class,' topic/title ')]" mode="render_section_title">
  227. <xsl:variable name="headCount" select="count(ancestor::*[contains(@class,' topic/topic ')])+1"/>
  228. <!-- Heading_20_2 -->
  229. <text:span text:style-name="bold">
  230. <!--
  231. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Heading_20_' , $headCount)"/></xsl:attribute>
  232. -->
  233. <xsl:apply-templates/>
  234. </text:span>
  235. <text:line-break/>
  236. </xsl:template>
  237. <xsl:template match="*[contains(@class,' topic/section ')]/*[contains(@class,' topic/note ')]" priority="1">
  238. <text:span>
  239. <xsl:apply-templates/>
  240. </text:span>
  241. <text:line-break/>
  242. </xsl:template>
  243. <xsl:template match="*[contains(@class,' topic/example ')]">
  244. <xsl:choose>
  245. <!-- parent is body -->
  246. <xsl:when test="parent::*[contains(@class, ' topic/body ')]">
  247. <text:p>
  248. <text:span>
  249. <!-- start add flagging styles -->
  250. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  251. <xsl:apply-templates/>
  252. <!-- end add flagging styles -->
  253. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  254. </text:span>
  255. </text:p>
  256. </xsl:when>
  257. <!-- nested by other tags. -->
  258. <xsl:otherwise>
  259. <text:span>
  260. <text:span>
  261. <!-- start add flagging styles -->
  262. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  263. <xsl:apply-templates/>
  264. <!-- end add flagging styles -->
  265. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  266. </text:span>
  267. </text:span>
  268. </xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:template>
  271. <xsl:template match="*[contains(@class,' topic/example ')]/*[contains(@class,' topic/title ')]">
  272. <text:span text:style-name="bold">
  273. <xsl:apply-templates/>
  274. </text:span>
  275. <text:line-break/>
  276. </xsl:template>
  277. <xsl:template match="*[contains(@class,' topic/fig ')]">
  278. <xsl:choose>
  279. <!-- parent is body, li... -->
  280. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  281. parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  282. <text:p>
  283. <text:span>
  284. <!-- start add flagging styles -->
  285. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  286. <xsl:apply-templates/>
  287. <!-- end add flagging styles -->
  288. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  289. </text:span>
  290. </text:p>
  291. </xsl:when>
  292. <!-- nested by entry -->
  293. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  294. <!-- create p tag -->
  295. <text:p>
  296. <!-- alignment styles -->
  297. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  298. <xsl:call-template name="set_align_value"/>
  299. </xsl:if>
  300. <!-- cell belongs to thead -->
  301. <xsl:choose>
  302. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]
  303. /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  304. <text:span text:style-name="bold">
  305. <text:span>
  306. <!-- start add flagging styles -->
  307. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  308. <xsl:apply-templates/>
  309. <!-- end add flagging styles -->
  310. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  311. </text:span>
  312. </text:span>
  313. </xsl:when>
  314. <xsl:otherwise>
  315. <text:span>
  316. <!-- start add flagging styles -->
  317. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  318. <xsl:apply-templates/>
  319. <!-- end add flagging styles -->
  320. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  321. </text:span>
  322. </xsl:otherwise>
  323. </xsl:choose>
  324. </text:p>
  325. </xsl:when>
  326. <!-- nested by stentry -->
  327. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  328. <text:p>
  329. <!-- cell belongs to sthead -->
  330. <xsl:choose>
  331. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/
  332. parent::*[contains(@class, ' topic/sthead ')]">
  333. <text:span text:style-name="bold">
  334. <text:span>
  335. <!-- start add flagging styles -->
  336. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  337. <xsl:apply-templates/>
  338. <!-- end add flagging styles -->
  339. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  340. </text:span>
  341. </text:span>
  342. </xsl:when>
  343. <xsl:otherwise>
  344. <text:span>
  345. <!-- start add flagging styles -->
  346. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  347. <xsl:apply-templates/>
  348. <!-- end add flagging styles -->
  349. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  350. </text:span>
  351. </xsl:otherwise>
  352. </xsl:choose>
  353. </text:p>
  354. </xsl:when>
  355. <!-- other tags -->
  356. <xsl:otherwise>
  357. <text:span>
  358. <text:span>
  359. <!-- start add flagging styles -->
  360. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  361. <xsl:apply-templates/>
  362. <!-- end add flagging styles -->
  363. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  364. </text:span>
  365. </text:span>
  366. </xsl:otherwise>
  367. </xsl:choose>
  368. </xsl:template>
  369. <xsl:template match="*[contains(@class, ' topic/figgroup ')]">
  370. <text:span>
  371. <text:span>
  372. <!-- start add flagging styles -->
  373. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  374. <xsl:apply-templates/>
  375. <!-- end add flagging styles -->
  376. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  377. </text:span>
  378. </text:span>
  379. <text:line-break/>
  380. </xsl:template>
  381. <xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]">
  382. <xsl:variable name="ancestorlang">
  383. <xsl:call-template name="getLowerCaseLang"/>
  384. </xsl:variable>
  385. <xsl:variable name="fig-count-actual" select="count(preceding::*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')])+1"><!-- Number of fig/title's including this one --></xsl:variable>
  386. <text:line-break/>
  387. <text:span text:style-name="center">
  388. <text:span text:style-name="bold">
  389. <xsl:choose>
  390. <!-- Hungarian: "1. Figure " -->
  391. <xsl:when test="((string-length($ancestorlang) = 5 and contains($ancestorlang,'hu-hu')) or
  392. (string-length($ancestorlang) = 2 and contains($ancestorlang,'hu')) )">
  393. <xsl:value-of select="$fig-count-actual"/>
  394. <xsl:text>. </xsl:text>
  395. <xsl:call-template name="getVariable">
  396. <xsl:with-param name="id" select="'Figure'"/>
  397. </xsl:call-template><xsl:text> </xsl:text>
  398. </xsl:when>
  399. <xsl:otherwise>
  400. <xsl:call-template name="getVariable">
  401. <xsl:with-param name="id" select="'Figure'"/>
  402. </xsl:call-template>
  403. <xsl:text> </xsl:text>
  404. <xsl:value-of select="$fig-count-actual"/>
  405. <xsl:text>. </xsl:text>
  406. </xsl:otherwise>
  407. </xsl:choose>
  408. <xsl:value-of select="."/>
  409. </text:span>
  410. </text:span>
  411. </xsl:template>
  412. <xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/desc ')]" priority="2">
  413. <text:span>
  414. <xsl:apply-templates/>
  415. </text:span>
  416. <text:line-break/>
  417. </xsl:template>
  418. <!-- =========== block things ============ -->
  419. <xsl:template match="*[contains(@class,' topic/p ')]">
  420. <xsl:choose>
  421. <!-- nested by body or list -->
  422. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  423. parent::*[contains(@class, ' topic/li ')] or
  424. parent::*[contains(@class, ' topic/sli ')]">
  425. <text:p text:style-name="indent_paragraph_style">
  426. <text:span>
  427. <!-- start add flagging styles -->
  428. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  429. <xsl:apply-templates/>
  430. <!-- end add flagging styles -->
  431. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  432. </text:span>
  433. </text:p>
  434. </xsl:when>
  435. <!-- nested by entry -->
  436. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  437. <!-- create p tag -->
  438. <text:p>
  439. <!-- alignment styles -->
  440. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  441. <xsl:call-template name="set_align_value"/>
  442. </xsl:if>
  443. <text:span>
  444. <!-- start add flagging styles -->
  445. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  446. <!-- cell belongs to thead -->
  447. <xsl:choose>
  448. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  449. <text:span text:style-name="bold">
  450. <xsl:apply-templates/>
  451. </text:span>
  452. </xsl:when>
  453. <xsl:otherwise>
  454. <xsl:apply-templates/>
  455. </xsl:otherwise>
  456. </xsl:choose>
  457. <!-- end add flagging styles -->
  458. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  459. </text:span>
  460. </text:p>
  461. </xsl:when>
  462. <!-- nested by stentry -->
  463. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  464. <text:p>
  465. <!-- cell belongs to sthead -->
  466. <xsl:choose>
  467. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  468. <xsl:attribute name="text:style-name">bold_paragraph</xsl:attribute>
  469. <text:span>
  470. <!-- start add flagging styles -->
  471. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  472. <xsl:apply-templates/>
  473. <!-- end add flagging styles -->
  474. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  475. </text:span>
  476. </xsl:when>
  477. <xsl:otherwise>
  478. <text:span>
  479. <!-- start add flagging styles -->
  480. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  481. <xsl:apply-templates/>
  482. <!-- end add flagging styles -->
  483. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  484. </text:span>
  485. </xsl:otherwise>
  486. </xsl:choose>
  487. </text:p>
  488. </xsl:when>
  489. <!-- nested by other tags -->
  490. <xsl:otherwise>
  491. <!-- imitate a paragraph -->
  492. <text:line-break/>
  493. <text:span>
  494. <text:span>
  495. <!-- start add flagging styles -->
  496. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  497. <xsl:apply-templates/>
  498. <!-- end add flagging styles -->
  499. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  500. </text:span>
  501. </text:span>
  502. </xsl:otherwise>
  503. </xsl:choose>
  504. </xsl:template>
  505. <xsl:template match="*[contains(@class, ' topic/ph ')]">
  506. <xsl:choose>
  507. <!-- nested by list -->
  508. <xsl:when test=" parent::*[contains(@class, ' topic/li ')] or
  509. parent::*[contains(@class, ' topic/sli ')]">
  510. <text:p>
  511. <text:span>
  512. <!-- start add rev flagging styles -->
  513. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  514. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  515. <xsl:apply-templates/>
  516. <!-- end add rev flagging styles -->
  517. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  518. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  519. </text:span>
  520. </text:p>
  521. </xsl:when>
  522. <!-- nested by entry -->
  523. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  524. <!-- create p tag -->
  525. <text:p>
  526. <!-- alignment styles -->
  527. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  528. <xsl:call-template name="set_align_value"/>
  529. </xsl:if>
  530. <text:span>
  531. <!-- start add rev flagging styles -->
  532. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  533. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  534. <!-- cell belongs to thead -->
  535. <xsl:choose>
  536. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  537. <text:span text:style-name="bold">
  538. <xsl:apply-templates/>
  539. </text:span>
  540. </xsl:when>
  541. <xsl:otherwise>
  542. <xsl:apply-templates/>
  543. </xsl:otherwise>
  544. </xsl:choose>
  545. <!-- end add rev flagging styles -->
  546. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  547. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  548. </text:span>
  549. </text:p>
  550. </xsl:when>
  551. <!-- nested by stentry -->
  552. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  553. <text:p>
  554. <!-- cell belongs to sthead -->
  555. <xsl:choose>
  556. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  557. <xsl:attribute name="text:style-name">bold_paragraph</xsl:attribute>
  558. <text:span>
  559. <!-- start add rev flagging styles -->
  560. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  561. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  562. <xsl:apply-templates/>
  563. <!-- end add rev flagging styles -->
  564. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  565. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  566. </text:span>
  567. </xsl:when>
  568. <xsl:otherwise>
  569. <text:span>
  570. <!-- start add rev flagging styles -->
  571. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  572. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  573. <xsl:apply-templates/>
  574. <!-- end add rev flagging styles -->
  575. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  576. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  577. </text:span>
  578. </xsl:otherwise>
  579. </xsl:choose>
  580. </text:p>
  581. </xsl:when>
  582. <!-- nested by other tags -->
  583. <xsl:otherwise>
  584. <text:span>
  585. <text:span>
  586. <!-- start add rev flagging styles -->
  587. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  588. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  589. <xsl:apply-templates/>
  590. <!-- end add rev flagging styles -->
  591. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  592. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  593. </text:span>
  594. </text:span>
  595. </xsl:otherwise>
  596. </xsl:choose>
  597. </xsl:template>
  598. <xsl:template match="*[contains(@class, ' topic/keyword ')]">
  599. <xsl:choose>
  600. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or
  601. parent::*[contains(@class, ' topic/sli ')]">
  602. <text:p>
  603. <text:span>
  604. <!-- start add rev flagging styles -->
  605. <xsl:apply-templates select="." mode="start-add-odt-flags">
  606. <xsl:with-param name="type" select="'keyword'"/>
  607. </xsl:apply-templates>
  608. <xsl:apply-templates/>
  609. <!-- end add rev flagging styles -->
  610. <xsl:apply-templates select="." mode="end-add-odt-flags">
  611. <xsl:with-param name="type" select="'keyword'"/>
  612. </xsl:apply-templates>
  613. </text:span>
  614. </text:p>
  615. </xsl:when>
  616. <!-- nested by entry -->
  617. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  618. <!-- create p tag -->
  619. <text:p>
  620. <!-- alignment styles -->
  621. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  622. <xsl:call-template name="set_align_value"/>
  623. </xsl:if>
  624. <text:span>
  625. <!-- start add rev flagging styles -->
  626. <xsl:apply-templates select="." mode="start-add-odt-flags">
  627. <xsl:with-param name="type" select="'keyword'"/>
  628. </xsl:apply-templates>
  629. <xsl:apply-templates/>
  630. <!-- end add rev flagging styles -->
  631. <xsl:apply-templates select="." mode="end-add-odt-flags">
  632. <xsl:with-param name="type" select="'keyword'"/>
  633. </xsl:apply-templates>
  634. </text:span>
  635. </text:p>
  636. </xsl:when>
  637. <!-- nested by stentry -->
  638. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  639. <text:p>
  640. <text:span>
  641. <!-- start add rev flagging styles -->
  642. <xsl:apply-templates select="." mode="start-add-odt-flags">
  643. <xsl:with-param name="type" select="'keyword'"/>
  644. </xsl:apply-templates>
  645. <xsl:apply-templates/>
  646. <!-- end add rev flagging styles -->
  647. <xsl:apply-templates select="." mode="end-add-odt-flags">
  648. <xsl:with-param name="type" select="'keyword'"/>
  649. </xsl:apply-templates>
  650. </text:span>
  651. </text:p>
  652. </xsl:when>
  653. <xsl:otherwise>
  654. <text:span>
  655. <!-- start add rev flagging styles -->
  656. <xsl:apply-templates select="." mode="start-add-odt-flags">
  657. <xsl:with-param name="type" select="'keyword'"/>
  658. </xsl:apply-templates>
  659. <xsl:apply-templates/>
  660. <!-- end add rev flagging styles -->
  661. <xsl:apply-templates select="." mode="end-add-odt-flags">
  662. <xsl:with-param name="type" select="'keyword'"/>
  663. </xsl:apply-templates>
  664. </text:span>
  665. </xsl:otherwise>
  666. </xsl:choose>
  667. </xsl:template>
  668. <!-- lines tag -->
  669. <xsl:template match="*[contains(@class,' topic/lines ')]">
  670. <xsl:choose>
  671. <!-- nested by body, li -->
  672. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  673. parent::*[contains(@class, ' topic/li ')] or
  674. parent::*[contains(@class, ' topic/sli ')]">
  675. <!-- start add flagging images -->
  676. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  677. <text:p>
  678. <text:span>
  679. <!-- add flagging styles -->
  680. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  681. <xsl:apply-templates/>
  682. </text:span>
  683. </text:p>
  684. <!-- end add flagging images -->
  685. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  686. </xsl:when>
  687. <!-- nested by entry -->
  688. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  689. <!-- start add flagging images -->
  690. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  691. <!-- create p tag -->
  692. <text:p>
  693. <!-- alignment styles -->
  694. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  695. <xsl:call-template name="set_align_value"/>
  696. </xsl:if>
  697. <!-- cell belongs to thead -->
  698. <xsl:choose>
  699. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  700. <text:span text:style-name="bold">
  701. <text:span>
  702. <!-- start add flagging styles -->
  703. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  704. <xsl:apply-templates/>
  705. </text:span>
  706. </text:span>
  707. </xsl:when>
  708. <xsl:otherwise>
  709. <text:span>
  710. <!-- start add flagging styles -->
  711. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  712. <xsl:apply-templates/>
  713. </text:span>
  714. </xsl:otherwise>
  715. </xsl:choose>
  716. </text:p>
  717. <!-- end add flagging images -->
  718. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  719. </xsl:when>
  720. <!-- nested by stentry -->
  721. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  722. <!-- start add flagging images -->
  723. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  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>
  730. <!-- add flagging styles -->
  731. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  732. <xsl:apply-templates/>
  733. </text:span>
  734. </text:span>
  735. </xsl:when>
  736. <xsl:otherwise>
  737. <text:span>
  738. <!-- add flagging styles -->
  739. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  740. <xsl:apply-templates/>
  741. </text:span>
  742. </xsl:otherwise>
  743. </xsl:choose>
  744. </text:p>
  745. <!-- end add flagging images -->
  746. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  747. </xsl:when>
  748. <!-- other tags -->
  749. <xsl:otherwise>
  750. <text:span>
  751. <text:span>
  752. <!-- start add flagging styles -->
  753. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  754. <xsl:apply-templates/>
  755. <!-- end add flagging styles -->
  756. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  757. </text:span>
  758. <text:line-break/>
  759. </text:span>
  760. </xsl:otherwise>
  761. </xsl:choose>
  762. </xsl:template>
  763. <xsl:template match="*[contains(@class, ' topic/pre ')]">
  764. <xsl:choose>
  765. <!-- nested by body, li -->
  766. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  767. parent::*[contains(@class, ' topic/li ')] or
  768. parent::*[contains(@class, ' topic/sli ')]">
  769. <!-- start add flagging images -->
  770. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  771. <text:p text:style-name="Code_Style_Paragraph">
  772. <text:span>
  773. <!-- add flagging styles -->
  774. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  775. <xsl:apply-templates/>
  776. </text:span>
  777. </text:p>
  778. <!-- end add flagging images -->
  779. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  780. </xsl:when>
  781. <!-- nested by entry -->
  782. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  783. <!-- start add flagging images -->
  784. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  785. <!-- create p tag -->
  786. <text:p>
  787. <!-- alignment styles -->
  788. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  789. <xsl:call-template name="set_align_value"/>
  790. </xsl:if>
  791. <!-- cell belongs to thead -->
  792. <xsl:choose>
  793. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  794. <text:span text:style-name="bold">
  795. <text:span>
  796. <!-- add flagging styles -->
  797. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  798. <xsl:apply-templates/>
  799. </text:span>
  800. </text:span>
  801. </xsl:when>
  802. <xsl:otherwise>
  803. <text:span>
  804. <!-- add flagging styles -->
  805. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  806. <xsl:apply-templates/>
  807. </text:span>
  808. </xsl:otherwise>
  809. </xsl:choose>
  810. </text:p>
  811. <!-- end add flagging images -->
  812. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  813. </xsl:when>
  814. <!-- nested by stentry -->
  815. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  816. <!-- start add flagging images -->
  817. <xsl:apply-templates select="." mode="start-add-odt-imgrevflags"/>
  818. <text:p>
  819. <!-- cell belongs to sthead -->
  820. <xsl:choose>
  821. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  822. <text:span text:style-name="bold">
  823. <text:span>
  824. <!-- add flagging styles -->
  825. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  826. <xsl:apply-templates/>
  827. </text:span>
  828. </text:span>
  829. </xsl:when>
  830. <xsl:otherwise>
  831. <text:span>
  832. <!-- add flagging styles -->
  833. <xsl:apply-templates select="." mode="add-odt-flagging"/>
  834. <xsl:apply-templates/>
  835. </text:span>
  836. </xsl:otherwise>
  837. </xsl:choose>
  838. </text:p>
  839. <!-- end add flagging images -->
  840. <xsl:apply-templates select="." mode="end-add-odt-imgrevflags"/>
  841. </xsl:when>
  842. <!-- other tags -->
  843. <xsl:otherwise>
  844. <text:span text:style-name="Code_Text">
  845. <!-- start add flagging styles -->
  846. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  847. <xsl:apply-templates/>
  848. <!-- end add flagging styles -->
  849. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  850. </text:span>
  851. <text:line-break/>
  852. </xsl:otherwise>
  853. </xsl:choose>
  854. </xsl:template>
  855. <!-- phrases -->
  856. <xsl:template match="*[contains(@class,' hi-d/tt ')]">
  857. <text:span text:style-name="bold">
  858. <xsl:apply-templates/>
  859. </text:span>
  860. </xsl:template>
  861. <xsl:template match="*[contains(@class,' topic/q ')]">
  862. <xsl:choose>
  863. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or
  864. parent::*[contains(@class, ' topic/sli ')]">
  865. <text:p>
  866. <text:span>
  867. <!-- start add rev flagging styles -->
  868. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  869. <xsl:call-template name="create_q_content"/>
  870. <!-- end add rev flagging styles -->
  871. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  872. </text:span>
  873. </text:p>
  874. </xsl:when>
  875. <!-- nested by entry -->
  876. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  877. <!-- create p tag -->
  878. <text:p>
  879. <!-- alignment styles -->
  880. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  881. <xsl:call-template name="set_align_value"/>
  882. </xsl:if>
  883. <!-- cell belongs to thead -->
  884. <xsl:choose>
  885. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  886. <text:span text:style-name="bold">
  887. <text:span>
  888. <!-- start add rev flagging styles -->
  889. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  890. <xsl:call-template name="create_q_content"/>
  891. <!-- end add rev flagging styles -->
  892. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  893. </text:span>
  894. </text:span>
  895. </xsl:when>
  896. <xsl:otherwise>
  897. <text:span>
  898. <!-- start add rev flagging styles -->
  899. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  900. <xsl:call-template name="create_q_content"/>
  901. <!-- end add rev flagging styles -->
  902. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  903. </text:span>
  904. </xsl:otherwise>
  905. </xsl:choose>
  906. </text:p>
  907. </xsl:when>
  908. <!-- nested by stentry -->
  909. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  910. <text:p>
  911. <!-- cell belongs to sthead -->
  912. <xsl:choose>
  913. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  914. <text:span text:style-name="bold">
  915. <text:span>
  916. <!-- start add rev flagging styles -->
  917. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  918. <xsl:call-template name="create_q_content"/>
  919. <!-- end add rev flagging styles -->
  920. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  921. </text:span>
  922. </text:span>
  923. </xsl:when>
  924. <xsl:otherwise>
  925. <text:span>
  926. <!-- start add rev flagging styles -->
  927. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  928. <xsl:call-template name="create_q_content"/>
  929. <!-- end add rev flagging styles -->
  930. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  931. </text:span>
  932. </xsl:otherwise>
  933. </xsl:choose>
  934. </text:p>
  935. </xsl:when>
  936. <!-- nested by other tags -->
  937. <xsl:otherwise>
  938. <text:span>
  939. <!-- start add rev flagging styles -->
  940. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  941. <xsl:call-template name="create_q_content"/>
  942. <!-- end add rev flagging styles -->
  943. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  944. </text:span>
  945. </xsl:otherwise>
  946. </xsl:choose>
  947. </xsl:template>
  948. <xsl:template name="create_q_content">
  949. <xsl:variable name="style_name">
  950. <xsl:call-template name="get_style_name"/>
  951. </xsl:variable>
  952. <xsl:variable name="trueStyleName" select="styleUtils:getHiStyleName($style_name)"/>
  953. <text:span>
  954. <xsl:if test="$trueStyleName!=''">
  955. <xsl:attribute name="text:style-name">
  956. <xsl:value-of select="$trueStyleName"/>
  957. </xsl:attribute>
  958. </xsl:if>
  959. <xsl:call-template name="getVariable">
  960. <xsl:with-param name="id" select="'OpenQuote'"/>
  961. </xsl:call-template>
  962. <xsl:apply-templates/>
  963. <xsl:call-template name="getVariable">
  964. <xsl:with-param name="id" select="'CloseQuote'"/>
  965. </xsl:call-template>
  966. </text:span>
  967. </xsl:template>
  968. <!-- named template library -->
  969. <xsl:template name="br-replace">
  970. <xsl:param name="word"/>
  971. <!-- </xsl:text> on next line on purpose to get newline -->
  972. <xsl:variable name="cr">
  973. <xsl:text>\n
  974. </xsl:text>
  975. </xsl:variable>
  976. <xsl:choose>
  977. <xsl:when test="contains($word,$cr)">
  978. <xsl:value-of select="substring-before($word,$cr)"/>
  979. <br/>
  980. <xsl:call-template name="br-replace">
  981. <xsl:with-param name="word" select="substring-after($word,$cr)"/>
  982. </xsl:call-template>
  983. </xsl:when>
  984. <xsl:otherwise>
  985. <xsl:value-of select="$word"/>
  986. </xsl:otherwise>
  987. </xsl:choose>
  988. </xsl:template>
  989. <!-- standard RTF library mapped to formatting objects -->
  990. <!--e.g
  991. <text:h text:style-name="Heading_20_1" text:outline-level="1">
  992. <text:bookmark text:name="aaa"/>Topic 01
  993. </text:h>
  994. -->
  995. <xsl:template name="block-title">
  996. <xsl:param name="depth" as="xs:integer"/>
  997. <text:h text:outline-level="{$depth}">
  998. <xsl:choose>
  999. <xsl:when test="$depth = 1">
  1000. <xsl:attribute name="text:style-name">Heading_20_1</xsl:attribute>
  1001. <!-- create start bookmark -->
  1002. <xsl:call-template name="gen-bookmark">
  1003. <xsl:with-param name="flag" select="0"/>
  1004. </xsl:call-template>
  1005. <xsl:apply-templates/>
  1006. </xsl:when>
  1007. <xsl:when test="$depth = 2 ">
  1008. <xsl:attribute name="text:style-name">Heading_20_2</xsl:attribute>
  1009. <!-- create start bookmark -->
  1010. <xsl:call-template name="gen-bookmark">
  1011. <xsl:with-param name="flag" select="0"/>
  1012. </xsl:call-template>
  1013. <xsl:apply-templates/>
  1014. </xsl:when>
  1015. <xsl:when test="$depth = 3">
  1016. <xsl:attribute name="text:style-name">Heading_20_3</xsl:attribute>
  1017. <!-- create start bookmark -->
  1018. <xsl:call-template name="gen-bookmark">
  1019. <xsl:with-param name="flag" select="0"/>
  1020. </xsl:call-template>
  1021. <xsl:apply-templates/>
  1022. </xsl:when>
  1023. <xsl:when test="$depth = 4">
  1024. <xsl:attribute name="text:style-name">Heading_20_4</xsl:attribute>
  1025. <!-- create start bookmark -->
  1026. <xsl:call-template name="gen-bookmark">
  1027. <xsl:with-param name="flag" select="0"/>
  1028. </xsl:call-template>
  1029. <xsl:apply-templates/>
  1030. </xsl:when>
  1031. <xsl:when test="$depth = 5">
  1032. <xsl:attribute name="text:style-name">Heading_20_5</xsl:attribute>
  1033. <!-- create start bookmark -->
  1034. <xsl:call-template name="gen-bookmark">
  1035. <xsl:with-param name="flag" select="0"/>
  1036. </xsl:call-template>
  1037. <xsl:apply-templates/>
  1038. </xsl:when>
  1039. <xsl:otherwise>
  1040. <xsl:attribute name="text:style-name">Heading_20_6</xsl:attribute>
  1041. <!-- create start bookmark -->
  1042. <xsl:call-template name="gen-bookmark">
  1043. <xsl:with-param name="flag" select="0"/>
  1044. </xsl:call-template>
  1045. <xsl:apply-templates/>
  1046. </xsl:otherwise>
  1047. </xsl:choose>
  1048. <!-- create end bookmark -->
  1049. <xsl:call-template name="gen-bookmark">
  1050. <xsl:with-param name="flag" select="1"/>
  1051. </xsl:call-template>
  1052. </text:h>
  1053. </xsl:template>
  1054. <!-- font-weight="bold" -->
  1055. <xsl:template name="inline-em">
  1056. <text:span text:style-name="bold">
  1057. <xsl:apply-templates/>
  1058. </text:span>
  1059. </xsl:template>
  1060. <!-- font-size="24pt"
  1061. font-weight="bold"
  1062. space-before.optimum="16pt"
  1063. space-after.optimum="12pt" -->
  1064. <xsl:template name="block-title-h1">
  1065. <xsl:attribute name="text:style-name">Heading_20_1</xsl:attribute>
  1066. <xsl:apply-templates/>
  1067. </xsl:template>
  1068. <!-- font-size="16pt"
  1069. font-weight="bold"
  1070. space-before.optimum="14pt"
  1071. space-after.optimum="14pt" \pard\li720\fi-360-->
  1072. <xsl:template name="block-title-h2">
  1073. <xsl:attribute name="text:style-name">Heading_20_2</xsl:attribute>
  1074. <xsl:apply-templates/>
  1075. </xsl:template>
  1076. <xsl:template name="block-title-h3">
  1077. <xsl:attribute name="text:style-name">Heading_20_3</xsl:attribute>
  1078. <xsl:apply-templates/>
  1079. </xsl:template>
  1080. <xsl:template name="block-title-h4">
  1081. <xsl:attribute name="text:style-name">Heading_20_4</xsl:attribute>
  1082. <xsl:apply-templates/>
  1083. </xsl:template>
  1084. <xsl:template name="block-title-h5">
  1085. <xsl:attribute name="text:style-name">Heading_20_5</xsl:attribute>
  1086. <xsl:apply-templates/>
  1087. </xsl:template>
  1088. <xsl:template name="block-title-h6">
  1089. <xsl:attribute name="text:style-name">Heading_20_6</xsl:attribute>
  1090. <xsl:apply-templates/>
  1091. </xsl:template>
  1092. <xsl:template name="block-pre">
  1093. <xsl:if test="ancestor::*[contains(@class,' topic/table ') or contains(@class,' topic/simpletable ')]"/>
  1094. <!-- Tagsmiths: make the inserted space conditional, suppressing it for first p in li -->
  1095. <xsl:if test="parent::*[not(contains(@class,' topic/li '))] or position() != 1"/>
  1096. <xsl:choose>
  1097. <xsl:when test="parent::*[contains(@class, ' topic/linkinfo ')]">
  1098. <!--
  1099. <xsl:element name="text:p">
  1100. <xsl:apply-templates/>
  1101. </xsl:element>
  1102. -->
  1103. <xsl:apply-templates/>
  1104. </xsl:when>
  1105. <xsl:otherwise>
  1106. <xsl:apply-templates/>
  1107. </xsl:otherwise>
  1108. </xsl:choose>
  1109. <!-- Tagsmiths: make the next rtf string conditional, suppressing it for first p in li -->
  1110. <xsl:if test="parent::*[not(contains(@class,' topic/li '))] or position() != 1"/>
  1111. </xsl:template>
  1112. <xsl:template match="*[contains(@class,' topic/lq ')]" name="topic.lq">
  1113. <xsl:variable name="samefile">
  1114. <xsl:choose>
  1115. <xsl:when test="@href and starts-with(@href,'#')">
  1116. <xsl:value-of select="'true'"/>
  1117. </xsl:when>
  1118. <xsl:otherwise>
  1119. <xsl:value-of select="'false'"/>
  1120. </xsl:otherwise>
  1121. </xsl:choose>
  1122. </xsl:variable>
  1123. <xsl:variable name="href-value">
  1124. <xsl:choose>
  1125. <xsl:when test="@href and starts-with(@href,'#')">
  1126. <xsl:choose>
  1127. <xsl:when test="contains(@href,'/')">
  1128. <xsl:value-of select="concat('#', substring-after(@href,'/'))"/>
  1129. </xsl:when>
  1130. <xsl:otherwise>
  1131. <xsl:value-of select="@href"/>
  1132. </xsl:otherwise>
  1133. </xsl:choose>
  1134. </xsl:when>
  1135. <xsl:when test="@href and contains(@href,'#')">
  1136. <xsl:value-of select="substring-before(@href,'#')"/>
  1137. </xsl:when>
  1138. <xsl:when test="@href and not(@href='')">
  1139. <xsl:value-of select="@href"/>
  1140. </xsl:when>
  1141. </xsl:choose>
  1142. </xsl:variable>
  1143. <xsl:choose>
  1144. <!-- parent is body & li -->
  1145. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  1146. <text:p>
  1147. <text:span>
  1148. <!-- start add flagging styles -->
  1149. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1150. <xsl:apply-templates/>
  1151. <xsl:call-template name="create_lq_content">
  1152. <xsl:with-param name="samefile" select="$samefile"/>
  1153. <xsl:with-param name="href-value" select="$href-value"/>
  1154. </xsl:call-template>
  1155. <!-- end add flagging styles -->
  1156. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1157. </text:span>
  1158. </text:p>
  1159. </xsl:when>
  1160. <!-- nested by entry -->
  1161. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  1162. <!-- create p tag -->
  1163. <text:p>
  1164. <!-- alignment styles -->
  1165. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  1166. <xsl:call-template name="set_align_value"/>
  1167. </xsl:if>
  1168. <!-- cell belongs to thead -->
  1169. <xsl:choose>
  1170. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  1171. <text:span text:style-name="bold">
  1172. <text:span>
  1173. <!-- start add flagging styles -->
  1174. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1175. <xsl:apply-templates/>
  1176. <xsl:call-template name="create_lq_content">
  1177. <xsl:with-param name="samefile" select="$samefile"/>
  1178. <xsl:with-param name="href-value" select="$href-value"/>
  1179. </xsl:call-template>
  1180. <!-- start add flagging styles -->
  1181. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1182. </text:span>
  1183. </text:span>
  1184. </xsl:when>
  1185. <xsl:otherwise>
  1186. <text:span>
  1187. <!-- start add flagging styles -->
  1188. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1189. <xsl:apply-templates/>
  1190. <xsl:call-template name="create_lq_content">
  1191. <xsl:with-param name="samefile" select="$samefile"/>
  1192. <xsl:with-param name="href-value" select="$href-value"/>
  1193. </xsl:call-template>
  1194. <!-- end add flagging styles -->
  1195. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1196. </text:span>
  1197. </xsl:otherwise>
  1198. </xsl:choose>
  1199. </text:p>
  1200. </xsl:when>
  1201. <!-- nested by stentry -->
  1202. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  1203. <text:p>
  1204. <!-- cell belongs to sthead -->
  1205. <xsl:choose>
  1206. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  1207. <text:span text:style-name="bold">
  1208. <text:span>
  1209. <!-- start add flagging styles -->
  1210. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1211. <xsl:apply-templates/>
  1212. <xsl:call-template name="create_lq_content">
  1213. <xsl:with-param name="samefile" select="$samefile"/>
  1214. <xsl:with-param name="href-value" select="$href-value"/>
  1215. </xsl:call-template>
  1216. <!-- end add flagging styles -->
  1217. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1218. </text:span>
  1219. </text:span>
  1220. </xsl:when>
  1221. <xsl:otherwise>
  1222. <text:span>
  1223. <!-- start add flagging styles -->
  1224. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1225. <xsl:apply-templates/>
  1226. <xsl:call-template name="create_lq_content">
  1227. <xsl:with-param name="samefile" select="$samefile"/>
  1228. <xsl:with-param name="href-value" select="$href-value"/>
  1229. </xsl:call-template>
  1230. <!-- end add flagging styles -->
  1231. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1232. </text:span>
  1233. </xsl:otherwise>
  1234. </xsl:choose>
  1235. </text:p>
  1236. </xsl:when>
  1237. <!-- other tags -->
  1238. <xsl:otherwise>
  1239. <text:span>
  1240. <text:span>
  1241. <!-- start add flagging styles -->
  1242. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1243. <xsl:apply-templates/>
  1244. <xsl:call-template name="create_lq_content">
  1245. <xsl:with-param name="samefile" select="$samefile"/>
  1246. <xsl:with-param name="href-value" select="$href-value"/>
  1247. </xsl:call-template>
  1248. <!-- end add flagging styles -->
  1249. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1250. </text:span>
  1251. </text:span>
  1252. </xsl:otherwise>
  1253. </xsl:choose>
  1254. </xsl:template>
  1255. <xsl:template name="create_lq_content">
  1256. <xsl:param name="samefile" select="''"/>
  1257. <xsl:param name="href-value" select="''"/>
  1258. <xsl:choose>
  1259. <xsl:when test="@href and not(@href='')">
  1260. <text:line-break/>
  1261. <!-- Insert citation as link, use @href as-is -->
  1262. <text:span text:style-name="right">
  1263. <text:a>
  1264. <xsl:choose>
  1265. <xsl:when test="$samefile='true'">
  1266. <xsl:attribute name="xlink:href">
  1267. <xsl:value-of select="$href-value"/>
  1268. </xsl:attribute>
  1269. </xsl:when>
  1270. <xsl:otherwise>
  1271. <xsl:variable name="NORMAMLIZEDOUTPUT" select="translate($OUTPUTDIR, '\', '/')"/>
  1272. <xsl:attribute name="xlink:href">
  1273. <xsl:value-of select="concat($FILEREF, $NORMAMLIZEDOUTPUT, '/', $href-value)"/>
  1274. </xsl:attribute>
  1275. </xsl:otherwise>
  1276. </xsl:choose>
  1277. <xsl:choose>
  1278. <xsl:when test="@reftitle">
  1279. <xsl:value-of select="@reftitle"/>
  1280. </xsl:when>
  1281. <xsl:otherwise>
  1282. <xsl:value-of select="@href"/>
  1283. </xsl:otherwise>
  1284. </xsl:choose>
  1285. </text:a>
  1286. </text:span>
  1287. </xsl:when>
  1288. <xsl:when test="@reftitle and not(@reftitle='')">
  1289. <text:line-break/>
  1290. <!-- Insert citation text -->
  1291. <text:span>
  1292. <xsl:value-of select="@reftitle"/>
  1293. </text:span>
  1294. </xsl:when>
  1295. <xsl:otherwise><!--nop - do nothing--></xsl:otherwise>
  1296. </xsl:choose>
  1297. </xsl:template>
  1298. <!-- generate bookmark with parent's topic id -->
  1299. <xsl:template name="gen-bookmark">
  1300. <xsl:param name="flag"/>
  1301. <xsl:if test="parent::*[contains(@class, ' topic/topic ')]/@id">
  1302. <xsl:variable name="id" select="parent::*[contains(@class, ' topic/topic ')]/@id"/>
  1303. <xsl:choose>
  1304. <!-- if $flag is 0 create bookmark-start -->
  1305. <xsl:when test="$flag = 0">
  1306. <text:bookmark-start text:name="{$id}">
  1307. </text:bookmark-start>
  1308. </xsl:when>
  1309. <!-- otherwise create bookmark-end -->
  1310. <xsl:otherwise>
  1311. <text:bookmark-end text:name="{$id}">
  1312. </text:bookmark-end>
  1313. </xsl:otherwise>
  1314. </xsl:choose>
  1315. </xsl:if>
  1316. </xsl:template>
  1317. <xsl:template match="*[contains(@class,' topic/cite ')]">
  1318. <xsl:choose>
  1319. <!-- parent is list -->
  1320. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  1321. <text:p>
  1322. <text:span text:style-name="italic">
  1323. <xsl:apply-templates/>
  1324. </text:span>
  1325. </text:p>
  1326. </xsl:when>
  1327. <!-- nested by entry -->
  1328. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  1329. <!-- create p tag -->
  1330. <text:p>
  1331. <!-- alignment styles -->
  1332. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  1333. <xsl:call-template name="set_align_value"/>
  1334. </xsl:if>
  1335. <!-- cell belongs to thead -->
  1336. <xsl:choose>
  1337. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  1338. <text:span text:style-name="bold">
  1339. <text:span text:style-name="italic">
  1340. <xsl:apply-templates/>
  1341. </text:span>
  1342. </text:span>
  1343. </xsl:when>
  1344. <xsl:otherwise>
  1345. <text:span text:style-name="italic">
  1346. <xsl:apply-templates/>
  1347. </text:span>
  1348. </xsl:otherwise>
  1349. </xsl:choose>
  1350. </text:p>
  1351. </xsl:when>
  1352. <!-- nested by stentry -->
  1353. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  1354. <text:p>
  1355. <!-- cell belongs to sthead -->
  1356. <xsl:choose>
  1357. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  1358. <text:span text:style-name="bold">
  1359. <text:span text:style-name="italic">
  1360. <xsl:apply-templates/>
  1361. </text:span>
  1362. </text:span>
  1363. </xsl:when>
  1364. <xsl:otherwise>
  1365. <text:span text:style-name="italic">
  1366. <xsl:apply-templates/>
  1367. </text:span>
  1368. </xsl:otherwise>
  1369. </xsl:choose>
  1370. </text:p>
  1371. </xsl:when>
  1372. <!-- parent is other tags -->
  1373. <xsl:otherwise>
  1374. <text:span text:style-name="italic">
  1375. <xsl:apply-templates/>
  1376. </text:span>
  1377. </xsl:otherwise>
  1378. </xsl:choose>
  1379. </xsl:template>
  1380. <xsl:template match="*[contains(@class,' topic/desc ')]" priority="0">
  1381. <text:span>
  1382. <!--
  1383. <xsl:apply-templates select="text()"/>
  1384. -->
  1385. <xsl:apply-templates/>
  1386. </text:span>
  1387. <!--
  1388. <xsl:apply-templates select="child::*[@class]"/>
  1389. -->
  1390. </xsl:template>
  1391. <xsl:template match="*[contains(@class,' topic/prolog ')]"/>
  1392. <xsl:template match="*[contains(@class,' topic/titlealts ')]"/>
  1393. <!-- Added for DITA 1.1 "Shortdesc proposal" -->
  1394. <xsl:template match="*[contains(@class,' topic/abstract ')]" mode="outofline">
  1395. <text:p text:style-name="Default_20_Text">
  1396. <xsl:apply-templates/>
  1397. </text:p>
  1398. </xsl:template>
  1399. <xsl:template match="*[contains(@class,' topic/shortdesc ')]" mode="outofline">
  1400. <xsl:choose>
  1401. <xsl:when test="parent::*[contains(@class, ' topic/abstract ')]">
  1402. <text:span>
  1403. <xsl:apply-templates/>
  1404. </text:span>
  1405. </xsl:when>
  1406. <xsl:otherwise>
  1407. <text:p text:style-name="Default_20_Text">
  1408. <xsl:apply-templates/>
  1409. </text:p>
  1410. </xsl:otherwise>
  1411. </xsl:choose>
  1412. </xsl:template>
  1413. <!-- Added for DITA 1.1 "Shortdesc proposal" -->
  1414. <xsl:template match="*[contains(@class,' topic/abstract ')]">
  1415. <xsl:if test="not(following-sibling::*[contains(@class,' topic/body ')])">
  1416. <xsl:apply-templates select="." mode="outofline"/>
  1417. <xsl:apply-templates select="following-sibling::*[contains(@class,' topic/related-links ')]" mode="prereqs"/>
  1418. </xsl:if>
  1419. </xsl:template>
  1420. <!-- Updated for DITA 1.1 "Shortdesc proposal" -->
  1421. <!-- Added for SF 1363055: Shortdesc disappears when optional body is removed -->
  1422. <xsl:template match="*[contains(@class,' topic/shortdesc ')]">
  1423. <xsl:choose>
  1424. <xsl:when test="parent::*[contains(@class, ' topic/abstract ')]">
  1425. <xsl:apply-templates select="." mode="outofline.abstract"/>
  1426. </xsl:when>
  1427. <xsl:when test="not(following-sibling::*[contains(@class,' topic/body ')])">
  1428. <xsl:apply-templates select="." mode="outofline"/>
  1429. <xsl:apply-templates select="following-sibling::*[contains(@class,' topic/related-links ')]" mode="prereqs"/>
  1430. </xsl:when>
  1431. <xsl:otherwise/>
  1432. </xsl:choose>
  1433. </xsl:template>
  1434. <!-- called shortdesc processing when it is in abstract -->
  1435. <xsl:template match="*[contains(@class,' topic/shortdesc ')]" mode="outofline.abstract">
  1436. <text:span>
  1437. <!-- start add flagging styles -->
  1438. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  1439. <xsl:apply-templates/>
  1440. <!-- end add flagging styles -->
  1441. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  1442. </text:span>
  1443. </xsl:template>
  1444. <xsl:template match="*[contains(@class,' topic/note ')]" name="topic.note" priority="0">
  1445. <xsl:choose>
  1446. <!-- has child tags -->
  1447. <xsl:when test="child::*|text()">
  1448. <xsl:choose>
  1449. <!-- if the parent tag is body or li-->
  1450. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  1451. <text:p text:style-name="indent_paragraph_style">
  1452. <text:span>
  1453. <!-- start add flagging styles -->
  1454. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1455. <xsl:with-param name="type" select="'note'"/>
  1456. </xsl:apply-templates>
  1457. <xsl:choose>
  1458. <!-- for hazardstatement -->
  1459. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1460. <xsl:call-template name="create_hazards_content"/>
  1461. </xsl:when>
  1462. <xsl:otherwise>
  1463. <xsl:call-template name="create_note_content"/>
  1464. </xsl:otherwise>
  1465. </xsl:choose>
  1466. <!-- end add flagging styles -->
  1467. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1468. <xsl:with-param name="type" select="'note'"/>
  1469. </xsl:apply-templates>
  1470. </text:span>
  1471. </text:p>
  1472. </xsl:when>
  1473. <!-- nested by entry -->
  1474. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  1475. <!-- create p tag -->
  1476. <text:p>
  1477. <!-- alignment styles -->
  1478. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  1479. <xsl:call-template name="set_align_value"/>
  1480. </xsl:if>
  1481. <!-- cell belongs to thead -->
  1482. <xsl:choose>
  1483. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  1484. <text:span text:style-name="bold">
  1485. <text:span>
  1486. <!-- start add flagging styles -->
  1487. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1488. <xsl:with-param name="type" select="'note'"/>
  1489. </xsl:apply-templates>
  1490. <xsl:choose>
  1491. <!-- for hazardstatement -->
  1492. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1493. <xsl:call-template name="create_hazards_content"/>
  1494. </xsl:when>
  1495. <xsl:otherwise>
  1496. <xsl:call-template name="create_note_content"/>
  1497. </xsl:otherwise>
  1498. </xsl:choose>
  1499. <!-- end add flagging styles -->
  1500. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1501. <xsl:with-param name="type" select="'note'"/>
  1502. </xsl:apply-templates>
  1503. </text:span>
  1504. </text:span>
  1505. </xsl:when>
  1506. <xsl:otherwise>
  1507. <text:span>
  1508. <!-- start add flagging styles -->
  1509. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1510. <xsl:with-param name="type" select="'note'"/>
  1511. </xsl:apply-templates>
  1512. <xsl:choose>
  1513. <!-- for hazardstatement -->
  1514. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1515. <xsl:call-template name="create_hazards_content"/>
  1516. </xsl:when>
  1517. <xsl:otherwise>
  1518. <xsl:call-template name="create_note_content"/>
  1519. </xsl:otherwise>
  1520. </xsl:choose>
  1521. <!-- end add flagging styles -->
  1522. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1523. <xsl:with-param name="type" select="'note'"/>
  1524. </xsl:apply-templates>
  1525. </text:span>
  1526. </xsl:otherwise>
  1527. </xsl:choose>
  1528. </text:p>
  1529. </xsl:when>
  1530. <!-- nested by stentry -->
  1531. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  1532. <text:p>
  1533. <!-- cell belongs to sthead -->
  1534. <xsl:choose>
  1535. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  1536. <text:span text:style-name="bold">
  1537. <text:span>
  1538. <!-- start add flagging styles -->
  1539. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1540. <xsl:with-param name="type" select="'note'"/>
  1541. </xsl:apply-templates>
  1542. <xsl:choose>
  1543. <!-- for hazardstatement -->
  1544. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1545. <xsl:call-template name="create_hazards_content"/>
  1546. </xsl:when>
  1547. <xsl:otherwise>
  1548. <xsl:call-template name="create_note_content"/>
  1549. </xsl:otherwise>
  1550. </xsl:choose>
  1551. <!-- end add flagging styles -->
  1552. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1553. <xsl:with-param name="type" select="'note'"/>
  1554. </xsl:apply-templates>
  1555. </text:span>
  1556. </text:span>
  1557. </xsl:when>
  1558. <xsl:otherwise>
  1559. <text:span>
  1560. <!-- start add flagging styles -->
  1561. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1562. <xsl:with-param name="type" select="'note'"/>
  1563. </xsl:apply-templates>
  1564. <xsl:choose>
  1565. <!-- for hazardstatement -->
  1566. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1567. <xsl:call-template name="create_hazards_content"/>
  1568. </xsl:when>
  1569. <xsl:otherwise>
  1570. <xsl:call-template name="create_note_content"/>
  1571. </xsl:otherwise>
  1572. </xsl:choose>
  1573. <!-- end add flagging styles -->
  1574. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1575. <xsl:with-param name="type" select="'note'"/>
  1576. </xsl:apply-templates>
  1577. </text:span>
  1578. </xsl:otherwise>
  1579. </xsl:choose>
  1580. </text:p>
  1581. </xsl:when>
  1582. <!-- for other tags -->
  1583. <xsl:otherwise>
  1584. <text:span>
  1585. <text:span>
  1586. <!-- start add flagging styles -->
  1587. <xsl:apply-templates select="." mode="start-add-odt-flags">
  1588. <xsl:with-param name="type" select="'note'"/>
  1589. </xsl:apply-templates>
  1590. <xsl:choose>
  1591. <!-- for hazardstatement -->
  1592. <xsl:when test="contains(@class,' hazard-d/hazardstatement ')">
  1593. <xsl:call-template name="create_hazards_content"/>
  1594. </xsl:when>
  1595. <xsl:otherwise>
  1596. <xsl:call-template name="create_note_content"/>
  1597. </xsl:otherwise>
  1598. </xsl:choose>
  1599. <!-- end add flagging styles -->
  1600. <xsl:apply-templates select="." mode="end-add-odt-flags">
  1601. <xsl:with-param name="type" select="'note'"/>
  1602. </xsl:apply-templates>
  1603. </text:span>
  1604. </text:span>
  1605. <text:line-break/>
  1606. </xsl:otherwise>
  1607. </xsl:choose>
  1608. </xsl:when>
  1609. </xsl:choose>
  1610. </xsl:template>
  1611. <xsl:template name="create_note_content">
  1612. <xsl:choose>
  1613. <xsl:when test="@type='note' or not(@type)">
  1614. <text:span text:style-name="bold">
  1615. <xsl:call-template name="getVariable">
  1616. <xsl:with-param name="id" select="'Note'"/>
  1617. </xsl:call-template>
  1618. <xsl:call-template name="getVariable">
  1619. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1620. </xsl:call-template>
  1621. <xsl:text> </xsl:text>
  1622. </text:span>
  1623. <xsl:if test="ancestor::*[contains(@class,' topic/table ') or contains(@class,' topic/simpletable ')]">
  1624. <text:tab/>
  1625. </xsl:if>
  1626. <text:span>
  1627. <!-- start add rev flagging styles -->
  1628. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1629. <xsl:apply-templates/>
  1630. <!-- end add rev flagging styles -->
  1631. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1632. </text:span>
  1633. </xsl:when>
  1634. <xsl:when test="@type='tip'">
  1635. <text:span text:style-name="bold">
  1636. <xsl:call-template name="getVariable">
  1637. <xsl:with-param name="id" select="'Tip'"/>
  1638. </xsl:call-template>
  1639. <xsl:call-template name="getVariable">
  1640. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1641. </xsl:call-template>
  1642. <xsl:text> </xsl:text>
  1643. </text:span>
  1644. <text:span>
  1645. <!-- start add rev flagging styles -->
  1646. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1647. <xsl:apply-templates/>
  1648. <!-- end add rev flagging styles -->
  1649. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1650. </text:span>
  1651. </xsl:when>
  1652. <xsl:when test="@type='fastpath'">
  1653. <text:span text:style-name="bold">
  1654. <xsl:call-template name="getVariable">
  1655. <xsl:with-param name="id" select="'Fastpath'"/>
  1656. </xsl:call-template>
  1657. <xsl:call-template name="getVariable">
  1658. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1659. </xsl:call-template>
  1660. <xsl:text> </xsl:text>
  1661. </text:span>
  1662. <text:span>
  1663. <!-- start add rev flagging styles -->
  1664. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1665. <xsl:apply-templates/>
  1666. <!-- end add rev flagging styles -->
  1667. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1668. </text:span>
  1669. </xsl:when>
  1670. <xsl:when test="@type='important'">
  1671. <text:span text:style-name="bold">
  1672. <xsl:call-template name="getVariable">
  1673. <xsl:with-param name="id" select="'Important'"/>
  1674. </xsl:call-template>
  1675. <xsl:call-template name="getVariable">
  1676. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1677. </xsl:call-template>
  1678. <xsl:text> </xsl:text>
  1679. </text:span>
  1680. <text:span>
  1681. <!-- start add rev flagging styles -->
  1682. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1683. <xsl:apply-templates/>
  1684. <!-- end add rev flagging styles -->
  1685. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1686. </text:span>
  1687. </xsl:when>
  1688. <xsl:when test="@type='remember'">
  1689. <text:span text:style-name="bold">
  1690. <xsl:call-template name="getVariable">
  1691. <xsl:with-param name="id" select="'Remember'"/>
  1692. </xsl:call-template>
  1693. <xsl:call-template name="getVariable">
  1694. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1695. </xsl:call-template>
  1696. <xsl:text> </xsl:text>
  1697. </text:span>
  1698. <text:span>
  1699. <!-- start add rev flagging styles -->
  1700. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1701. <xsl:apply-templates/>
  1702. <!-- end add rev flagging styles -->
  1703. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1704. </text:span>
  1705. </xsl:when>
  1706. <xsl:when test="@type='restriction'">
  1707. <text:span text:style-name="bold">
  1708. <xsl:call-template name="getVariable">
  1709. <xsl:with-param name="id" select="'Restriction'"/>
  1710. </xsl:call-template>
  1711. <xsl:call-template name="getVariable">
  1712. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1713. </xsl:call-template>
  1714. <xsl:text> </xsl:text>
  1715. </text:span>
  1716. <text:span>
  1717. <!-- start add rev flagging styles -->
  1718. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1719. <xsl:apply-templates/>
  1720. <!-- end add rev flagging styles -->
  1721. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1722. </text:span>
  1723. </xsl:when>
  1724. <xsl:when test="@type='attention'">
  1725. <text:span text:style-name="bold">
  1726. <xsl:call-template name="getVariable">
  1727. <xsl:with-param name="id" select="'Attention'"/>
  1728. </xsl:call-template>
  1729. <xsl:call-template name="getVariable">
  1730. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1731. </xsl:call-template>
  1732. <xsl:text> </xsl:text>
  1733. </text:span>
  1734. <text:span>
  1735. <!-- start add rev flagging styles -->
  1736. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1737. <xsl:apply-templates/>
  1738. <!-- end add rev flagging styles -->
  1739. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1740. </text:span>
  1741. </xsl:when>
  1742. <xsl:when test="@type='caution'">
  1743. <text:span text:style-name="bold">
  1744. <xsl:call-template name="getVariable">
  1745. <xsl:with-param name="id" select="'Caution'"/>
  1746. </xsl:call-template>
  1747. <xsl:call-template name="getVariable">
  1748. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1749. </xsl:call-template>
  1750. <xsl:text> </xsl:text>
  1751. </text:span>
  1752. <text:span>
  1753. <!-- start add rev flagging styles -->
  1754. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1755. <xsl:apply-templates/>
  1756. <!-- end add rev flagging styles -->
  1757. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1758. </text:span>
  1759. </xsl:when>
  1760. <xsl:when test="@type='danger'">
  1761. <text:span text:style-name="bold">
  1762. <xsl:call-template name="getVariable">
  1763. <xsl:with-param name="id" select="'Danger'"/>
  1764. </xsl:call-template>
  1765. <xsl:call-template name="getVariable">
  1766. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1767. </xsl:call-template>
  1768. <xsl:text> </xsl:text>
  1769. </text:span>
  1770. <text:span>
  1771. <!-- start add rev flagging styles -->
  1772. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1773. <xsl:apply-templates/>
  1774. <!-- end add rev flagging styles -->
  1775. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1776. </text:span>
  1777. </xsl:when>
  1778. <xsl:when test="@type='trouble'">
  1779. <text:span text:style-name="bold">
  1780. <xsl:call-template name="getVariable">
  1781. <xsl:with-param name="id" select="'Trouble'"/>
  1782. </xsl:call-template>
  1783. <xsl:call-template name="getVariable">
  1784. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1785. </xsl:call-template>
  1786. <xsl:text> </xsl:text>
  1787. </text:span>
  1788. <text:span>
  1789. <!-- start add rev flagging styles -->
  1790. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1791. <xsl:apply-templates/>
  1792. <!-- end add rev flagging styles -->
  1793. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1794. </text:span>
  1795. </xsl:when>
  1796. <xsl:when test="@type='other'">
  1797. <text:span text:style-name="bold">
  1798. <xsl:choose>
  1799. <xsl:when test="@othertype and not(@othertype='')">
  1800. <xsl:value-of select="@othertype"/>
  1801. </xsl:when>
  1802. <xsl:otherwise>
  1803. <xsl:text>[other]</xsl:text>
  1804. </xsl:otherwise>
  1805. </xsl:choose>
  1806. <xsl:call-template name="getVariable">
  1807. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1808. </xsl:call-template>
  1809. <xsl:text> </xsl:text>
  1810. </text:span>
  1811. <text:span>
  1812. <!-- start add rev flagging styles -->
  1813. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1814. <xsl:apply-templates/>
  1815. <!-- end add rev flagging styles -->
  1816. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1817. </text:span>
  1818. </xsl:when>
  1819. <xsl:otherwise>
  1820. <xsl:apply-templates/>
  1821. </xsl:otherwise>
  1822. </xsl:choose>
  1823. </xsl:template>
  1824. <xsl:template name="create_hazards_content">
  1825. <xsl:choose>
  1826. <xsl:when test="@type='note'">
  1827. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1828. <xsl:call-template name="getVariable">
  1829. <xsl:with-param name="id" select="'Note'"/>
  1830. </xsl:call-template>
  1831. <xsl:call-template name="getVariable">
  1832. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1833. </xsl:call-template>
  1834. <xsl:text> </xsl:text>
  1835. <xsl:if test="ancestor::*[contains(@class,' topic/table ') or contains(@class,' topic/simpletable ')]">
  1836. <text:tab/>
  1837. </xsl:if>
  1838. <text:span>
  1839. <!-- start add rev flagging styles -->
  1840. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1841. <xsl:apply-templates/>
  1842. <!-- end add rev flagging styles -->
  1843. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1844. </text:span>
  1845. </xsl:when>
  1846. <xsl:when test="@type='tip'">
  1847. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1848. <xsl:call-template name="getVariable">
  1849. <xsl:with-param name="id" select="'Tip'"/>
  1850. </xsl:call-template>
  1851. <xsl:call-template name="getVariable">
  1852. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1853. </xsl:call-template>
  1854. <xsl:text> </xsl:text>
  1855. <text:span>
  1856. <!-- start add rev flagging styles -->
  1857. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1858. <xsl:apply-templates/>
  1859. <!-- end add rev flagging styles -->
  1860. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1861. </text:span>
  1862. </xsl:when>
  1863. <xsl:when test="@type='fastpath'">
  1864. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1865. <xsl:call-template name="getVariable">
  1866. <xsl:with-param name="id" select="'Fastpath'"/>
  1867. </xsl:call-template>
  1868. <xsl:call-template name="getVariable">
  1869. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1870. </xsl:call-template>
  1871. <xsl:text> </xsl:text>
  1872. <text:span>
  1873. <!-- start add rev flagging styles -->
  1874. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1875. <xsl:apply-templates/>
  1876. <!-- end add rev flagging styles -->
  1877. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1878. </text:span>
  1879. </xsl:when>
  1880. <xsl:when test="@type='important'">
  1881. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1882. <xsl:call-template name="getVariable">
  1883. <xsl:with-param name="id" select="'Important'"/>
  1884. </xsl:call-template>
  1885. <xsl:call-template name="getVariable">
  1886. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1887. </xsl:call-template>
  1888. <xsl:text> </xsl:text>
  1889. <text:span>
  1890. <!-- start add rev flagging styles -->
  1891. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1892. <xsl:apply-templates/>
  1893. <!-- end add rev flagging styles -->
  1894. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1895. </text:span>
  1896. </xsl:when>
  1897. <xsl:when test="@type='remember'">
  1898. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1899. <xsl:call-template name="getVariable">
  1900. <xsl:with-param name="id" select="'Remember'"/>
  1901. </xsl:call-template>
  1902. <xsl:call-template name="getVariable">
  1903. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1904. </xsl:call-template>
  1905. <xsl:text> </xsl:text>
  1906. <text:span>
  1907. <!-- start add rev flagging styles -->
  1908. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1909. <xsl:apply-templates/>
  1910. <!-- end add rev flagging styles -->
  1911. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1912. </text:span>
  1913. </xsl:when>
  1914. <xsl:when test="@type='restriction'">
  1915. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1916. <xsl:call-template name="getVariable">
  1917. <xsl:with-param name="id" select="'Restriction'"/>
  1918. </xsl:call-template>
  1919. <xsl:call-template name="getVariable">
  1920. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1921. </xsl:call-template>
  1922. <xsl:text> </xsl:text>
  1923. <text:span>
  1924. <!-- start add rev flagging styles -->
  1925. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1926. <xsl:apply-templates/>
  1927. <!-- end add rev flagging styles -->
  1928. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1929. </text:span>
  1930. </xsl:when>
  1931. <xsl:when test="@type='attention'">
  1932. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1933. <xsl:call-template name="getVariable">
  1934. <xsl:with-param name="id" select="'Attention'"/>
  1935. </xsl:call-template>
  1936. <xsl:call-template name="getVariable">
  1937. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1938. </xsl:call-template>
  1939. <xsl:text> </xsl:text>
  1940. <text:span>
  1941. <!-- start add rev flagging styles -->
  1942. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1943. <xsl:apply-templates/>
  1944. <!-- end add rev flagging styles -->
  1945. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1946. </text:span>
  1947. </xsl:when>
  1948. <xsl:when test="@type='caution'">
  1949. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1950. <xsl:call-template name="getVariable">
  1951. <xsl:with-param name="id" select="'Caution'"/>
  1952. </xsl:call-template>
  1953. <xsl:call-template name="getVariable">
  1954. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1955. </xsl:call-template>
  1956. <xsl:text> </xsl:text>
  1957. <text:span>
  1958. <!-- start add rev flagging styles -->
  1959. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1960. <xsl:apply-templates/>
  1961. <!-- end add rev flagging styles -->
  1962. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1963. </text:span>
  1964. </xsl:when>
  1965. <xsl:when test="@type='danger'">
  1966. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1967. <xsl:call-template name="getVariable">
  1968. <xsl:with-param name="id" select="'Danger'"/>
  1969. </xsl:call-template>
  1970. <xsl:call-template name="getVariable">
  1971. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1972. </xsl:call-template>
  1973. <xsl:text> </xsl:text>
  1974. <text:span>
  1975. <!-- start add rev flagging styles -->
  1976. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1977. <xsl:apply-templates/>
  1978. <!-- end add rev flagging styles -->
  1979. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1980. </text:span>
  1981. </xsl:when>
  1982. <xsl:when test="@type='trouble'">
  1983. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  1984. <xsl:call-template name="getVariable">
  1985. <xsl:with-param name="id" select="'Trouble'"/>
  1986. </xsl:call-template>
  1987. <xsl:call-template name="getVariable">
  1988. <xsl:with-param name="id" select="'ColonSymbol'"/>
  1989. </xsl:call-template>
  1990. <xsl:text> </xsl:text>
  1991. <text:span>
  1992. <!-- start add rev flagging styles -->
  1993. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  1994. <xsl:apply-templates/>
  1995. <!-- end add rev flagging styles -->
  1996. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  1997. </text:span>
  1998. </xsl:when>
  1999. <xsl:when test="@type='other'">
  2000. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  2001. <xsl:choose>
  2002. <xsl:when test="@othertype and not(@othertype='')">
  2003. <xsl:value-of select="@othertype"/>
  2004. </xsl:when>
  2005. <xsl:otherwise>
  2006. <xsl:text>[other]</xsl:text>
  2007. </xsl:otherwise>
  2008. </xsl:choose>
  2009. <xsl:call-template name="getVariable">
  2010. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2011. </xsl:call-template>
  2012. <xsl:text> </xsl:text>
  2013. <text:span>
  2014. <!-- start add rev flagging styles -->
  2015. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2016. <xsl:apply-templates/>
  2017. <!-- end add rev flagging styles -->
  2018. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2019. </text:span>
  2020. </xsl:when>
  2021. <xsl:otherwise>
  2022. <xsl:apply-templates/>
  2023. </xsl:otherwise>
  2024. </xsl:choose>
  2025. </xsl:template>
  2026. <xsl:template name="gen-txt1">
  2027. <xsl:param name="txt"/>
  2028. <xsl:choose>
  2029. <xsl:when test="not(contains($txt,'\'))">
  2030. <xsl:call-template name="gen-txt2">
  2031. <xsl:with-param name="txt" select="$txt"/>
  2032. </xsl:call-template>
  2033. </xsl:when>
  2034. <xsl:otherwise>
  2035. <xsl:call-template name="gen-txt2">
  2036. <xsl:with-param name="txt" select="substring-before($txt,'\')"/>
  2037. </xsl:call-template>
  2038. <xsl:text>\</xsl:text>
  2039. <xsl:call-template name="gen-txt1">
  2040. <xsl:with-param name="txt" select="substring-after($txt,'\')"/>
  2041. </xsl:call-template>
  2042. </xsl:otherwise>
  2043. </xsl:choose>
  2044. </xsl:template>
  2045. <xsl:template name="gen-txt2">
  2046. <xsl:param name="txt"/>
  2047. <xsl:choose>
  2048. <xsl:when test="not(contains($txt,'{'))">
  2049. <xsl:call-template name="gen-txt3">
  2050. <xsl:with-param name="txt" select="$txt"/>
  2051. </xsl:call-template>
  2052. </xsl:when>
  2053. <xsl:otherwise>
  2054. <xsl:call-template name="gen-txt3">
  2055. <xsl:with-param name="txt" select="substring-before($txt,'{')"/>
  2056. </xsl:call-template>
  2057. <xsl:text>{</xsl:text>
  2058. <xsl:call-template name="gen-txt2">
  2059. <xsl:with-param name="txt" select="substring-after($txt,'{')"/>
  2060. </xsl:call-template>
  2061. </xsl:otherwise>
  2062. </xsl:choose>
  2063. </xsl:template>
  2064. <xsl:template name="gen-txt3">
  2065. <xsl:param name="txt"/>
  2066. <xsl:choose>
  2067. <xsl:when test="not(contains($txt,'}'))">
  2068. <xsl:call-template name="gen-txt">
  2069. <xsl:with-param name="txt" select="$txt"/>
  2070. </xsl:call-template>
  2071. </xsl:when>
  2072. <xsl:otherwise>
  2073. <xsl:call-template name="gen-txt">
  2074. <xsl:with-param name="txt" select="substring-before($txt,'}')"/>
  2075. </xsl:call-template>
  2076. <xsl:text>}</xsl:text>
  2077. <xsl:call-template name="gen-txt3">
  2078. <xsl:with-param name="txt" select="substring-after($txt,'}')"/>
  2079. </xsl:call-template>
  2080. </xsl:otherwise>
  2081. </xsl:choose>
  2082. </xsl:template>
  2083. <xsl:template name="gen-txt">
  2084. <xsl:param name="txt"/>
  2085. <!-- avoid duplication. -->
  2086. <xsl:param name="isFirst">true</xsl:param>
  2087. <xsl:variable name="newline">
  2088. <xsl:text>
  2089. </xsl:text>
  2090. </xsl:variable>
  2091. <xsl:choose>
  2092. <xsl:when test="contains($txt,$newline)">
  2093. <xsl:value-of select="substring-before($txt,$newline)"/>
  2094. <text:line-break/>
  2095. <xsl:call-template name="gen-txt">
  2096. <xsl:with-param name="txt" select="substring-after($txt,$newline)"/>
  2097. <xsl:with-param name="isFirst">false</xsl:with-param>
  2098. </xsl:call-template>
  2099. </xsl:when>
  2100. <xsl:otherwise>
  2101. <xsl:value-of select="$txt"/>
  2102. </xsl:otherwise>
  2103. </xsl:choose>
  2104. </xsl:template>
  2105. <xsl:template match="text()">
  2106. <xsl:variable name="style_name">
  2107. <xsl:call-template name="get_style_name"/>
  2108. </xsl:variable>
  2109. <xsl:variable name="trueStyleName" select="styleUtils:getHiStyleName($style_name)"/>
  2110. <xsl:choose>
  2111. <!-- parent is entry, stentry -->
  2112. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] or parent::*[contains(@class, ' topic/stentry ')]">
  2113. <xsl:choose>
  2114. <xsl:when test="ancestor::*[contains(@class, ' topic/thead ')] or ancestor::*[contains(@class, ' topic/sthead')]">
  2115. <text:span>
  2116. <!--
  2117. <xsl:attribute name="text:style-name">bold</xsl:attribute>
  2118. -->
  2119. <xsl:call-template name="start_flagging_text_of_table_or_list"/>
  2120. <text:span>
  2121. <xsl:if test="$trueStyleName!=''">
  2122. <xsl:attribute name="text:style-name">
  2123. <xsl:value-of select="$trueStyleName"/>
  2124. </xsl:attribute>
  2125. </xsl:if>
  2126. <xsl:call-template name="gen_txt_content"/>
  2127. </text:span>
  2128. </text:span>
  2129. </xsl:when>
  2130. <xsl:otherwise>
  2131. <text:span>
  2132. <xsl:call-template name="start_flagging_text_of_table_or_list"/>
  2133. <text:span>
  2134. <xsl:if test="$trueStyleName!=''">
  2135. <xsl:attribute name="text:style-name">
  2136. <xsl:value-of select="$trueStyleName"/>
  2137. </xsl:attribute>
  2138. </xsl:if>
  2139. <xsl:call-template name="gen_txt_content"/>
  2140. </text:span>
  2141. <xsl:call-template name="end_flagging_text_of_table_or_list"/>
  2142. </text:span>
  2143. </xsl:otherwise>
  2144. </xsl:choose>
  2145. </xsl:when>
  2146. <!-- parent is li, sli add p tag otherwise text is invaild. -->
  2147. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')] or parent::*[contains(@class, ' topic/sli ')]">
  2148. <text:p text:style-name="indent_paragraph_style">
  2149. <text:span>
  2150. <xsl:call-template name="start_flagging_text_of_table_or_list"/>
  2151. <text:span>
  2152. <xsl:if test="$trueStyleName!=''">
  2153. <xsl:attribute name="text:style-name">
  2154. <xsl:value-of select="$trueStyleName"/>
  2155. </xsl:attribute>
  2156. </xsl:if>
  2157. <xsl:call-template name="gen_txt_content"/>
  2158. </text:span>
  2159. <xsl:call-template name="end_flagging_text_of_table_or_list"/>
  2160. </text:span>
  2161. </text:p>
  2162. </xsl:when>
  2163. <!-- text is not allowed under these tags -->
  2164. <xsl:when test="parent::*[contains(@class,' topic/ul ')] | parent::*[contains(@class,' topic/ol ')] | parent::*[contains(@class,' topic/sl ')] | parent::*[contains(@class,' topic/dl ')]"/>
  2165. <!-- for other tags -->
  2166. <xsl:otherwise>
  2167. <text:span>
  2168. <xsl:if test="$trueStyleName!=''">
  2169. <xsl:choose>
  2170. <!-- title case -->
  2171. <xsl:when test="ancestor::*[contains(@class, ' topic/title ')][1]/parent::*[contains(@class, ' topic/topic ')]">
  2172. <xsl:choose>
  2173. <!-- keep font size with the title -->
  2174. <!--
  2175. <xsl:when test="contains($trueStyleName, 'italic')">
  2176. <xsl:variable name="depth" select="count(ancestor::*[contains(@class, ' topic/topic ')])"/>
  2177. <xsl:attribute name="text:style-name">
  2178. <xsl:value-of select="concat('italic', '_heading_', $depth)"/>
  2179. </xsl:attribute>
  2180. </xsl:when>
  2181. -->
  2182. <xsl:when test="$trueStyleName = 'bold'"/>
  2183. <!-- other style is okay -->
  2184. <xsl:otherwise>
  2185. <xsl:attribute name="text:style-name">
  2186. <xsl:value-of select="$trueStyleName"/>
  2187. </xsl:attribute>
  2188. </xsl:otherwise>
  2189. </xsl:choose>
  2190. </xsl:when>
  2191. <!-- other case -->
  2192. <xsl:otherwise>
  2193. <xsl:attribute name="text:style-name">
  2194. <xsl:value-of select="$trueStyleName"/>
  2195. </xsl:attribute>
  2196. </xsl:otherwise>
  2197. </xsl:choose>
  2198. </xsl:if>
  2199. <xsl:call-template name="gen_txt_content"/>
  2200. </text:span>
  2201. </xsl:otherwise>
  2202. </xsl:choose>
  2203. </xsl:template>
  2204. <xsl:template name="gen_txt_content">
  2205. <xsl:choose>
  2206. <xsl:when test="ancestor::*[contains(@class,' topic/pre ')]">
  2207. <xsl:call-template name="gen-txt">
  2208. <xsl:with-param name="txt" select="."/>
  2209. </xsl:call-template>
  2210. </xsl:when>
  2211. <xsl:otherwise>
  2212. <xsl:if test="starts-with(.,' ') and not(normalize-space(.)='')">
  2213. <xsl:text> </xsl:text>
  2214. </xsl:if>
  2215. <xsl:value-of select="normalize-space(.)"/>
  2216. <xsl:if test="substring(.,string-length(.))=' ' and not(normalize-space(.)='')">
  2217. <xsl:text> </xsl:text>
  2218. </xsl:if>
  2219. </xsl:otherwise>
  2220. </xsl:choose>
  2221. </xsl:template>
  2222. <xsl:template match="*[contains(@class,' topic/boolean ')]">
  2223. <xsl:variable name="style_name">
  2224. <xsl:call-template name="get_style_name"/>
  2225. </xsl:variable>
  2226. <xsl:variable name="trueStyleName" select="styleUtils:getHiStyleName($style_name)"/>
  2227. <xsl:choose>
  2228. <!-- parent is li -->
  2229. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  2230. <text:p>
  2231. <text:span text:style-name="boolean_style">
  2232. <xsl:text>boolean:</xsl:text>
  2233. <xsl:value-of select="@state"/>
  2234. </text:span>
  2235. </text:p>
  2236. </xsl:when>
  2237. <!-- nested by entry -->
  2238. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2239. <!-- create p tag -->
  2240. <text:p>
  2241. <!-- alignment styles -->
  2242. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2243. <xsl:call-template name="set_align_value"/>
  2244. </xsl:if>
  2245. <!-- cell belongs to thead -->
  2246. <xsl:choose>
  2247. <xsl:when test="parent::*[contains(@class, ' topic/entry ')] /parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2248. <text:span text:style-name="bold">
  2249. <text:span text:style-name="boolean_style">
  2250. <xsl:text>boolean:</xsl:text>
  2251. <xsl:value-of select="@state"/>
  2252. </text:span>
  2253. </text:span>
  2254. </xsl:when>
  2255. <xsl:otherwise>
  2256. <text:span text:style-name="boolean_style">
  2257. <xsl:text>boolean:</xsl:text>
  2258. <xsl:value-of select="@state"/>
  2259. </text:span>
  2260. </xsl:otherwise>
  2261. </xsl:choose>
  2262. </text:p>
  2263. </xsl:when>
  2264. <!-- nested by stentry -->
  2265. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2266. <text:p>
  2267. <!-- cell belongs to sthead -->
  2268. <xsl:choose>
  2269. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/ parent::*[contains(@class, ' topic/sthead ')]">
  2270. <text:span text:style-name="bold">
  2271. <text:span text:style-name="boolean_style">
  2272. <xsl:text>boolean:</xsl:text>
  2273. <xsl:value-of select="@state"/>
  2274. </text:span>
  2275. </text:span>
  2276. </xsl:when>
  2277. <xsl:otherwise>
  2278. <text:span text:style-name="boolean_style">
  2279. <xsl:text>boolean:</xsl:text>
  2280. <xsl:value-of select="@state"/>
  2281. </text:span>
  2282. </xsl:otherwise>
  2283. </xsl:choose>
  2284. </text:p>
  2285. </xsl:when>
  2286. <!-- nested by other tags -->
  2287. <xsl:otherwise>
  2288. <text:span>
  2289. <xsl:choose>
  2290. <xsl:when test="$trueStyleName!=''">
  2291. <xsl:attribute name="text:style-name">
  2292. <xsl:value-of select="concat('boolean_', $trueStyleName)"/>
  2293. </xsl:attribute>
  2294. </xsl:when>
  2295. <xsl:otherwise>
  2296. <xsl:attribute name="text:style-name">boolean_style</xsl:attribute>
  2297. </xsl:otherwise>
  2298. </xsl:choose>
  2299. <xsl:text>boolean:</xsl:text>
  2300. <xsl:value-of select="@state"/>
  2301. </text:span>
  2302. </xsl:otherwise>
  2303. </xsl:choose>
  2304. </xsl:template>
  2305. <xsl:template match="*[contains(@class,' topic/state ')]">
  2306. <xsl:variable name="style_name">
  2307. <xsl:call-template name="get_style_name"/>
  2308. </xsl:variable>
  2309. <xsl:variable name="trueStyleName" select="styleUtils:getHiStyleName($style_name)"/>
  2310. <text:span>
  2311. <xsl:if test="$trueStyleName!=''">
  2312. <xsl:attribute name="text:style-name">
  2313. <xsl:value-of select="$trueStyleName"/>
  2314. </xsl:attribute>
  2315. </xsl:if>
  2316. <text:span text:style-name="state_style">
  2317. <xsl:value-of select="name()"/>
  2318. <xsl:text>: </xsl:text>
  2319. <xsl:value-of select="@name"/>
  2320. <xsl:text>=</xsl:text>
  2321. <xsl:value-of select="@value"/>
  2322. </text:span>
  2323. </text:span>
  2324. </xsl:template>
  2325. <!-- itemgroup tag -->
  2326. <xsl:template match="*[contains(@class, ' topic/itemgroup ')]">
  2327. <xsl:choose>
  2328. <xsl:when test="parent::*[contains(@class, ' topic/dd ')]">
  2329. <text:span>
  2330. <!-- start add flagging styles -->
  2331. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2332. <xsl:apply-templates/>
  2333. <!-- end add flagging styles -->
  2334. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2335. </text:span>
  2336. </xsl:when>
  2337. <xsl:when test="parent::*[contains(@class, ' topic/li')]">
  2338. <text:p>
  2339. <text:span>
  2340. <!-- start add flagging styles -->
  2341. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2342. <xsl:apply-templates/>
  2343. <!-- end add flagging styles -->
  2344. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2345. </text:span>
  2346. </text:p>
  2347. </xsl:when>
  2348. <xsl:otherwise>
  2349. <text:span>
  2350. <!-- start add flagging styles -->
  2351. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2352. <xsl:apply-templates/>
  2353. <!-- end add flagging styles -->
  2354. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2355. </text:span>
  2356. </xsl:otherwise>
  2357. </xsl:choose>
  2358. </xsl:template>
  2359. <!-- Indexterm tag -->
  2360. <xsl:template match="*[contains(@class, ' topic/indexterm ')]">
  2361. <xsl:if test="$INDEXSHOW='yes'">
  2362. <xsl:choose>
  2363. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  2364. <text:p>
  2365. <xsl:call-template name="create_indexterm_content"/>
  2366. </text:p>
  2367. </xsl:when>
  2368. <!-- nested by entry -->
  2369. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2370. <!-- create p tag -->
  2371. <text:p>
  2372. <!-- alignment styles -->
  2373. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2374. <xsl:call-template name="set_align_value"/>
  2375. </xsl:if>
  2376. <!-- cell belongs to thead -->
  2377. <xsl:choose>
  2378. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2379. <text:span text:style-name="bold">
  2380. <xsl:call-template name="create_indexterm_content"/>
  2381. </text:span>
  2382. </xsl:when>
  2383. <xsl:otherwise>
  2384. <xsl:call-template name="create_indexterm_content"/>
  2385. </xsl:otherwise>
  2386. </xsl:choose>
  2387. </text:p>
  2388. </xsl:when>
  2389. <!-- nested by stentry -->
  2390. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2391. <text:p>
  2392. <!-- cell belongs to sthead -->
  2393. <xsl:choose>
  2394. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  2395. <text:span text:style-name="bold">
  2396. <xsl:call-template name="create_indexterm_content"/>
  2397. </text:span>
  2398. </xsl:when>
  2399. <xsl:otherwise>
  2400. <xsl:call-template name="create_indexterm_content"/>
  2401. </xsl:otherwise>
  2402. </xsl:choose>
  2403. </text:p>
  2404. </xsl:when>
  2405. <!-- nested by other tags -->
  2406. <xsl:otherwise>
  2407. <xsl:call-template name="create_indexterm_content"/>
  2408. </xsl:otherwise>
  2409. </xsl:choose>
  2410. </xsl:if>
  2411. </xsl:template>
  2412. <xsl:template name="create_indexterm_content">
  2413. <xsl:variable name="indexId" select="concat('IMark', generate-id(.))"/>
  2414. <xsl:variable name="depth" select="count(ancestor-or-self::*[contains(@class,' topic/indexterm ')])"/>
  2415. <text:user-index-mark-start text:id="{$indexId}" text:index-name="{'user-defined'}" text:outline-level="{$depth}"/>
  2416. <xsl:apply-templates/>
  2417. <text:user-index-mark-end text:id="{$indexId}"/>
  2418. </xsl:template>
  2419. <xsl:template match="*[contains(@class,' topic/tm ')]">
  2420. <xsl:choose>
  2421. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  2422. <text:p>
  2423. <xsl:call-template name="create_tm_content"/>
  2424. </text:p>
  2425. </xsl:when>
  2426. <!-- nested by entry -->
  2427. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2428. <!-- create p tag -->
  2429. <text:p>
  2430. <!-- alignment styles -->
  2431. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2432. <xsl:call-template name="set_align_value"/>
  2433. </xsl:if>
  2434. <!-- cell belongs to thead -->
  2435. <xsl:choose>
  2436. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2437. <text:span text:style-name="bold">
  2438. <xsl:call-template name="create_tm_content"/>
  2439. </text:span>
  2440. </xsl:when>
  2441. <xsl:otherwise>
  2442. <xsl:call-template name="create_tm_content"/>
  2443. </xsl:otherwise>
  2444. </xsl:choose>
  2445. </text:p>
  2446. </xsl:when>
  2447. <!-- nested by stentry -->
  2448. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2449. <text:p>
  2450. <!-- cell belongs to sthead -->
  2451. <xsl:choose>
  2452. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  2453. <text:span text:style-name="bold">
  2454. <xsl:call-template name="create_tm_content"/>
  2455. </text:span>
  2456. </xsl:when>
  2457. <xsl:otherwise>
  2458. <xsl:call-template name="create_tm_content"/>
  2459. </xsl:otherwise>
  2460. </xsl:choose>
  2461. </text:p>
  2462. </xsl:when>
  2463. <!-- nested by other tags -->
  2464. <xsl:otherwise>
  2465. <xsl:call-template name="create_tm_content"/>
  2466. </xsl:otherwise>
  2467. </xsl:choose>
  2468. </xsl:template>
  2469. <xsl:template name="create_tm_content">
  2470. <text:span>
  2471. <xsl:apply-templates/>
  2472. </text:span>
  2473. <xsl:choose>
  2474. <xsl:when test="@tmtype='tm'">
  2475. <text:span text:style-name="sup">
  2476. <xsl:text>(TM)</xsl:text>
  2477. </text:span>
  2478. </xsl:when>
  2479. <xsl:when test="@tmtype='service'">
  2480. <text:span text:style-name="sup">
  2481. <xsl:text>(SM)</xsl:text>
  2482. </text:span>
  2483. </xsl:when>
  2484. <xsl:when test="@tmtype='reg'">
  2485. <text:span text:style-name="sup">
  2486. <xsl:text>(R)</xsl:text>
  2487. </text:span>
  2488. </xsl:when>
  2489. </xsl:choose>
  2490. </xsl:template>
  2491. <xsl:template match="*[contains(@class,' topic/draft-comment ')]">
  2492. <xsl:if test="$DRAFT='yes'">
  2493. <xsl:apply-templates select="." mode="ditamsg:draft-comment-in-content"/>
  2494. <xsl:choose>
  2495. <!-- parent is p or list -->
  2496. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  2497. parent::*[contains(@class, ' topic/li ')] or
  2498. parent::*[contains(@class, ' topic/sli ')]">
  2499. <text:p text:style-name="draftcomment_paragraph">
  2500. <text:span>
  2501. <!-- start add flagging styles -->
  2502. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2503. <text:span text:style-name="bold">
  2504. <xsl:call-template name="getVariable">
  2505. <xsl:with-param name="id" select="'Draft comment'"/>
  2506. </xsl:call-template>
  2507. <xsl:call-template name="getVariable">
  2508. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2509. </xsl:call-template>
  2510. <xsl:if test="@author">
  2511. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2512. </xsl:if>
  2513. <xsl:if test="@disposition">
  2514. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2515. </xsl:if>
  2516. <xsl:if test="@time">
  2517. <xsl:value-of select="@time"/>
  2518. </xsl:if>
  2519. <text:line-break/>
  2520. </text:span>
  2521. <xsl:apply-templates/>
  2522. <!-- end add flagging styles -->
  2523. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2524. </text:span>
  2525. </text:p>
  2526. </xsl:when>
  2527. <!-- nested by entry -->
  2528. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2529. <!-- create p tag -->
  2530. <text:p>
  2531. <!-- alignment styles -->
  2532. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2533. <xsl:call-template name="set_align_value"/>
  2534. </xsl:if>
  2535. <!-- cell belongs to thead -->
  2536. <xsl:choose>
  2537. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2538. <text:span text:style-name="bold">
  2539. <text:span>
  2540. <!-- start add flagging styles -->
  2541. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2542. <text:span text:style-name="bold">
  2543. <xsl:call-template name="getVariable">
  2544. <xsl:with-param name="id" select="'Draft comment'"/>
  2545. </xsl:call-template>
  2546. <xsl:call-template name="getVariable">
  2547. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2548. </xsl:call-template>
  2549. <xsl:if test="@author">
  2550. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2551. </xsl:if>
  2552. <xsl:if test="@disposition">
  2553. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2554. </xsl:if>
  2555. <xsl:if test="@time">
  2556. <xsl:value-of select="@time"/>
  2557. </xsl:if>
  2558. <text:line-break/>
  2559. </text:span>
  2560. <xsl:apply-templates/>
  2561. <!-- end add flagging styles -->
  2562. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2563. </text:span>
  2564. </text:span>
  2565. </xsl:when>
  2566. <xsl:otherwise>
  2567. <text:span>
  2568. <!-- start add flagging styles -->
  2569. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2570. <text:span text:style-name="bold">
  2571. <xsl:call-template name="getVariable">
  2572. <xsl:with-param name="id" select="'Draft comment'"/>
  2573. </xsl:call-template>
  2574. <xsl:call-template name="getVariable">
  2575. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2576. </xsl:call-template>
  2577. <xsl:if test="@author">
  2578. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2579. </xsl:if>
  2580. <xsl:if test="@disposition">
  2581. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2582. </xsl:if>
  2583. <xsl:if test="@time">
  2584. <xsl:value-of select="@time"/>
  2585. </xsl:if>
  2586. <text:line-break/>
  2587. </text:span>
  2588. <xsl:apply-templates/>
  2589. <!-- end add flagging styles -->
  2590. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2591. </text:span>
  2592. </xsl:otherwise>
  2593. </xsl:choose>
  2594. </text:p>
  2595. </xsl:when>
  2596. <!-- nested by stentry -->
  2597. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2598. <text:p>
  2599. <!-- cell belongs to sthead -->
  2600. <xsl:choose>
  2601. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  2602. <text:span text:style-name="bold">
  2603. <text:span>
  2604. <!-- start add flagging styles -->
  2605. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2606. <text:span text:style-name="bold">
  2607. <xsl:call-template name="getVariable">
  2608. <xsl:with-param name="id" select="'Draft comment'"/>
  2609. </xsl:call-template>
  2610. <xsl:call-template name="getVariable">
  2611. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2612. </xsl:call-template>
  2613. <xsl:if test="@author">
  2614. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2615. </xsl:if>
  2616. <xsl:if test="@disposition">
  2617. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2618. </xsl:if>
  2619. <xsl:if test="@time">
  2620. <xsl:value-of select="@time"/>
  2621. </xsl:if>
  2622. <text:line-break/>
  2623. </text:span>
  2624. <xsl:apply-templates/>
  2625. <!-- end add flagging styles -->
  2626. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2627. </text:span>
  2628. </text:span>
  2629. </xsl:when>
  2630. <xsl:otherwise>
  2631. <text:span>
  2632. <!-- start add flagging styles -->
  2633. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2634. <text:span text:style-name="bold">
  2635. <xsl:call-template name="getVariable">
  2636. <xsl:with-param name="id" select="'Draft comment'"/>
  2637. </xsl:call-template>
  2638. <xsl:call-template name="getVariable">
  2639. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2640. </xsl:call-template>
  2641. <xsl:if test="@author">
  2642. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2643. </xsl:if>
  2644. <xsl:if test="@disposition">
  2645. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2646. </xsl:if>
  2647. <xsl:if test="@time">
  2648. <xsl:value-of select="@time"/>
  2649. </xsl:if>
  2650. <text:line-break/>
  2651. </text:span>
  2652. <xsl:apply-templates/>
  2653. <!-- end add flagging styles -->
  2654. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2655. </text:span>
  2656. </xsl:otherwise>
  2657. </xsl:choose>
  2658. </text:p>
  2659. </xsl:when>
  2660. <!-- parent is other tag -->
  2661. <xsl:otherwise>
  2662. <text:span>
  2663. <text:span>
  2664. <!-- start add flagging styles -->
  2665. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2666. <text:span text:style-name="bold">
  2667. <xsl:call-template name="getVariable">
  2668. <xsl:with-param name="id" select="'Draft comment'"/>
  2669. </xsl:call-template>
  2670. <xsl:call-template name="getVariable">
  2671. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2672. </xsl:call-template>
  2673. <xsl:if test="@author">
  2674. <xsl:value-of select="@author"/><xsl:text> </xsl:text>
  2675. </xsl:if>
  2676. <xsl:if test="@disposition">
  2677. <xsl:value-of select="@disposition"/><xsl:text> </xsl:text>
  2678. </xsl:if>
  2679. <xsl:if test="@time">
  2680. <xsl:value-of select="@time"/>
  2681. </xsl:if>
  2682. <text:line-break/>
  2683. </text:span>
  2684. <xsl:apply-templates/>
  2685. <!-- end add flagging styles -->
  2686. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2687. </text:span>
  2688. <text:line-break/>
  2689. </text:span>
  2690. </xsl:otherwise>
  2691. </xsl:choose>
  2692. </xsl:if>
  2693. </xsl:template>
  2694. <xsl:template match="*[contains(@class,' topic/required-cleanup ')]">
  2695. <xsl:if test="$DRAFT='yes'">
  2696. <xsl:apply-templates select="." mode="ditamsg:required-cleanup-in-content"/>
  2697. <xsl:choose>
  2698. <!-- parent is p or list -->
  2699. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  2700. parent::*[contains(@class, ' topic/li ')] or
  2701. parent::*[contains(@class, ' topic/sli ')]">
  2702. <text:p>
  2703. <text:span>
  2704. <!-- start add flagging styles -->
  2705. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2706. <text:span text:style-name="bold">
  2707. <xsl:text>[</xsl:text>
  2708. <xsl:call-template name="getVariable">
  2709. <xsl:with-param name="id" select="'Required cleanup'"/>
  2710. </xsl:call-template>
  2711. <xsl:text>]</xsl:text>
  2712. <xsl:if test="string(@remap)">
  2713. <xsl:text>(</xsl:text>
  2714. <xsl:value-of select="@remap"/>
  2715. <xsl:text>)</xsl:text>
  2716. </xsl:if>
  2717. <xsl:call-template name="getVariable">
  2718. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2719. </xsl:call-template>
  2720. <xsl:text> </xsl:text>
  2721. </text:span>
  2722. <xsl:apply-templates/>
  2723. <!-- end add flagging styles -->
  2724. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2725. </text:span>
  2726. </text:p>
  2727. </xsl:when>
  2728. <!-- nested by entry -->
  2729. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2730. <!-- create p tag -->
  2731. <text:p>
  2732. <!-- alignment styles -->
  2733. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2734. <xsl:call-template name="set_align_value"/>
  2735. </xsl:if>
  2736. <!-- cell belongs to thead -->
  2737. <xsl:choose>
  2738. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2739. <text:span text:style-name="bold">
  2740. <text:span>
  2741. <!-- start add flagging styles -->
  2742. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2743. <text:span text:style-name="bold">
  2744. <xsl:text>[</xsl:text>
  2745. <xsl:call-template name="getVariable">
  2746. <xsl:with-param name="id" select="'Required cleanup'"/>
  2747. </xsl:call-template>
  2748. <xsl:text>]</xsl:text>
  2749. <xsl:if test="string(@remap)">
  2750. <xsl:text>(</xsl:text>
  2751. <xsl:value-of select="@remap"/>
  2752. <xsl:text>)</xsl:text>
  2753. </xsl:if>
  2754. <xsl:call-template name="getVariable">
  2755. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2756. </xsl:call-template>
  2757. <xsl:text> </xsl:text>
  2758. </text:span>
  2759. <xsl:apply-templates/>
  2760. <!-- end add flagging styles -->
  2761. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2762. </text:span>
  2763. </text:span>
  2764. </xsl:when>
  2765. <xsl:otherwise>
  2766. <text:span>
  2767. <!-- start add flagging styles -->
  2768. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2769. <text:span text:style-name="bold">
  2770. <xsl:text>[</xsl:text>
  2771. <xsl:call-template name="getVariable">
  2772. <xsl:with-param name="id" select="'Required cleanup'"/>
  2773. </xsl:call-template>
  2774. <xsl:text>]</xsl:text>
  2775. <xsl:if test="string(@remap)">
  2776. <xsl:text>(</xsl:text>
  2777. <xsl:value-of select="@remap"/>
  2778. <xsl:text>)</xsl:text>
  2779. </xsl:if>
  2780. <xsl:call-template name="getVariable">
  2781. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2782. </xsl:call-template>
  2783. <xsl:text> </xsl:text>
  2784. </text:span>
  2785. <xsl:apply-templates/>
  2786. <!-- end add flagging styles -->
  2787. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2788. </text:span>
  2789. </xsl:otherwise>
  2790. </xsl:choose>
  2791. </text:p>
  2792. </xsl:when>
  2793. <!-- nested by stentry -->
  2794. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2795. <text:p>
  2796. <!-- cell belongs to sthead -->
  2797. <xsl:choose>
  2798. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  2799. <text:span text:style-name="bold">
  2800. <text:span>
  2801. <!-- start add flagging styles -->
  2802. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2803. <text:span text:style-name="bold">
  2804. <xsl:text>[</xsl:text>
  2805. <xsl:call-template name="getVariable">
  2806. <xsl:with-param name="id" select="'Required cleanup'"/>
  2807. </xsl:call-template>
  2808. <xsl:text>]</xsl:text>
  2809. <xsl:if test="string(@remap)">
  2810. <xsl:text>(</xsl:text>
  2811. <xsl:value-of select="@remap"/>
  2812. <xsl:text>)</xsl:text>
  2813. </xsl:if>
  2814. <xsl:call-template name="getVariable">
  2815. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2816. </xsl:call-template>
  2817. <xsl:text> </xsl:text>
  2818. </text:span>
  2819. <xsl:apply-templates/>
  2820. <!-- end add flagging styles -->
  2821. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2822. </text:span>
  2823. </text:span>
  2824. </xsl:when>
  2825. <xsl:otherwise>
  2826. <text:span>
  2827. <!-- start add flagging styles -->
  2828. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2829. <text:span text:style-name="bold">
  2830. <xsl:text>[</xsl:text>
  2831. <xsl:call-template name="getVariable">
  2832. <xsl:with-param name="id" select="'Required cleanup'"/>
  2833. </xsl:call-template>
  2834. <xsl:text>]</xsl:text>
  2835. <xsl:if test="string(@remap)">
  2836. <xsl:text>(</xsl:text>
  2837. <xsl:value-of select="@remap"/>
  2838. <xsl:text>)</xsl:text>
  2839. </xsl:if>
  2840. <xsl:call-template name="getVariable">
  2841. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2842. </xsl:call-template>
  2843. <xsl:text> </xsl:text>
  2844. </text:span>
  2845. <xsl:apply-templates/>
  2846. <!-- end add flagging styles -->
  2847. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2848. </text:span>
  2849. </xsl:otherwise>
  2850. </xsl:choose>
  2851. </text:p>
  2852. </xsl:when>
  2853. <!-- parent is other tag -->
  2854. <xsl:otherwise>
  2855. <text:span>
  2856. <text:span>
  2857. <!-- start add flagging styles -->
  2858. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  2859. <!--
  2860. <xsl:element name="text:span">
  2861. <xsl:attribute name="text:style-name">required_cleanup_style</xsl:attribute>
  2862. -->
  2863. <text:span text:style-name="bold">
  2864. <xsl:text>[</xsl:text>
  2865. <xsl:call-template name="getVariable">
  2866. <xsl:with-param name="id" select="'Required cleanup'"/>
  2867. </xsl:call-template>
  2868. <xsl:text>]</xsl:text>
  2869. <xsl:if test="string(@remap)">
  2870. <xsl:text>(</xsl:text>
  2871. <xsl:value-of select="@remap"/>
  2872. <xsl:text>)</xsl:text>
  2873. </xsl:if>
  2874. <xsl:call-template name="getVariable">
  2875. <xsl:with-param name="id" select="'ColonSymbol'"/>
  2876. </xsl:call-template>
  2877. <xsl:text> </xsl:text>
  2878. </text:span>
  2879. <xsl:apply-templates/>
  2880. <!--
  2881. </xsl:element>
  2882. -->
  2883. <!-- end add flagging styles -->
  2884. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  2885. </text:span>
  2886. <text:line-break/>
  2887. </text:span>
  2888. </xsl:otherwise>
  2889. </xsl:choose>
  2890. </xsl:if>
  2891. </xsl:template>
  2892. <xsl:template match="*[contains(@class, ' topic/keywords ')]">
  2893. <text:p text:style-name="indent_paragraph_style">
  2894. <xsl:apply-templates/>
  2895. </text:p>
  2896. </xsl:template>
  2897. <xsl:template match="*[contains(@class, ' topic/term ')]">
  2898. <xsl:choose>
  2899. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  2900. <text:p>
  2901. <text:span text:style-name="italic">
  2902. <text:span>
  2903. <!-- start add rev flagging styles -->
  2904. <xsl:apply-templates select="." mode="start-add-odt-flags">
  2905. <xsl:with-param name="type" select="'keyword'"/>
  2906. </xsl:apply-templates>
  2907. <xsl:apply-templates/>
  2908. <!-- end add rev flagging styles -->
  2909. <xsl:apply-templates select="." mode="end-add-odt-flags">
  2910. <xsl:with-param name="type" select="'keyword'"/>
  2911. </xsl:apply-templates>
  2912. </text:span>
  2913. </text:span>
  2914. </text:p>
  2915. </xsl:when>
  2916. <!-- nested by entry -->
  2917. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  2918. <!-- create p tag -->
  2919. <text:p>
  2920. <!-- alignment styles -->
  2921. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  2922. <xsl:call-template name="set_align_value"/>
  2923. </xsl:if>
  2924. <!-- cell belongs to thead -->
  2925. <xsl:choose>
  2926. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  2927. <text:span text:style-name="bold">
  2928. <text:span text:style-name="italic">
  2929. <text:span>
  2930. <!-- start add rev flagging styles -->
  2931. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2932. <xsl:apply-templates/>
  2933. <!-- end add rev flagging styles -->
  2934. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2935. </text:span>
  2936. </text:span>
  2937. </text:span>
  2938. </xsl:when>
  2939. <xsl:otherwise>
  2940. <text:span text:style-name="italic">
  2941. <text:span>
  2942. <!-- start add rev flagging styles -->
  2943. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2944. <xsl:apply-templates/>
  2945. <!-- end add rev flagging styles -->
  2946. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2947. </text:span>
  2948. </text:span>
  2949. </xsl:otherwise>
  2950. </xsl:choose>
  2951. </text:p>
  2952. </xsl:when>
  2953. <!-- nested by stentry -->
  2954. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  2955. <text:p>
  2956. <!-- cell belongs to sthead -->
  2957. <xsl:choose>
  2958. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  2959. <text:span text:style-name="bold">
  2960. <text:span text:style-name="italic">
  2961. <text:span>
  2962. <!-- start add rev flagging styles -->
  2963. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2964. <xsl:apply-templates/>
  2965. <!-- end add rev flagging styles -->
  2966. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2967. </text:span>
  2968. </text:span>
  2969. </text:span>
  2970. </xsl:when>
  2971. <xsl:otherwise>
  2972. <text:span text:style-name="italic">
  2973. <text:span>
  2974. <!-- start add rev flagging styles -->
  2975. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2976. <xsl:apply-templates/>
  2977. <!-- end add rev flagging styles -->
  2978. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2979. </text:span>
  2980. </text:span>
  2981. </xsl:otherwise>
  2982. </xsl:choose>
  2983. </text:p>
  2984. </xsl:when>
  2985. <!-- nested by other tags -->
  2986. <xsl:otherwise>
  2987. <text:span text:style-name="italic">
  2988. <text:span>
  2989. <!-- start add rev flagging styles -->
  2990. <xsl:apply-templates select="." mode="start-add-odt-revflags"/>
  2991. <xsl:apply-templates/>
  2992. <!-- end add rev flagging styles -->
  2993. <xsl:apply-templates select="." mode="end-add-odt-revflags"/>
  2994. </text:span>
  2995. </text:span>
  2996. </xsl:otherwise>
  2997. </xsl:choose>
  2998. </xsl:template>
  2999. <xsl:template match="*[contains(@class, ' topic/fn ')]">
  3000. <xsl:choose>
  3001. <xsl:when test="parent::*[contains(@class, ' topic/li ')] or parent::*[contains(@class, ' topic/sli ')]">
  3002. <text:p>
  3003. <xsl:call-template name="create_fn_content"/>
  3004. </text:p>
  3005. </xsl:when>
  3006. <!-- nested by entry -->
  3007. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  3008. <!-- create p tag -->
  3009. <text:p>
  3010. <!-- alignment styles -->
  3011. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  3012. <xsl:call-template name="set_align_value"/>
  3013. </xsl:if>
  3014. <!-- cell belongs to thead -->
  3015. <xsl:choose>
  3016. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  3017. <text:span text:style-name="bold">
  3018. <xsl:call-template name="create_fn_content"/>
  3019. </text:span>
  3020. </xsl:when>
  3021. <xsl:otherwise>
  3022. <xsl:call-template name="create_fn_content"/>
  3023. </xsl:otherwise>
  3024. </xsl:choose>
  3025. </text:p>
  3026. </xsl:when>
  3027. <!-- nested by stentry -->
  3028. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  3029. <text:p>
  3030. <!-- cell belongs to sthead -->
  3031. <xsl:choose>
  3032. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  3033. <text:span text:style-name="bold">
  3034. <xsl:call-template name="create_fn_content"/>
  3035. </text:span>
  3036. </xsl:when>
  3037. <xsl:otherwise>
  3038. <xsl:call-template name="create_fn_content"/>
  3039. </xsl:otherwise>
  3040. </xsl:choose>
  3041. </text:p>
  3042. </xsl:when>
  3043. <!-- nested by other tags -->
  3044. <xsl:otherwise>
  3045. <xsl:call-template name="create_fn_content"/>
  3046. </xsl:otherwise>
  3047. </xsl:choose>
  3048. </xsl:template>
  3049. <xsl:template name="create_fn_content">
  3050. <xsl:choose>
  3051. <xsl:when test="not(@id)">
  3052. <xsl:choose>
  3053. <xsl:when test="@callout and not(@callout = '')">
  3054. <text:note text:note-class="footnote">
  3055. <text:note-citation text:label="{@callout}">
  3056. <xsl:value-of select="@callout"/>
  3057. </text:note-citation>
  3058. <text:note-body>
  3059. <text:p text:style-name="footnote">
  3060. <text:span>
  3061. <!-- start add flagging styles -->
  3062. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  3063. <xsl:apply-templates/>
  3064. <!-- end add flagging styles -->
  3065. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  3066. </text:span>
  3067. </text:p>
  3068. </text:note-body>
  3069. </text:note>
  3070. </xsl:when>
  3071. <xsl:otherwise>
  3072. <!-- should be updated -->
  3073. <!--
  3074. <xsl:variable name="fnNumber"
  3075. select="count(preceding::*[contains(@class, ' topic/fn ')]) + 1"/>
  3076. -->
  3077. <xsl:variable name="fnNumber">
  3078. <xsl:number from="/" level="any"/>
  3079. </xsl:variable>
  3080. <text:note text:note-class="footnote">
  3081. <text:note-citation>
  3082. <xsl:value-of select="$fnNumber"/>
  3083. </text:note-citation>
  3084. <text:note-body>
  3085. <text:p text:style-name="footnote">
  3086. <text:span>
  3087. <!-- start add flagging styles -->
  3088. <xsl:apply-templates select="." mode="start-add-odt-flags"/>
  3089. <xsl:apply-templates/>
  3090. <!-- end add flagging styles -->
  3091. <xsl:apply-templates select="." mode="end-add-odt-flags"/>
  3092. </text:span>
  3093. </text:p>
  3094. </text:note-body>
  3095. </text:note>
  3096. </xsl:otherwise>
  3097. </xsl:choose>
  3098. </xsl:when>
  3099. <xsl:otherwise/>
  3100. </xsl:choose>
  3101. </xsl:template>
  3102. <!-- Add for "New <data> element (#9)" in DITA 1.1 -->
  3103. <xsl:template match="*[contains(@class,' topic/data ')]"/>
  3104. <!-- data-about tag -->
  3105. <xsl:template match="*[contains(@class, ' topic/data-about ')]">
  3106. <xsl:choose>
  3107. <!-- nested by body or list -->
  3108. <xsl:when test="parent::*[contains(@class, ' topic/body ')] or
  3109. parent::*[contains(@class, ' topic/li ')] or
  3110. parent::*[contains(@class, ' topic/sli ')]">
  3111. <text:p>
  3112. <xsl:apply-templates/>
  3113. </text:p>
  3114. </xsl:when>
  3115. <!-- nested by entry -->
  3116. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]">
  3117. <!-- create p tag -->
  3118. <text:p>
  3119. <!-- alignment styles -->
  3120. <xsl:if test="parent::*[contains(@class, ' topic/entry ')]/@align">
  3121. <xsl:call-template name="set_align_value"/>
  3122. </xsl:if>
  3123. <!-- cell belongs to thead -->
  3124. <xsl:choose>
  3125. <xsl:when test="parent::*[contains(@class, ' topic/entry ')]/parent::*[contains(@class, ' topic/row ')]/parent::*[contains(@class, ' topic/thead ')]">
  3126. <text:span text:style-name="bold">
  3127. <xsl:apply-templates/>
  3128. </text:span>
  3129. </xsl:when>
  3130. <xsl:otherwise>
  3131. <xsl:apply-templates/>
  3132. </xsl:otherwise>
  3133. </xsl:choose>
  3134. </text:p>
  3135. </xsl:when>
  3136. <!-- nested by stentry -->
  3137. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]">
  3138. <text:p>
  3139. <!-- cell belongs to sthead -->
  3140. <xsl:choose>
  3141. <xsl:when test="parent::*[contains(@class, ' topic/stentry ')]/parent::*[contains(@class, ' topic/sthead ')]">
  3142. <text:span text:style-name="bold">
  3143. <xsl:apply-templates/>
  3144. </text:span>
  3145. </xsl:when>
  3146. <xsl:otherwise>
  3147. <xsl:apply-templates/>
  3148. </xsl:otherwise>
  3149. </xsl:choose>
  3150. </text:p>
  3151. </xsl:when>
  3152. <!-- for other tags -->
  3153. <xsl:otherwise>
  3154. <text:span>
  3155. <xsl:apply-templates/>
  3156. </text:span>
  3157. </xsl:otherwise>
  3158. </xsl:choose>
  3159. </xsl:template>
  3160. <!-- Add for "Support foreign content vocabularies such as
  3161. MathML and SVG with <unknown> (#35) " in DITA 1.1 -->
  3162. <xsl:template match="*[contains(@class,' topic/foreign ') or contains(@class,' topic/unknown ')]"/>
  3163. </xsl:stylesheet>