uof2odf_text.xsl 320 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. * This file is part of the LibreOffice project.
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  8. *
  9. * This file incorporates work covered by the following license notice:
  10. *
  11. * Licensed to the Apache Software Foundation (ASF) under one or more
  12. * contributor license agreements. See the NOTICE file distributed
  13. * with this work for additional information regarding copyright
  14. * ownership. The ASF licenses this file to you under the Apache
  15. * License, Version 2.0 (the "License"); you may not use this file
  16. * except in compliance with the License. You may obtain a copy of
  17. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  18. -->
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
  20. <xsl:template match="uof:UOF">
  21. <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
  22. <xsl:apply-templates select="uof:元数据"/>
  23. <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
  24. <xsl:apply-templates select="uof:字体集"/>
  25. <xsl:apply-templates select="uof:式样集"/>
  26. <xsl:apply-templates select="uof:文字处理"/>
  27. </office:document>
  28. </xsl:template>
  29. <xsl:template match="uof:元数据">
  30. <xsl:element name="office:meta">
  31. <meta:generator>UOFText 2004</meta:generator>
  32. <dc:title>
  33. <xsl:value-of select="uof:标题"/>
  34. </dc:title>
  35. <dc:description>
  36. <xsl:value-of select="uof:摘要"/>
  37. </dc:description>
  38. <dc:subject>
  39. <xsl:value-of select="uof:主题"/>
  40. </dc:subject>
  41. <meta:initial-creator>
  42. <xsl:value-of select="uof:创建者"/>
  43. </meta:initial-creator>
  44. <meta:creation-date>
  45. <xsl:value-of select="substring-before( uof:创建日期, 'Z')"/>
  46. </meta:creation-date>
  47. <dc:creator>
  48. <xsl:value-of select="uof:最后作者"/>
  49. </dc:creator>
  50. <dc:date>
  51. <xsl:value-of select="substring-before( uof:编辑时间, 'Z')"/>
  52. </dc:date>
  53. <meta:printed-by/>
  54. <meta:print-date/>
  55. <meta:keywords>
  56. <meta:keyword>
  57. <xsl:value-of select="uof:关键字集/uof:关键字"/>
  58. </meta:keyword>
  59. </meta:keywords>
  60. <dc:language/>
  61. <meta:editing-cycles>
  62. <xsl:value-of select="uof:编辑次数"/>
  63. </meta:editing-cycles>
  64. <meta:editing-duration>
  65. <xsl:if test="uof:编辑时间">
  66. <xsl:value-of select="concat('PT', floor(uof:编辑时间 div 60), 'H', uof:编辑时间 mod 60, 'M0S')"/>
  67. </xsl:if>
  68. </meta:editing-duration>
  69. <meta:user-defined meta:name="Category">
  70. <xsl:value-of select="uof:分类"/>
  71. </meta:user-defined>
  72. <meta:user-defined meta:name="Manager">
  73. <xsl:value-of select="uof:经理名称"/>
  74. </meta:user-defined>
  75. <meta:user-defined meta:name="Company">
  76. <xsl:value-of select="uof:公司名称"/>
  77. </meta:user-defined>
  78. <meta:user-defined meta:name="Version">
  79. <xsl:value-of select="uof:创建应用程序"/>
  80. </meta:user-defined>
  81. <xsl:if test="uof:文档模板|child::*[@uof:locID='u0013']">
  82. <meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:href="{child::*[@uof:locID='u0013']}"/>
  83. </xsl:if>
  84. <xsl:if test="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
  85. <xsl:for-each select="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
  86. <xsl:element name="meta:user-defined">
  87. <xsl:attribute name="meta:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
  88. </xsl:element>
  89. </xsl:for-each>
  90. </xsl:if>
  91. <meta:document-statistic>
  92. <xsl:attribute name="meta:page-count">
  93. <xsl:choose>
  94. <xsl:when test="child::*[@uof:locID='u0020']"><xsl:value-of select="uof:页数"/></xsl:when>
  95. <xsl:otherwise>
  96. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numpages']">
  97. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  98. <xsl:variable name="fmt">
  99. <xsl:value-of select="substring-before($date0,' \*')"/>
  100. </xsl:variable>
  101. <xsl:if test="$fmt='Arabic'"><xsl:value-of select="following-sibling::字:句/字:文本串"/></xsl:if>
  102. <xsl:if test="not($fmt='Arabic')">
  103. <xsl:variable name="content">
  104. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  105. </xsl:variable>
  106. <xsl:choose>
  107. <xsl:when test="$content='I' or $content='i' or $content='A' or $content='a'">1</xsl:when>
  108. <xsl:when test="$content='II' or $content='ii' or $content='B' or $content='b'">2</xsl:when>
  109. </xsl:choose>
  110. </xsl:if>
  111. </xsl:for-each>
  112. </xsl:otherwise>
  113. </xsl:choose>
  114. </xsl:attribute>
  115. <xsl:attribute name="meta:paragraph-count"><xsl:if test="child::*[@uof:locID='u0025']"><xsl:value-of select="uof:段落数"/></xsl:if></xsl:attribute>
  116. <xsl:attribute name="meta:word-count"><xsl:if test="child::*[@uof:locID='u0023']"><xsl:value-of select="uof:中文字符数"/></xsl:if></xsl:attribute>
  117. <xsl:attribute name="meta:object-count"><xsl:if test="child::*[@uof:locID='u0026']"><xsl:value-of select="uof:对象数"/></xsl:if></xsl:attribute>
  118. <xsl:attribute name="meta:character-count">
  119. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numchars']">
  120. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  121. </xsl:for-each>
  122. <xsl:if test="child::*[@uof:locID='u0021']"><xsl:value-of select="uof:字数"/></xsl:if>
  123. </xsl:attribute>
  124. </meta:document-statistic>
  125. <meta:document-statistic/>
  126. </xsl:element>
  127. </xsl:template>
  128. <xsl:variable name="uofUnit">
  129. <xsl:variable name="uu">
  130. <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:度量单位"/>
  131. </xsl:variable>
  132. <xsl:choose>
  133. <xsl:when test="$uu='cm'">cm</xsl:when>
  134. <xsl:when test="$uu='mm'">mm</xsl:when>
  135. <xsl:when test="$uu='pt'">pt</xsl:when>
  136. <xsl:when test="$uu='inch'">in</xsl:when>
  137. <xsl:otherwise>cm</xsl:otherwise>
  138. </xsl:choose>
  139. </xsl:variable>
  140. <xsl:variable name="other-to-cm-conversion-factor">
  141. <xsl:choose>
  142. <xsl:when test="$uofUnit='cm'">1</xsl:when>
  143. <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
  144. <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
  145. <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
  146. <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
  147. <xsl:otherwise>0.03527</xsl:otherwise>
  148. </xsl:choose>
  149. </xsl:variable>
  150. <xsl:template match="uof:式样集">
  151. <xsl:apply-templates select="uof:字体集"/>
  152. <xsl:variable name="default_paragraph_style" select="uof:段落式样"/>
  153. <xsl:variable name="default_character_style" select="uof:句式样"/>
  154. <xsl:variable name="default_table_style" select="uof:文字表式样"/>
  155. <office:styles>
  156. <xsl:if test="uof:段落式样[@字:类型 = 'default']">
  157. <style:default-style style:family="paragraph">
  158. <xsl:element name="style:paragraph-properties">
  159. <xsl:attribute name="style:tab-stop-distance"><xsl:value-of select="concat( number(/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:默认制表位位置),$uofUnit)"/></xsl:attribute>
  160. </xsl:element>
  161. <xsl:element name="style:text-properties">
  162. <xsl:choose>
  163. <xsl:when test="/uof:UOF/uof:式样集/uof:字体集/uof:默认字体">
  164. <xsl:attribute name="style:font-name"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:ascii"/></xsl:attribute>
  165. <xsl:attribute name="style:font-name-asian"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:fareast"/></xsl:attribute>
  166. <xsl:attribute name="style:font-name-complex"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:cs"/></xsl:attribute>
  167. </xsl:when>
  168. <xsl:otherwise>
  169. <xsl:attribute name="style:font-name">Times New Roman</xsl:attribute>
  170. </xsl:otherwise>
  171. </xsl:choose>
  172. <xsl:apply-templates select="uof:UOF/uof:式样集/uof:句式样/字:字体"/>
  173. <xsl:if test="not(uof:UOF/uof:式样集/uof:句式样/字:字体/@字:字号 or uof:UOF/uof:式样集/uof:句属性/字:字体/@字:字号)">
  174. <xsl:attribute name="fo:font-size">10pt</xsl:attribute>
  175. <xsl:attribute name="fo:font-size-asian">10pt</xsl:attribute>
  176. <xsl:attribute name="fo:font-size-complex">10pt</xsl:attribute>
  177. </xsl:if>
  178. </xsl:element>
  179. </style:default-style>
  180. </xsl:if>
  181. <xsl:for-each select="uof:段落式样[@字:类型='auto']">
  182. <xsl:element name="style:style">
  183. <xsl:attribute name="style:family">paragraph</xsl:attribute>
  184. <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  185. <xsl:if test="@字:基式样引用">
  186. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
  187. </xsl:if>
  188. <xsl:if test="@字:别名">
  189. <xsl:attribute name="style:display-name"><xsl:value-of select="@字:别名"/></xsl:attribute>
  190. </xsl:if>
  191. <xsl:element name="style:paragraph-properties">
  192. <xsl:call-template name="XDParagraphAttr"/>
  193. <xsl:apply-templates select="*[not(name()='字:大纲级别')]"/>
  194. <xsl:if test="字:制表位设置">
  195. <xsl:call-template name="ootab"/>
  196. </xsl:if>
  197. </xsl:element>
  198. <xsl:element name="style:text-properties">
  199. <xsl:apply-templates select="字:句属性/*"/>
  200. </xsl:element>
  201. <xsl:variable name="biaoshi" select="@字:标识符"/>
  202. <xsl:for-each select="../uof:句式样">
  203. <xsl:if test="@字:标识符=$biaoshi">
  204. <xsl:element name="style:text-properties">
  205. <xsl:apply-templates select="*"/>
  206. </xsl:element>
  207. </xsl:if>
  208. </xsl:for-each>
  209. </xsl:element>
  210. </xsl:for-each>
  211. <xsl:for-each select="uof:句式样[@字:类型='auto']">
  212. <xsl:element name="style:style">
  213. <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  214. <xsl:choose>
  215. <xsl:when test="ancestor::字:段落式样">
  216. <xsl:attribute name="style:family">paragraph</xsl:attribute>
  217. </xsl:when>
  218. <xsl:otherwise>
  219. <xsl:attribute name="style:family">text</xsl:attribute>
  220. </xsl:otherwise>
  221. </xsl:choose>
  222. <xsl:element name="style:text-properties">
  223. <xsl:apply-templates select="*"/>
  224. </xsl:element>
  225. </xsl:element>
  226. </xsl:for-each>
  227. <style:style style:name="ColumnBreakPara" style:family="paragraph">
  228. <style:text-properties fo:break-after="column"/>
  229. </style:style>
  230. <xsl:if test="uof:句式样">
  231. <style:default-style style:family="text"/>
  232. </xsl:if>
  233. <style:style style:name="Numbering Symbols" style:family="text"/>
  234. <style:style style:name="Bullet Symbols" style:family="text">
  235. <style:text-properties style:font-name="StarSymbol" fo:font-size="9pt" style:font-name-asian="StarSymbol" style:font-size-asian="9pt" style:font-name-complex="StarSymbol" style:font-size-complex="9pt"/>
  236. </style:style>
  237. <xsl:apply-templates select="uof:文字表式样" mode="table"/>
  238. <xsl:apply-templates select="uof:式样"/>
  239. <xsl:call-template name="脚注设置"/>
  240. <xsl:call-template name="尾注设置"/>
  241. <xsl:call-template name="行编号"/>
  242. </office:styles>
  243. <xsl:element name="office:automatic-styles">
  244. <style:style style:name="PageBreak" style:family="paragraph">
  245. <style:text-properties fo:break-before="page"/>
  246. </style:style>
  247. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性" mode="style"/>
  248. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:句">
  249. <xsl:variable name="stylename1" select="字:句属性/@字:式样引用"/>
  250. <xsl:element name="style:style">
  251. <xsl:variable name="stylenum">
  252. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
  253. </xsl:variable>
  254. <xsl:attribute name="style:name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
  255. <xsl:choose>
  256. <xsl:when test="ancestor::字:段落式样">
  257. <xsl:attribute name="style:family">paragraph</xsl:attribute>
  258. </xsl:when>
  259. <xsl:otherwise>
  260. <xsl:attribute name="style:family">text</xsl:attribute>
  261. </xsl:otherwise>
  262. </xsl:choose>
  263. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
  264. <xsl:if test="$stylename1=@字:标识符">
  265. <xsl:choose>
  266. <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性/字:格式修订/@字:修订信息引用">
  267. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  268. </xsl:when>
  269. <xsl:otherwise>
  270. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
  271. </xsl:otherwise>
  272. </xsl:choose>
  273. </xsl:if>
  274. </xsl:for-each>
  275. <xsl:element name="style:text-properties">
  276. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
  277. <xsl:if test="$stylename1=@字:标识符">
  278. <xsl:apply-templates select="./字:位置" mode="oo"/>
  279. <xsl:apply-templates select="*[not(name()='字:位置')]"/>
  280. </xsl:if>
  281. </xsl:for-each>
  282. </xsl:element>
  283. </xsl:element>
  284. </xsl:for-each>
  285. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'date']">
  286. <xsl:element name="number:date-style">
  287. <xsl:attribute name="style:name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
  288. <xsl:call-template name="日期域"/>
  289. </xsl:element>
  290. </xsl:for-each>
  291. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createdate']">
  292. <xsl:element name="number:date-style">
  293. <xsl:attribute name="style:name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
  294. <xsl:call-template name="日期域"/>
  295. </xsl:element>
  296. </xsl:for-each>
  297. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'savedate']">
  298. <xsl:element name="number:date-style">
  299. <xsl:attribute name="style:name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
  300. <xsl:call-template name="日期域"/>
  301. </xsl:element>
  302. </xsl:for-each>
  303. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'time']">
  304. <xsl:element name="number:date-style">
  305. <xsl:attribute name="style:name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
  306. <xsl:call-template name="时间域"/>
  307. </xsl:element>
  308. </xsl:for-each>
  309. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'edittime']">
  310. <xsl:element name="number:time-style">
  311. <xsl:attribute name="style:name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
  312. <xsl:call-template name="编辑时间"/>
  313. </xsl:element>
  314. </xsl:for-each>
  315. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createtime']">
  316. <xsl:element name="number:time-style">
  317. <xsl:attribute name="style:name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
  318. <xsl:call-template name="创建时间"/>
  319. </xsl:element>
  320. </xsl:for-each>
  321. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:文字表[not(@字:类型='sub-table')]" mode="style"/>
  322. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:单元格" mode="style"/>
  323. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:行[not(../../@字:类型='sub-table')]" mode="style"/>
  324. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:列宽集[not(../../@字:类型='sub-table')]" mode="style"/>
  325. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:自动编号信息">
  326. <xsl:variable name="currlistid" select="@字:编号引用"/>
  327. <xsl:variable name="currlist" select="."/>
  328. <xsl:variable name="rootlist" select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符 =$currlistid]"/>
  329. <xsl:if test="not(ancestor::字:段落/preceding-sibling::字:段落[1]/字:段落属性/字:自动编号信息/@字:编号引用= $currlistid)">
  330. <xsl:element name="text:list-style">
  331. <xsl:attribute name="style:name">List<xsl:value-of select="count(preceding::字:自动编号信息)"/></xsl:attribute>
  332. <xsl:for-each select="$rootlist">
  333. <xsl:for-each select="字:级别">
  334. <xsl:choose>
  335. <xsl:when test="字:项目符号">
  336. <xsl:call-template name="xiangmufuhao">
  337. <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
  338. </xsl:call-template>
  339. </xsl:when>
  340. <xsl:when test="字:图片符号引用">
  341. <xsl:call-template name="imagefuhao">
  342. <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
  343. </xsl:call-template>
  344. </xsl:when>
  345. <xsl:otherwise>
  346. <xsl:call-template name="jibianhao">
  347. <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
  348. </xsl:call-template>
  349. </xsl:otherwise>
  350. </xsl:choose>
  351. </xsl:for-each>
  352. </xsl:for-each>
  353. </xsl:element>
  354. </xsl:if>
  355. </xsl:for-each>
  356. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
  357. <xsl:element name="style:page-layout">
  358. <xsl:attribute name="style:name">pm<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any"/></xsl:attribute>
  359. <xsl:if test="字:对称页边距/@字:值='true'">
  360. <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
  361. </xsl:if>
  362. <xsl:element name="style:page-layout-properties">
  363. <xsl:if test="字:纸张方向">
  364. <xsl:attribute name="style:print-orientation"><xsl:choose><xsl:when test="字:纸张方向='portrait'">portrait</xsl:when><xsl:when test="字:纸张方向='landscape'">landscape</xsl:when></xsl:choose></xsl:attribute>
  365. </xsl:if>
  366. <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(字:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
  367. <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(字:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
  368. <xsl:choose>
  369. <xsl:when test="字:页边距">
  370. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
  371. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
  372. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
  373. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
  374. </xsl:when>
  375. <xsl:when test="字:装订线/@字:位置='top'">
  376. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
  377. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
  378. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
  379. </xsl:when>
  380. <xsl:when test="字:装订线/@字:位置='left' ">
  381. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
  382. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat((字:页边距/@uof:左+ 字:装订线/@字:距边界),$uofUnit)"/></xsl:attribute>
  383. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
  384. </xsl:when>
  385. <xsl:otherwise>
  386. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
  387. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
  388. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
  389. </xsl:otherwise>
  390. </xsl:choose>
  391. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
  392. <xsl:if test="字:拼页/@字:值='1' or 字:拼页/@字:值='true'">
  393. <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
  394. </xsl:if>
  395. <xsl:choose>
  396. <xsl:when test="string(字:文字排列方向)='vert-r2l'">
  397. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  398. </xsl:when>
  399. <xsl:when test="string(字:文字排列方向)='vert-l2r'">
  400. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  401. </xsl:when>
  402. <xsl:when test="string(字:文字排列方向)='hori-l2r'">
  403. <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
  404. </xsl:when>
  405. <xsl:when test="string(字:文字排列方向)='hori-r2l'">
  406. <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
  407. </xsl:when>
  408. <xsl:otherwise>
  409. <xsl:attribute name="style:writing-mode">page</xsl:attribute>
  410. </xsl:otherwise>
  411. </xsl:choose>
  412. <xsl:if test="字:网格设置/@字:网格类型">
  413. <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:网格设置/@字:网格类型='line-char'">both-nosnap</xsl:when><xsl:when test="字:网格设置/@字:网格类型='char'">both</xsl:when><xsl:when test="字:网格设置/@字:网格类型='line'">line</xsl:when><xsl:when test="字:网格设置/@字:网格类型='none'">none</xsl:when></xsl:choose></xsl:attribute>
  414. </xsl:if>
  415. <xsl:if test="字:网格设置/@字:宽度">
  416. <xsl:attribute name="style:layout-grid-base-width"><xsl:value-of select="concat(字:网格设置/@字:宽度,$uofUnit)"/></xsl:attribute>
  417. </xsl:if>
  418. <xsl:if test="字:网格设置/@字:高度">
  419. <xsl:attribute name="style:layout-grid-base-height"><xsl:value-of select="concat(字:网格设置/@字:高度,$uofUnit)"/></xsl:attribute>
  420. </xsl:if>
  421. <xsl:if test="字:网格设置/@字:显示网格">
  422. <xsl:attribute name="style:layout-grid-display"><xsl:value-of select="字:网格设置/@字:显示网格"/></xsl:attribute>
  423. </xsl:if>
  424. <xsl:if test="字:网格设置/@字:打印网格">
  425. <xsl:attribute name="style:layout-grid-print"><xsl:value-of select="字:网格设置/@字:打印网格"/></xsl:attribute>
  426. </xsl:if>
  427. <xsl:if test="字:稿纸设置/@字:类型">
  428. <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:稿纸设置/@字:类型='draft-paper' ">both</xsl:when><xsl:when test="字:稿纸设置/@字:类型='letter-paper' ">line</xsl:when><xsl:otherwise>both</xsl:otherwise></xsl:choose></xsl:attribute>
  429. </xsl:if>
  430. <xsl:if test="字:稿纸设置/@字:格式">
  431. <xsl:choose>
  432. <xsl:when test="字:稿纸设置/@字:格式='fourth-gear'">
  433. <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
  434. <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
  435. <xsl:attribute name="style:layout-grid-ruby-height">0.496cm</xsl:attribute>
  436. </xsl:when>
  437. <xsl:when test="字:稿纸设置/@字:格式='third-gear'">
  438. <xsl:attribute name="style:layout-grid-base-width">0.584cm</xsl:attribute>
  439. <xsl:attribute name="style:layout-grid-base-height">0.584cm</xsl:attribute>
  440. <xsl:attribute name="style:layout-grid-ruby-height">0.64cm</xsl:attribute>
  441. </xsl:when>
  442. <xsl:when test="字:稿纸设置/@字:格式='second-gear'">
  443. <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
  444. <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
  445. <xsl:attribute name="style:layout-grid-ruby-height">0.905cm</xsl:attribute>
  446. </xsl:when>
  447. <xsl:when test="字:稿纸设置/@字:格式='first-gear'">
  448. <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
  449. <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
  450. <xsl:attribute name="style:layout-grid-ruby-height">1.633cm</xsl:attribute>
  451. </xsl:when>
  452. </xsl:choose>
  453. <xsl:attribute name="style:layout-grid-display">true</xsl:attribute>
  454. <xsl:attribute name="style:layout-grid-print">true</xsl:attribute>
  455. </xsl:if>
  456. <xsl:if test="字:稿纸设置/@字:颜色">
  457. <xsl:attribute name="style:layout-grid-color"><xsl:value-of select="字:稿纸设置/@字:颜色"/></xsl:attribute>
  458. </xsl:if>
  459. <xsl:if test="字:边框">
  460. <xsl:for-each select="字:边框">
  461. <xsl:call-template name="uof:边框"/>
  462. </xsl:for-each>
  463. </xsl:if>
  464. <xsl:if test="字:填充">
  465. <xsl:for-each select="字:填充">
  466. <xsl:call-template name="uof:填充"/>
  467. </xsl:for-each>
  468. </xsl:if>
  469. <xsl:apply-templates select="字:填充"/>
  470. <xsl:attribute name="style:num-format"><xsl:variable name="format"><xsl:value-of select="字:页码设置/@字:格式"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
  471. <xsl:if test="字:纸张来源/@字:其他页">
  472. <xsl:attribute name="style:paper-tray-name"><xsl:value-of select="字:纸张来源/@字:其他页"/></xsl:attribute>
  473. </xsl:if>
  474. <xsl:if test="字:分栏/@字:栏数">
  475. <xsl:apply-templates select="字:分栏"/>
  476. </xsl:if>
  477. </xsl:element>
  478. <xsl:if test="字:页眉位置">
  479. <style:header-style>
  480. <xsl:element name="style:header-footer-properties">
  481. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页眉位置/@字:距边界,$uofUnit)"/></xsl:attribute>
  482. <xsl:variable name="long1" select="字:页眉位置/@字:距边界"/>
  483. <xsl:variable name="long2" select="字:页眉位置/@字:距版芯"/>
  484. <xsl:variable name="long" select="$long1 + $long2"/>
  485. <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
  486. <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
  487. </xsl:element>
  488. </style:header-style>
  489. </xsl:if>
  490. <xsl:if test="字:页脚位置">
  491. <style:footer-style>
  492. <xsl:element name="style:header-footer-properties">
  493. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页脚位置/@字:距边界,$uofUnit)"/></xsl:attribute>
  494. <xsl:variable name="long1" select="字:页脚位置/@字:距边界"/>
  495. <xsl:variable name="long2" select="字:页脚位置/@字:距版芯"/>
  496. <xsl:variable name="long" select="$long1 + $long2"/>
  497. <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
  498. <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
  499. </xsl:element>
  500. </style:footer-style>
  501. </xsl:if>
  502. </xsl:element>
  503. <xsl:if test="字:分栏/@字:栏数">
  504. <xsl:element name="style:style">
  505. <xsl:attribute name="style:name">sect<xsl:value-of select="count(preceding::字:节属性[字:分栏/@字:栏数])"/></xsl:attribute>
  506. <xsl:attribute name="style:family">section</xsl:attribute>
  507. <xsl:element name="style:page-layout-properties">
  508. <xsl:element name="style:columns">
  509. <xsl:attribute name="fo:column-count"><xsl:value-of select="number(字:分栏/@字:栏数)"/></xsl:attribute>
  510. <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat(number(字:分栏/@字:分割线宽度),$uofUnit)"/></xsl:attribute>
  511. </xsl:element>
  512. </xsl:element>
  513. </xsl:element>
  514. </xsl:if>
  515. </xsl:for-each>
  516. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif' or /uof:UOF/uof:对象集/uof:其他对象/@uof:私有类型='图片'">
  517. <style:style style:name="Graphics" style:family="graphic">
  518. <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
  519. </style:style>
  520. </xsl:if>
  521. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
  522. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
  523. <xsl:call-template name="duanluoshuxing"/>
  524. </xsl:element>
  525. <office:master-styles>
  526. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
  527. <xsl:element name="style:master-page">
  528. <xsl:variable name="master-page-name">
  529. <xsl:number count="字:节属性" from="/uof:UOF/uof:文字处理/字:主体" level="any"/>
  530. </xsl:variable>
  531. <xsl:attribute name="style:name"><xsl:choose>
  532. <xsl:when test="../@字:名称"><xsl:value-of select="../@字:名称"/></xsl:when>
  533. <xsl:otherwise>Standard</xsl:otherwise>
  534. </xsl:choose></xsl:attribute>
  535. <xsl:attribute name="style:page-layout-name"><xsl:value-of select="concat('pm', $master-page-name)"/></xsl:attribute>
  536. <xsl:if test="following::字:节属性">
  537. <xsl:attribute name="style:next-style-name">Standard<xsl:value-of select="$master-page-name +1"/></xsl:attribute>
  538. </xsl:if>
  539. <xsl:for-each select="字:页眉">
  540. <xsl:if test="字:首页页眉 or 字:奇数页页眉">
  541. <xsl:element name="style:header">
  542. <xsl:apply-templates select="字:奇数页页眉/字:段落 | 字:首页页眉/字:段落 | 字:奇数页页眉/字:文字表 | 字:首页页眉/字:文字表"/>
  543. </xsl:element>
  544. </xsl:if>
  545. <xsl:if test="字:偶数页页眉">
  546. <xsl:element name="style:header-left">
  547. <xsl:apply-templates select="字:偶数页页眉/字:段落 | 字:偶数页页眉/字:文字表"/>
  548. </xsl:element>
  549. </xsl:if>
  550. </xsl:for-each>
  551. <xsl:for-each select="字:页脚">
  552. <xsl:if test="字:奇数页页脚 or 字:首页页脚">
  553. <xsl:element name="style:footer">
  554. <xsl:apply-templates select="字:奇数页页脚/字:段落 | 字:首页页脚/字:段落 | 字:奇数页页脚/字:文字表 | 字:首页页脚/字:文字表"/>
  555. </xsl:element>
  556. </xsl:if>
  557. <xsl:if test="字:偶数页页脚">
  558. <xsl:element name="style:footer-left">
  559. <xsl:apply-templates select="字:偶数页页脚/字:段落 | 字:偶数页页脚/字:文字表"/>
  560. </xsl:element>
  561. </xsl:if>
  562. </xsl:for-each>
  563. <xsl:if test="字:奇偶页页眉页脚不同">
  564. <xsl:element name="style:header-left">
  565. </xsl:element>
  566. </xsl:if>
  567. </xsl:element>
  568. </xsl:for-each>
  569. </office:master-styles>
  570. </xsl:template>
  571. <xsl:template match="字:填充">
  572. <xsl:choose>
  573. <xsl:when test="图:颜色">
  574. <xsl:attribute name="fo:background-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
  575. </xsl:when>
  576. <xsl:when test="图:图案/@图:背景色">
  577. <xsl:attribute name="style:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:背景色,'#')"><xsl:value-of select="图:图案/@图:背景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
  578. </xsl:when>
  579. <xsl:when test="图:图案/@图:前景色">
  580. <xsl:attribute name="fo:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:前景色,'#')"><xsl:value-of select="图:图案/@图:前景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
  581. </xsl:when>
  582. </xsl:choose>
  583. </xsl:template>
  584. <xsl:template match="字:分栏">
  585. <xsl:element name="style:columns">
  586. <xsl:attribute name="fo:column-count"><xsl:value-of select="//字:分栏/@字:栏数"/></xsl:attribute>
  587. <xsl:variable name="aa">
  588. <xsl:value-of select="//字:分栏/字:栏[position()=1]/@字:间距"/>
  589. </xsl:variable>
  590. <xsl:if test="//字:分栏/@字:等宽='true' ">
  591. <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat($aa * 2,$uofUnit)"/></xsl:attribute>
  592. </xsl:if>
  593. <xsl:if test="//字:分栏/@字:分隔线宽度">
  594. <xsl:element name="style:column-sep">
  595. <xsl:attribute name="style:width"><xsl:value-of select="concat(@字:分隔线宽度,$uofUnit)"/></xsl:attribute>
  596. <xsl:attribute name="style:color"><xsl:value-of select="@字:分隔线颜色"/></xsl:attribute>
  597. <xsl:attribute name="style:height">100%</xsl:attribute>
  598. <xsl:attribute name="style:vertical-align">top</xsl:attribute>
  599. </xsl:element>
  600. </xsl:if>
  601. <xsl:for-each select="//字:分栏/字:栏">
  602. <xsl:element name="style:column">
  603. <xsl:attribute name="style:rel-width"><xsl:value-of select="@字:宽度"/>*</xsl:attribute>
  604. <xsl:if test="parent::字:分栏/@字:宽度='true'">
  605. <xsl:choose>
  606. <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
  607. <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
  608. <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  609. </xsl:when>
  610. <xsl:when test="self::node()[not(following-sibling::字:栏)]">
  611. <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  612. <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
  613. </xsl:when>
  614. <xsl:otherwise>
  615. <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  616. <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  617. </xsl:otherwise>
  618. </xsl:choose>
  619. </xsl:if>
  620. <xsl:if test="parent::字:分栏/@字:等宽='false'">
  621. <xsl:variable name="last" select="preceding-sibling::字:栏[1]/@字:间距"/>
  622. <xsl:choose>
  623. <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
  624. <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
  625. <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  626. </xsl:when>
  627. <xsl:when test="self::node()[not(following-sibling::字:栏)]">
  628. <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
  629. <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
  630. </xsl:when>
  631. <xsl:otherwise>
  632. <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
  633. <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
  634. </xsl:otherwise>
  635. </xsl:choose>
  636. </xsl:if>
  637. </xsl:element>
  638. </xsl:for-each>
  639. </xsl:element>
  640. </xsl:template>
  641. <xsl:template match="uof:文字表式样" mode="table">
  642. <style:style style:family="table">
  643. <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  644. <xsl:if test="@字:基式样引用">
  645. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
  646. </xsl:if>
  647. <style:table-properties>
  648. <xsl:choose>
  649. <xsl:when test="字:对齐">
  650. <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
  651. </xsl:when>
  652. <xsl:otherwise>
  653. <xsl:attribute name="table:align">margins</xsl:attribute>
  654. </xsl:otherwise>
  655. </xsl:choose>
  656. <xsl:choose>
  657. <xsl:when test="字:宽度/@字:相对宽度">
  658. <xsl:variable name="reltblw">
  659. <xsl:value-of select="concat(number(字:宽度/@字:相对宽度),'%')"/>
  660. </xsl:variable>
  661. <xsl:variable name="pagew">
  662. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
  663. </xsl:variable>
  664. <xsl:variable name="leftm">
  665. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
  666. </xsl:variable>
  667. <xsl:variable name="rightm">
  668. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
  669. </xsl:variable>
  670. <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
  671. <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
  672. </xsl:when>
  673. <xsl:when test="字:宽度/@字:绝对宽度">
  674. <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
  675. </xsl:when>
  676. <xsl:otherwise/>
  677. </xsl:choose>
  678. </style:table-properties>
  679. </style:style>
  680. </xsl:template>
  681. <xsl:template match="字:文字表" mode="style">
  682. <xsl:element name="style:style">
  683. <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
  684. <xsl:attribute name="style:family">table</xsl:attribute>
  685. <xsl:if test="@字:式样引用">
  686. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
  687. </xsl:if>
  688. <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
  689. <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::*[1]/@字:名称"/></xsl:attribute>
  690. </xsl:if>
  691. <xsl:element name="style:table-properties">
  692. <xsl:for-each select="字:文字表属性">
  693. <xsl:variable name="biaoshi" select="@字:式样引用"/>
  694. <xsl:choose>
  695. <xsl:when test="字:对齐 = 'left' or 字:对齐 = 'center' or 字:对齐 = 'right'">
  696. <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
  697. </xsl:when>
  698. <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐">
  699. <xsl:attribute name="table:align"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐"/></xsl:attribute>
  700. </xsl:when>
  701. <xsl:otherwise>
  702. <xsl:attribute name="table:align">margins</xsl:attribute>
  703. </xsl:otherwise>
  704. </xsl:choose>
  705. <xsl:if test="字:左缩进">
  706. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(number(字:左缩进),$uofUnit)"/></xsl:attribute>
  707. </xsl:if>
  708. <xsl:if test="字:绕排/@字:值='around'">
  709. <xsl:if test="字:绕排边距/@字:上">
  710. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:绕排边距/@字:上,$uofUnit)"/></xsl:attribute>
  711. </xsl:if>
  712. <xsl:if test="字:绕排边距/@字:左">
  713. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:绕排边距/@字:左,$uofUnit)"/></xsl:attribute>
  714. </xsl:if>
  715. <xsl:if test="字:绕排边距/@字:右">
  716. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:绕排边距/@字:右,$uofUnit)"/></xsl:attribute>
  717. </xsl:if>
  718. <xsl:if test="字:绕排边距/@字:下">
  719. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:绕排边距/@字:下,$uofUnit)"/></xsl:attribute>
  720. </xsl:if>
  721. </xsl:if>
  722. <xsl:if test="@字:式样引用">
  723. <xsl:variable name="rootStyle" select="@字:式样引用"/>
  724. <xsl:variable name="rootStyleNode" select="/uof:UOF/uof:式样集/字:文字表式样[@字:基式样引用 = $rootStyle]"/>
  725. <xsl:variable name="paddingleft">
  726. <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:左"/>
  727. </xsl:variable>
  728. <xsl:variable name="paddingright">
  729. <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:右"/>
  730. </xsl:variable>
  731. <xsl:variable name="paddingtop">
  732. <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:上"/>
  733. </xsl:variable>
  734. <xsl:variable name="paddingbottom">
  735. <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:下"/>
  736. </xsl:variable>
  737. <xsl:if test="$rootStyleNode/字:文字表属性/字:边距/@uof:左">
  738. <xsl:attribute name="fo:margin-left">-<xsl:value-of select="(number($paddingleft))* $other-to-cm-conversion-factor"/>cm</xsl:attribute>
  739. </xsl:if>
  740. </xsl:if>
  741. <xsl:choose>
  742. <xsl:when test="字:宽度/@字:相对宽度">
  743. <xsl:variable name="reltblw">
  744. <xsl:value-of select="字:宽度/@字:相对宽度"/>
  745. </xsl:variable>
  746. <xsl:variable name="pagew">
  747. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
  748. </xsl:variable>
  749. <xsl:variable name="leftm">
  750. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
  751. </xsl:variable>
  752. <xsl:variable name="rightm">
  753. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
  754. </xsl:variable>
  755. <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
  756. <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
  757. </xsl:when>
  758. <xsl:when test="字:宽度/@字:绝对宽度">
  759. <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
  760. </xsl:when>
  761. <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 or /uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度">
  762. <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 * 100,'%')"/></xsl:attribute>
  763. <xsl:attribute name="style:width"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度"/></xsl:attribute>
  764. </xsl:when>
  765. <xsl:otherwise>
  766. <xsl:variable name="pagew">
  767. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
  768. </xsl:variable>
  769. <xsl:variable name="leftm">
  770. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
  771. </xsl:variable>
  772. <xsl:variable name="rightm">
  773. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
  774. </xsl:variable>
  775. <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)),$uofUnit)"/></xsl:attribute>
  776. </xsl:otherwise>
  777. </xsl:choose>
  778. <xsl:variable name="tblsize" select="sum(字:列宽集/字:列宽)"/>
  779. <xsl:if test="(not($tblsize='0')) and not(字:宽度) ">
  780. <xsl:choose>
  781. <xsl:when test="字:左缩进">
  782. <xsl:attribute name="style:width"><xsl:value-of select="concat( number($tblsize - 字:左缩进), $uofUnit)"/></xsl:attribute>
  783. </xsl:when>
  784. <xsl:otherwise>
  785. <xsl:attribute name="style:width"><xsl:value-of select="concat( number(sum(字:列宽集/字:列宽) ), $uofUnit)"/></xsl:attribute>
  786. </xsl:otherwise>
  787. </xsl:choose>
  788. </xsl:if>
  789. <xsl:if test="字:边框">
  790. <xsl:for-each select="字:边框">
  791. <xsl:call-template name="uof:边框"/>
  792. </xsl:for-each>
  793. </xsl:if>
  794. <xsl:for-each select="字:填充">
  795. <xsl:call-template name="uof:填充"/>
  796. </xsl:for-each>
  797. </xsl:for-each>
  798. </xsl:element>
  799. </xsl:element>
  800. </xsl:template>
  801. <xsl:template match="字:列宽集" mode="style">
  802. <xsl:choose>
  803. <xsl:when test="not(./字:列宽)">
  804. <xsl:for-each select="../..">
  805. <xsl:for-each select="字:行[1]/字:单元格">
  806. <xsl:element name="style:style">
  807. <xsl:attribute name="style:family">table-column</xsl:attribute>
  808. <xsl:attribute name="style:name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
  809. <xsl:element name="style:table-column-properties">
  810. <xsl:choose>
  811. <xsl:when test="字:单元格属性/字:宽度/@字:相对值">
  812. <xsl:variable name="tblw1">
  813. <xsl:choose>
  814. <xsl:when test="../../字:文字表属性/字:宽度/@字:绝对宽度">
  815. <xsl:value-of select="../../字:文字表属性/字:宽度/@字:绝对宽度"/>
  816. </xsl:when>
  817. <xsl:when test="../../字:文字表属性/字:宽度/@字:相对宽度">
  818. <xsl:variable name="pagew">
  819. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
  820. </xsl:variable>
  821. <xsl:variable name="leftm">
  822. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
  823. </xsl:variable>
  824. <xsl:variable name="rightm">
  825. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
  826. </xsl:variable>
  827. <xsl:variable name="relw">
  828. <xsl:value-of select="../../字:文字表属性/字:宽度/@字:相对宽度"/>
  829. </xsl:variable>
  830. <xsl:value-of select=" ( number($pagew)-number($leftm)-number($rightm))* number($relw) div 100"/>
  831. </xsl:when>
  832. <xsl:otherwise>
  833. <xsl:variable name="pagew">
  834. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
  835. </xsl:variable>
  836. <xsl:variable name="leftm">
  837. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
  838. </xsl:variable>
  839. <xsl:variable name="rightm">
  840. <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
  841. </xsl:variable>
  842. <xsl:value-of select="(number($pagew)-number($leftm)-number($rightm))"/>
  843. </xsl:otherwise>
  844. </xsl:choose>
  845. </xsl:variable>
  846. <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(number($tblw1)*number(字:单元格属性/字:宽度/@字:相对值) div 100),$uofUnit)"/></xsl:attribute>
  847. </xsl:when>
  848. <xsl:when test="字:单元格属性/字:宽度/@字:绝对值">
  849. <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(字:单元格属性/字:宽度/@字:绝对值),$uofUnit)"/></xsl:attribute>
  850. </xsl:when>
  851. <xsl:otherwise>
  852. <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
  853. </xsl:otherwise>
  854. </xsl:choose>
  855. </xsl:element>
  856. </xsl:element>
  857. </xsl:for-each>
  858. </xsl:for-each>
  859. </xsl:when>
  860. <xsl:otherwise>
  861. <xsl:for-each select="字:列宽">
  862. <xsl:element name="style:style">
  863. <xsl:attribute name="style:family">table-column</xsl:attribute>
  864. <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
  865. <xsl:variable name="tableRoot" select="ancestor::字:文字表"/>
  866. <xsl:element name="style:table-column-properties">
  867. <xsl:choose>
  868. <xsl:when test="string(.)">
  869. <xsl:attribute name="style:column-width"><xsl:value-of select="concat(.,$uofUnit)"/></xsl:attribute>
  870. </xsl:when>
  871. <xsl:otherwise>
  872. <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
  873. </xsl:otherwise>
  874. </xsl:choose>
  875. </xsl:element>
  876. </xsl:element>
  877. </xsl:for-each>
  878. </xsl:otherwise>
  879. </xsl:choose>
  880. </xsl:template>
  881. <xsl:template match="字:行" mode="style">
  882. <xsl:element name="style:style">
  883. <xsl:attribute name="style:family">table-row</xsl:attribute>
  884. <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
  885. <xsl:element name="style:table-row-properties">
  886. <xsl:for-each select="字:表行属性">
  887. <xsl:choose>
  888. <xsl:when test="字:高度/@字:固定值">
  889. <xsl:attribute name="style:row-height"><xsl:value-of select="concat(number(字:高度/@字:固定值),$uofUnit)"/></xsl:attribute>
  890. </xsl:when>
  891. <xsl:when test="字:高度/@字:最小值">
  892. <xsl:attribute name="style:min-row-height"><xsl:value-of select="concat(number(字:高度/@字:最小值), $uofUnit )"/></xsl:attribute>
  893. </xsl:when>
  894. </xsl:choose>
  895. <xsl:attribute name="fo:keep-together"><xsl:value-of select="字:跨页/@字:值"/></xsl:attribute>
  896. </xsl:for-each>
  897. </xsl:element>
  898. </xsl:element>
  899. </xsl:template>
  900. <xsl:template match="字:单元格" mode="style">
  901. <style:style>
  902. <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
  903. <xsl:attribute name="style:family">table-cell</xsl:attribute>
  904. <xsl:element name="style:table-cell-properties">
  905. <xsl:for-each select="字:单元格属性">
  906. <xsl:choose>
  907. <xsl:when test="字:单元格边距/@字:左">
  908. <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(number(字:单元格边距/@字:左),$uofUnit)"/></xsl:attribute>
  909. </xsl:when>
  910. <xsl:otherwise>
  911. <xsl:attribute name="fo:padding-left"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:左"/></xsl:attribute>
  912. </xsl:otherwise>
  913. </xsl:choose>
  914. <xsl:choose>
  915. <xsl:when test="字:单元格边距/@字:右">
  916. <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(number(字:单元格边距/@字:右),$uofUnit)"/></xsl:attribute>
  917. </xsl:when>
  918. <xsl:otherwise>
  919. <xsl:attribute name="fo:padding-right"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:右"/></xsl:attribute>
  920. </xsl:otherwise>
  921. </xsl:choose>
  922. <xsl:choose>
  923. <xsl:when test="字:单元格边距/@字:上">
  924. <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(number(字:单元格边距/@字:上),$uofUnit)"/></xsl:attribute>
  925. </xsl:when>
  926. <xsl:otherwise>
  927. <xsl:attribute name="fo:padding-top"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:上"/></xsl:attribute>
  928. </xsl:otherwise>
  929. </xsl:choose>
  930. <xsl:choose>
  931. <xsl:when test="字:单元格边距/@字:下">
  932. <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(number(字:单元格边距/@字:下),$uofUnit)"/></xsl:attribute>
  933. </xsl:when>
  934. <xsl:otherwise>
  935. <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:下"/></xsl:attribute>
  936. </xsl:otherwise>
  937. </xsl:choose>
  938. <xsl:variable name="cellbefore">
  939. <xsl:value-of select="count(ancestor::字:单元格/preceding-sibling::字:单元格)"/>
  940. </xsl:variable>
  941. <xsl:variable name="cellafter">
  942. <xsl:value-of select="count(ancestor::字:单元格/following-sibling::字:单元格)"/>
  943. </xsl:variable>
  944. <xsl:variable name="rowbefore">
  945. <xsl:value-of select="count(ancestor::字:行/preceding-sibling::字:行)"/>
  946. </xsl:variable>
  947. <xsl:choose>
  948. <xsl:when test="字:边框">
  949. <xsl:for-each select="字:边框">
  950. <xsl:call-template name="uof:边框"/>
  951. </xsl:for-each>
  952. </xsl:when>
  953. <xsl:otherwise>
  954. <xsl:choose>
  955. <xsl:when test="number($cellafter) &gt; 0">
  956. <xsl:attribute name="fo:border-right">none</xsl:attribute>
  957. </xsl:when>
  958. <xsl:otherwise>
  959. <xsl:attribute name="fo:border-right">0.002cm solid #000000</xsl:attribute>
  960. </xsl:otherwise>
  961. </xsl:choose>
  962. <xsl:attribute name="fo:border-left">0.002cm solid #000000</xsl:attribute>
  963. <xsl:choose>
  964. <xsl:when test="number($rowbefore) &gt; 0">
  965. <xsl:attribute name="fo:border-top">none</xsl:attribute>
  966. </xsl:when>
  967. <xsl:otherwise>
  968. <xsl:attribute name="fo:border-top">0.002cm solid #000000</xsl:attribute>
  969. </xsl:otherwise>
  970. </xsl:choose>
  971. <xsl:attribute name="fo:border-bottom">0.002cm solid #000000</xsl:attribute>
  972. </xsl:otherwise>
  973. </xsl:choose>
  974. <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:垂直对齐方式='center' ">middle</xsl:when><xsl:when test="字:垂直对齐方式='bottom' ">bottom</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
  975. <xsl:for-each select="字:填充">
  976. <xsl:call-template name="uof:填充"/>
  977. </xsl:for-each>
  978. </xsl:for-each>
  979. </xsl:element>
  980. </style:style>
  981. </xsl:template>
  982. <xsl:template match="uof:字体集">
  983. <xsl:element name="office:font-face-decls">
  984. <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="roman" style:font-pitch="variable"/>
  985. <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
  986. <style:font-face style:name="Symbol" svg:font-family="Symbol" style:font-family-generic="roman" style:font-pitch="variable" style:font-charset="x-symbol"/>
  987. <style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/>
  988. <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
  989. <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
  990. </xsl:if>
  991. <xsl:for-each select="uof:字体声明">
  992. <xsl:element name="style:font-face">
  993. <xsl:attribute name="style:name"><xsl:value-of select="@uof:标识符"/></xsl:attribute>
  994. <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:名称"/></xsl:attribute>
  995. <xsl:if test="@uof:字符集 = '02'">
  996. <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
  997. </xsl:if>
  998. <xsl:if test="@uof:字体族">
  999. <xsl:choose>
  1000. <xsl:when test="@uof:字体族 = 'Swiss'">
  1001. <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
  1002. </xsl:when>
  1003. <xsl:when test="@uof:字体族 ='Modern'">
  1004. <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
  1005. </xsl:when>
  1006. <xsl:when test="@uof:字体族='Roman'">
  1007. <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
  1008. </xsl:when>
  1009. <xsl:when test="@uof:字体族 ='Script'">
  1010. <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
  1011. </xsl:when>
  1012. <xsl:when test="@uof:字体族 ='Decorative'">
  1013. <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
  1014. </xsl:when>
  1015. <xsl:when test="@uof:字体族 ='System'">
  1016. <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
  1017. </xsl:when>
  1018. <xsl:otherwise>
  1019. <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
  1020. </xsl:otherwise>
  1021. </xsl:choose>
  1022. </xsl:if>
  1023. <xsl:attribute name="style:font-pitch">12</xsl:attribute>
  1024. </xsl:element>
  1025. </xsl:for-each>
  1026. <xsl:apply-templates select="uof:字体声明"/>
  1027. </xsl:element>
  1028. </xsl:template>
  1029. <xsl:template match="uof:式样">
  1030. <xsl:element name="style:text-properties">
  1031. <xsl:apply-templates select="uof:句式样/*"/>
  1032. <xsl:apply-templates select="uof:段落式样/*"/>
  1033. <xsl:call-template name="paragraph-properties"/>
  1034. </xsl:element>
  1035. </xsl:template>
  1036. <xsl:template match="uof:段落式样"/>
  1037. <xsl:template match="uof:句式样"/>
  1038. <xsl:template match="字:公用处理规则">
  1039. <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
  1040. </xsl:template>
  1041. <xsl:template match="uof:文字处理/字:公用处理规则/字:文档设置">
  1042. <office:settings>
  1043. <config:config-item-set config:name="ooo:view-settings">
  1044. <config:config-item config:name="InBrowseMode" config:type="boolean">
  1045. <xsl:choose>
  1046. <xsl:when test="字:当前视图='web'">true</xsl:when>
  1047. <xsl:otherwise>false</xsl:otherwise>
  1048. </xsl:choose>
  1049. </config:config-item>
  1050. <config:config-item-map-indexed config:name="Views">
  1051. <config:config-item-map-entry>
  1052. <xsl:if test="字:缩放">
  1053. <config:config-item config:name="VisibleRight" config:type="int">1</config:config-item>
  1054. <config:config-item config:name="VisibleBottom" config:type="int">1</config:config-item>
  1055. <xsl:choose>
  1056. <xsl:when test="字:缩放 = 'best-fit'">
  1057. <config:config-item config:name="ZoomType" config:type="short">3</config:config-item>
  1058. </xsl:when>
  1059. <xsl:when test="字:缩放 = 'full-page'">
  1060. <config:config-item config:name="ZoomType" config:type="short">2</config:config-item>
  1061. </xsl:when>
  1062. <xsl:when test="字:缩放 = 'text-fit'">
  1063. <config:config-item config:name="ZoomType" config:type="short">1</config:config-item>
  1064. </xsl:when>
  1065. <xsl:otherwise>
  1066. <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
  1067. </xsl:otherwise>
  1068. </xsl:choose>
  1069. <config:config-item config:name="ZoomFactor" config:type="short">
  1070. <xsl:value-of select="字:缩放"/>
  1071. </config:config-item>
  1072. </xsl:if>
  1073. </config:config-item-map-entry>
  1074. </config:config-item-map-indexed>
  1075. </config:config-item-set>
  1076. <config:config-item-set config:name="configuration-settings">
  1077. <config:config-item-map-indexed config:name="ForbiddenCharacters">
  1078. <config:config-item-map-entry>
  1079. <config:config-item config:name="Language" config:type="string">zh</config:config-item>
  1080. <config:config-item config:name="Country" config:type="string">CN</config:config-item>
  1081. <config:config-item config:name="Variant" config:type="string"/>
  1082. <config:config-item config:name="BeginLine" config:type="string">
  1083. <xsl:choose>
  1084. <xsl:when test="字:标点禁则/字:行首字符 or *[@uof:locID='t0007']/*[@uof:locID='t0008']">
  1085. <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0008']"/>
  1086. </xsl:when>
  1087. <xsl:otherwise>:!),.:;?]}_'"、。〉》」』】〕〗〞︰︱︳﹐_﹒﹔﹕﹖﹗﹚﹜﹞!),.:;?|}︴︶︸︺︼︾﹀﹂﹄﹏_~¢々‖_·ˇˉ―--′</xsl:otherwise>
  1088. </xsl:choose>
  1089. </config:config-item>
  1090. <config:config-item config:name="EndLine" config:type="string">
  1091. <xsl:choose>
  1092. <xsl:when test="字:标点禁则/字:行尾字符 or *[@uof:locID='t0007']/*[@uof:locID='t0009']">
  1093. <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0009']"/>
  1094. </xsl:when>
  1095. <xsl:otherwise>([{__'"‵〈《「『【〔〖([{£¥〝︵︷︹︻︽︿﹁﹃﹙﹛﹝({</xsl:otherwise>
  1096. </xsl:choose>
  1097. </config:config-item>
  1098. </config:config-item-map-entry>
  1099. </config:config-item-map-indexed>
  1100. </config:config-item-set>
  1101. </office:settings>
  1102. </xsl:template>
  1103. <xsl:template match="uof:文字处理">
  1104. <xsl:element name="office:body">
  1105. <xsl:element name="office:text">
  1106. <xsl:call-template name="GenerateTrackChanges"/>
  1107. <text:sequence-decls>
  1108. <xsl:call-template name="default_sequence_declaration"/>
  1109. </text:sequence-decls>
  1110. <xsl:apply-templates/>
  1111. </xsl:element>
  1112. </xsl:element>
  1113. </xsl:template>
  1114. <xsl:template name="default_sequence_declaration">
  1115. <text:sequence-decl text:display-outline-level="0" text:name="Illustration">
  1116. </text:sequence-decl>
  1117. <text:sequence-decl text:display-outline-level="0" text:name="Table">
  1118. </text:sequence-decl>
  1119. <text:sequence-decl text:display-outline-level="0" text:name="Text">
  1120. </text:sequence-decl>
  1121. <text:sequence-decl text:display-outline-level="0" text:name="Drawing">
  1122. </text:sequence-decl>
  1123. <text:sequence-decl text:display-outline-level="0" text:name="AutoNr">
  1124. </text:sequence-decl>
  1125. </xsl:template>
  1126. <xsl:template name="段落" match="字:段落[not((preceding-sibling::字:段落/字:域开始) and (not(preceding-sibling::字:段落/字:域结束)))][not(字:段落属性[字:自动编号信息])]">
  1127. <xsl:if test="字:域开始/@字:类型='caption'">
  1128. <xsl:apply-templates select="字:域代码"/>
  1129. </xsl:if>
  1130. <xsl:if test="字:域开始/@字:类型='REF'">
  1131. <xsl:call-template name="目录域"/>
  1132. </xsl:if>
  1133. <xsl:if test="字:域开始/@字:类型='INDEX'">
  1134. <xsl:call-template name="索引域"/>
  1135. </xsl:if>
  1136. <xsl:choose>
  1137. <xsl:when test="string(parent::node()/@uof:locID)='t0107'">
  1138. <xsl:apply-templates select="字:脚注"/>
  1139. </xsl:when>
  1140. <xsl:when test="string(parent::node()/@uof:locID)='t0108'">
  1141. <xsl:apply-templates select="字:尾注"/>
  1142. </xsl:when>
  1143. <xsl:otherwise>
  1144. <xsl:call-template name="commonParagraph"/>
  1145. </xsl:otherwise>
  1146. </xsl:choose>
  1147. </xsl:template>
  1148. <xsl:template match="字:脚注">
  1149. <xsl:element name="text:note">
  1150. <xsl:attribute name="text:note-class">footnote</xsl:attribute>
  1151. <xsl:element name="text:note-citation">
  1152. <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
  1153. <xsl:value-of select="@字:引文体"/>
  1154. </xsl:element>
  1155. <xsl:element name="text:note-body">
  1156. <xsl:for-each select="字:段落">
  1157. <xsl:call-template name="commonParagraph"/>
  1158. </xsl:for-each>
  1159. </xsl:element>
  1160. </xsl:element>
  1161. </xsl:template>
  1162. <xsl:template match="字:尾注">
  1163. <xsl:element name="text:note">
  1164. <xsl:attribute name="text:note-class">endnote</xsl:attribute>
  1165. <xsl:element name="text:note-citation">
  1166. <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
  1167. <xsl:value-of select="@字:引文体"/>
  1168. </xsl:element>
  1169. <xsl:element name="text:note-body">
  1170. <xsl:for-each select="字:段落">
  1171. <xsl:call-template name="commonParagraph"/>
  1172. </xsl:for-each>
  1173. </xsl:element>
  1174. </xsl:element>
  1175. </xsl:template>
  1176. <xsl:template match="字:锚点">
  1177. <xsl:call-template name="图形解析"/>
  1178. </xsl:template>
  1179. <xsl:key match="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页眉//字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页脚//字:锚点" name="rel_graphic_name" use="字:图形/@字:图形引用"/>
  1180. <xsl:template match="图:图形">
  1181. <xsl:variable name="random-name">
  1182. <xsl:value-of select="generate-id()"/>
  1183. </xsl:variable>
  1184. <xsl:variable name="draw-name">
  1185. <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
  1186. </xsl:variable>
  1187. <xsl:call-template name="graphic-fill">
  1188. <xsl:with-param name="draw-name" select="$draw-name"/>
  1189. <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
  1190. </xsl:call-template>
  1191. <xsl:choose>
  1192. <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变 | 图:预定义图形/图:属性/图:填充/图:颜色 | 图:预定义图形/图:属性/图:填充/图:图片 | 图:预定义图形/图:属性/图:填充/图:位图">
  1193. <xsl:element name="style:style">
  1194. <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1195. <xsl:attribute name="style:family">graphic</xsl:attribute>
  1196. <xsl:if test="图:文本内容/@图:自动换行='true' or 图:文本内容/@图:自动换行='1'">
  1197. <xsl:attribute name="draw:fit-to-contour">true</xsl:attribute>
  1198. </xsl:if>
  1199. <xsl:element name="style:graphic-properties">
  1200. <xsl:call-template name="process-graphics">
  1201. <xsl:with-param name="draw-name" select="$draw-name"/>
  1202. </xsl:call-template>
  1203. </xsl:element>
  1204. <xsl:if test="图:文本内容/@图:文字排列方向">
  1205. <xsl:choose>
  1206. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  1207. <style:paragraph-properties style:writing-mode="tb-rl"/>
  1208. </xsl:when>
  1209. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  1210. <style:paragraph-properties style:writing-mode="tb-rl"/>
  1211. </xsl:when>
  1212. </xsl:choose>
  1213. </xsl:if>
  1214. </xsl:element>
  1215. </xsl:when>
  1216. <xsl:otherwise>
  1217. <xsl:element name="style:style">
  1218. <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1219. <xsl:attribute name="style:family">graphic</xsl:attribute>
  1220. <xsl:element name="style:graphic-properties">
  1221. <xsl:if test="@图:其他对象 or key('rel_graphic_name',@图:标识符)/字:锚点属性/字:锚点属性/字:位置/字:垂直/字:相对/@字:相对于">
  1222. <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
  1223. <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
  1224. <xsl:attribute name="draw:luminance">0%</xsl:attribute>
  1225. <xsl:attribute name="draw:contrast">0%</xsl:attribute>
  1226. <xsl:attribute name="draw:gamma">100%</xsl:attribute>
  1227. <xsl:attribute name="draw:red">0%</xsl:attribute>
  1228. <xsl:attribute name="draw:green">0%</xsl:attribute>
  1229. <xsl:attribute name="draw:blue">0%</xsl:attribute>
  1230. <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
  1231. <xsl:attribute name="style:mirror">none</xsl:attribute>
  1232. </xsl:if>
  1233. <xsl:call-template name="process-graphics"/>
  1234. </xsl:element>
  1235. <xsl:if test="图:文本内容/@图:文字排列方向">
  1236. <xsl:choose>
  1237. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  1238. <style:paragraph-properties style:writing-mode="tb-rl"/>
  1239. </xsl:when>
  1240. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  1241. <style:paragraph-properties style:writing-mode="tb-rl"/>
  1242. </xsl:when>
  1243. </xsl:choose>
  1244. </xsl:if>
  1245. </xsl:element>
  1246. </xsl:otherwise>
  1247. </xsl:choose>
  1248. </xsl:template>
  1249. <xsl:template name="bina_graphic">
  1250. <xsl:param name="refGraphic"/>
  1251. <xsl:element name="office:binary-data">
  1252. <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
  1253. <xsl:value-of select="uof:数据"/>
  1254. </xsl:for-each>
  1255. </xsl:element>
  1256. <text:p/>
  1257. </xsl:template>
  1258. <xsl:template name="graphic-fill">
  1259. <xsl:param name="draw-name"/>
  1260. <xsl:param name="gradient-name"/>
  1261. <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
  1262. <xsl:element name="draw:gradient">
  1263. <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
  1264. <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
  1265. <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
  1266. <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
  1267. <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
  1268. <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
  1269. <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
  1270. <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
  1271. <xsl:if test="$gradient-name/@图:种子X位置">
  1272. <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
  1273. </xsl:if>
  1274. <xsl:if test="$gradient-name/@图:种子Y位置">
  1275. <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
  1276. </xsl:if>
  1277. </xsl:element>
  1278. </xsl:if>
  1279. <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
  1280. <xsl:element name="draw:marker">
  1281. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  1282. <xsl:choose>
  1283. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
  1284. <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
  1285. <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
  1286. </xsl:when>
  1287. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
  1288. <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
  1289. <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
  1290. </xsl:when>
  1291. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
  1292. <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
  1293. <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
  1294. </xsl:when>
  1295. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
  1296. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  1297. <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
  1298. </xsl:when>
  1299. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
  1300. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  1301. <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
  1302. </xsl:when>
  1303. </xsl:choose>
  1304. </xsl:element>
  1305. </xsl:if>
  1306. <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
  1307. <xsl:element name="draw:marker">
  1308. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  1309. <xsl:choose>
  1310. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
  1311. <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
  1312. <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
  1313. </xsl:when>
  1314. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
  1315. <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
  1316. <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
  1317. </xsl:when>
  1318. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
  1319. <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
  1320. <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
  1321. </xsl:when>
  1322. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
  1323. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  1324. <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
  1325. </xsl:when>
  1326. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
  1327. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  1328. <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
  1329. </xsl:when>
  1330. </xsl:choose>
  1331. </xsl:element>
  1332. </xsl:if>
  1333. <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
  1334. <xsl:element name="draw:fill-image">
  1335. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:when></xsl:choose></xsl:attribute>
  1336. <xsl:call-template name="bina_graphic">
  1337. <xsl:with-param name="refGraphic">
  1338. <xsl:choose>
  1339. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
  1340. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
  1341. </xsl:when>
  1342. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称">
  1343. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/>
  1344. </xsl:when>
  1345. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
  1346. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
  1347. </xsl:when>
  1348. </xsl:choose>
  1349. </xsl:with-param>
  1350. </xsl:call-template>
  1351. </xsl:element>
  1352. </xsl:if>
  1353. <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
  1354. <xsl:variable name="line" select="图:预定义图形/图:属性/图:线型"/>
  1355. <xsl:element name="draw:stroke-dash">
  1356. <xsl:choose>
  1357. <xsl:when test="$line='dash-long' or $line='dash-long-heavy'">
  1358. <xsl:attribute name="draw:name">Fine_20_Dashed</xsl:attribute>
  1359. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1360. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1361. <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
  1362. <xsl:attribute name="draw:dots2">1</xsl:attribute>
  1363. <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
  1364. <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
  1365. </xsl:when>
  1366. <xsl:when test="$line='dot-dot-dash' or $line='dash-dot-dot-heavy'">
  1367. <xsl:attribute name="draw:name">2 Dots 1 Dash</xsl:attribute>
  1368. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1369. <xsl:attribute name="draw:dots1">2</xsl:attribute>
  1370. <xsl:attribute name="draw:dots2">1</xsl:attribute>
  1371. <xsl:attribute name="draw:dots2-length">0.203cm</xsl:attribute>
  1372. <xsl:attribute name="draw:distance">0.203cm</xsl:attribute>
  1373. </xsl:when>
  1374. <xsl:when test="$line='dash' or $line='dashed-heavy'">
  1375. <xsl:attribute name="draw:name">Ultrafine Dashed</xsl:attribute>
  1376. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1377. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1378. <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
  1379. <xsl:attribute name="draw:dots2">1</xsl:attribute>
  1380. <xsl:attribute name="draw:dots2-length">0.051cm</xsl:attribute>
  1381. <xsl:attribute name="draw:distance">0.051cm</xsl:attribute>
  1382. </xsl:when>
  1383. <xsl:when test="$line='dotted' or $line='dotted-heavy'">
  1384. <xsl:attribute name="draw:name">Ultrafine Dotted (var)</xsl:attribute>
  1385. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1386. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1387. <xsl:attribute name="draw:distance">50%</xsl:attribute>
  1388. </xsl:when>
  1389. <xsl:when test="$line='wave' or $line='wavy-heavy'">
  1390. <xsl:attribute name="draw:name">Ultrafine 2 Dots 3 Dashes</xsl:attribute>
  1391. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1392. <xsl:attribute name="draw:dots1">2</xsl:attribute>
  1393. <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
  1394. <xsl:attribute name="draw:dots2">3</xsl:attribute>
  1395. <xsl:attribute name="draw:dots2-length">0.254cm</xsl:attribute>
  1396. <xsl:attribute name="draw:distance">0.127cm</xsl:attribute>
  1397. </xsl:when>
  1398. <xsl:when test="$line='dot-dash' or $line='dash-dot-heavy'">
  1399. <xsl:attribute name="draw:name">3 Dashes 3 Dots (var)</xsl:attribute>
  1400. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1401. <xsl:attribute name="draw:dots1">3</xsl:attribute>
  1402. <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
  1403. <xsl:attribute name="draw:dots2">3</xsl:attribute>
  1404. <xsl:attribute name="draw:distance">100%</xsl:attribute>
  1405. </xsl:when>
  1406. <xsl:when test="$line='double'">
  1407. <xsl:attribute name="draw:name">Line with Fine Dots</xsl:attribute>
  1408. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1409. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1410. <xsl:attribute name="draw:dots1-length">2.007cm</xsl:attribute>
  1411. <xsl:attribute name="draw:dots2">10</xsl:attribute>
  1412. <xsl:attribute name="draw:distance">0.152cm</xsl:attribute>
  1413. </xsl:when>
  1414. <xsl:when test="$line='wavy-double'">
  1415. <xsl:attribute name="draw:name">Fine Dashed (var)</xsl:attribute>
  1416. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1417. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1418. <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
  1419. <xsl:attribute name="draw:distance">197%</xsl:attribute>
  1420. </xsl:when>
  1421. <xsl:otherwise>
  1422. <xsl:attribute name="draw:name">Fine Dashed</xsl:attribute>
  1423. <xsl:attribute name="draw:style">rect</xsl:attribute>
  1424. <xsl:attribute name="draw:dots1">1</xsl:attribute>
  1425. <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
  1426. <xsl:attribute name="draw:dots2">1</xsl:attribute>
  1427. <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
  1428. <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
  1429. </xsl:otherwise>
  1430. </xsl:choose>
  1431. </xsl:element>
  1432. </xsl:if>
  1433. </xsl:template>
  1434. <xsl:template name="process-graphics">
  1435. <xsl:param name="draw-name"/>
  1436. <xsl:if test="图:预定义图形/图:类别">
  1437. </xsl:if>
  1438. <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:垂直">
  1439. <xsl:attribute name="style:vertical-pos"><xsl:choose><xsl:when test="字:绝对">from-top</xsl:when><xsl:when test="字:相对/@字:值='bottom'">bottom</xsl:when><xsl:when test="字:相对/@字:值='center'">middle</xsl:when><xsl:when test="字:相对/@字:值='inside'">below</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
  1440. <xsl:attribute name="style:vertical-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph-content</xsl:when><xsl:otherwise><xsl:value-of select="@字:相对于"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1441. </xsl:for-each>
  1442. <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:水平">
  1443. <xsl:attribute name="style:horizontal-pos"><xsl:choose><xsl:when test="字:绝对">from-left</xsl:when><xsl:otherwise><xsl:value-of select="字:相对/@字:值"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1444. <xsl:attribute name="style:horizontal-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph</xsl:when><xsl:when test="@字:相对于='page'">page</xsl:when><xsl:when test="@字:相对于='column'">paragraph</xsl:when><xsl:when test="@字:相对于='char'">char</xsl:when></xsl:choose></xsl:attribute>
  1445. </xsl:for-each>
  1446. <xsl:variable name="wrap_type">
  1447. <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式"/>
  1448. </xsl:variable>
  1449. <xsl:variable name="aa">
  1450. <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排顶点"/>
  1451. </xsl:variable>
  1452. <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式">
  1453. <xsl:attribute name="style:wrap"><xsl:choose><xsl:when test="$wrap_type = 'through'">run-through</xsl:when><xsl:when test="$wrap_type = 'tight'">right</xsl:when><xsl:when test="$wrap_type = 'square'">parallel</xsl:when><xsl:when test="$wrap_type = 'top-bottom'">dynamic</xsl:when><xsl:when test="$wrap_type = 'infrontoftext'">run-through</xsl:when><xsl:when test="$wrap_type = 'behindtext'">run-through</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  1454. <xsl:attribute name="style:run-through"><xsl:choose><xsl:when test="$wrap_type = 'behindtext'">background</xsl:when><xsl:otherwise>foreground</xsl:otherwise></xsl:choose></xsl:attribute>
  1455. </xsl:for-each>
  1456. <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
  1457. <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
  1458. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(@字:上,$uofUnit)"/></xsl:attribute>
  1459. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(@字:下,$uofUnit)"/></xsl:attribute>
  1460. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(@字:右,$uofUnit)"/></xsl:attribute>
  1461. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(@字:左,$uofUnit)"/></xsl:attribute>
  1462. </xsl:for-each>
  1463. </xsl:if>
  1464. <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:保护/@字:值='true'">
  1465. <xsl:choose>
  1466. <xsl:when test="图:预定义图形/图:名称">
  1467. <xsl:attribute name="style:protect">position size</xsl:attribute>
  1468. </xsl:when>
  1469. <xsl:otherwise>
  1470. <xsl:attribute name="style:protect">content size position</xsl:attribute>
  1471. <xsl:attribute name="draw:size-protect">true</xsl:attribute>
  1472. <xsl:attribute name="draw:move-protect">true</xsl:attribute>
  1473. </xsl:otherwise>
  1474. </xsl:choose>
  1475. </xsl:if>
  1476. <xsl:if test="图:预定义图形/图:名称">
  1477. <xsl:choose>
  1478. <xsl:when test="图:预定义图形/图:名称='椭圆'">
  1479. </xsl:when>
  1480. </xsl:choose>
  1481. </xsl:if>
  1482. <xsl:choose>
  1483. <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
  1484. <xsl:attribute name="draw:fill">none</xsl:attribute>
  1485. </xsl:when>
  1486. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
  1487. <xsl:choose>
  1488. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称='background-image'">
  1489. <xsl:element name="style:background-image">
  1490. <xsl:element name="office:binary-data">
  1491. <xsl:variable name="biaoshi">
  1492. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
  1493. </xsl:variable>
  1494. <xsl:value-of select="ancestor::uof:对象集/uof:其他对象[@uof:标识符=$biaoshi]/uof:数据"/>
  1495. </xsl:element>
  1496. </xsl:element>
  1497. </xsl:when>
  1498. <xsl:otherwise>
  1499. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  1500. <xsl:attribute name="draw:fill-image-name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:attribute>
  1501. <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
  1502. <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
  1503. </xsl:if>
  1504. </xsl:otherwise>
  1505. </xsl:choose>
  1506. </xsl:when>
  1507. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
  1508. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  1509. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
  1510. </xsl:when>
  1511. <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
  1512. <xsl:attribute name="draw:fill">solid</xsl:attribute>
  1513. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
  1514. <xsl:attribute name="fo:background-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
  1515. </xsl:when>
  1516. <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
  1517. <xsl:attribute name="draw:fill">gradient</xsl:attribute>
  1518. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
  1519. <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
  1520. </xsl:when>
  1521. </xsl:choose>
  1522. <xsl:if test="图:预定义图形/图:属性/图:线颜色">
  1523. <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
  1524. </xsl:if>
  1525. <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
  1526. <xsl:variable name="linetype" select="图:预定义图形/图:属性/图:线型"/>
  1527. <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$linetype='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
  1528. <xsl:if test="$linetype='none'">
  1529. <xsl:attribute name="fo:border">none</xsl:attribute>
  1530. </xsl:if>
  1531. <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$linetype='dot-dot-dash' or $linetype='dash-dot-dot-heavy'">2 Dots 1 Dash</xsl:when><xsl:when test="$linetype='dash' or $linetype='dashed-heavy'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$linetype='dotted' or $linetype='dotted-heavy'">Ultrafine Dotted (var)</xsl:when><xsl:when test="$linetype='double'">Line with Fine Dots</xsl:when><xsl:when test="$linetype='dot-dash' or $linetype='dash-dot-heavy'">3 Dashes 3 Dots (var)</xsl:when><xsl:when test="$linetype='wave' or $linetype='wavy-heavy'">Ultrafine 2 Dots 3 Dashes</xsl:when><xsl:when test="$linetype='wavy-double'">Fine Dashed (var)</xsl:when><xsl:otherwise>Fine Dashed</xsl:otherwise></xsl:choose></xsl:attribute>
  1532. </xsl:if>
  1533. <xsl:if test="图:预定义图形/图:属性/图:线粗细">
  1534. <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
  1535. </xsl:if>
  1536. <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
  1537. <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  1538. <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
  1539. <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1540. </xsl:if>
  1541. </xsl:if>
  1542. <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
  1543. <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  1544. <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
  1545. <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1546. </xsl:if>
  1547. </xsl:if>
  1548. <xsl:if test="图:预定义图形/图:属性/图:宽度">
  1549. </xsl:if>
  1550. <xsl:if test="图:预定义图形/图:属性/图:高度">
  1551. </xsl:if>
  1552. <xsl:if test="图:预定义图形/图:属性/图:旋转角度">
  1553. </xsl:if>
  1554. <xsl:if test="图:预定义图形/图:属性/图:锁定纵横比">
  1555. </xsl:if>
  1556. <xsl:if test="图:预定义图形/图:属性/图:打印对象">
  1557. </xsl:if>
  1558. <xsl:if test="图:预定义图形/图:属性/图:透明度">
  1559. <xsl:attribute name="draw:opacity"><xsl:value-of select="concat((100 - 图:预定义图形/图:属性/图:透明度),'%')"/></xsl:attribute>
  1560. </xsl:if>
  1561. <xsl:if test="图:文本内容">
  1562. <xsl:if test="图:文本内容/@图:上边距">
  1563. <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
  1564. <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
  1565. <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
  1566. <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
  1567. </xsl:if>
  1568. <xsl:if test="图:文本内容/@图:文字排列方向">
  1569. <xsl:choose>
  1570. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  1571. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  1572. </xsl:when>
  1573. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  1574. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  1575. </xsl:when>
  1576. </xsl:choose>
  1577. </xsl:if>
  1578. <xsl:if test="图:文本内容/@图:水平对齐">
  1579. <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
  1580. </xsl:if>
  1581. <xsl:if test="图:文本内容/@图:垂直对齐">
  1582. <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
  1583. </xsl:if>
  1584. <xsl:if test="图:文本内容/@图:自动换行">
  1585. <xsl:attribute name="fo:wrap-option"><xsl:choose><xsl:when test="图:文本内容/@图:自动换行='1' or 图:文本内容/@图:自动换行='true'">wrap</xsl:when><xsl:otherwise>no-wrap</xsl:otherwise></xsl:choose></xsl:attribute>
  1586. </xsl:if>
  1587. <xsl:choose>
  1588. <xsl:when test="图:文本内容/@图:大小适应文字='true'">
  1589. <xsl:attribute name="draw:auto-grow-width">true</xsl:attribute>
  1590. <xsl:attribute name="draw:auto-grow-height">true</xsl:attribute>
  1591. </xsl:when>
  1592. <xsl:otherwise>
  1593. <xsl:attribute name="draw:auto-grow-width">false</xsl:attribute>
  1594. <xsl:attribute name="draw:auto-grow-height">false</xsl:attribute>
  1595. </xsl:otherwise>
  1596. </xsl:choose>
  1597. </xsl:if>
  1598. <xsl:if test="图:控制点">
  1599. </xsl:if>
  1600. </xsl:template>
  1601. <xsl:template name="图形解析">
  1602. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1603. <xsl:variable name="paiban">
  1604. <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:名称"/>
  1605. </xsl:variable>
  1606. <xsl:variable name="otherobject">
  1607. <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/@图:其他对象"/>
  1608. </xsl:variable>
  1609. <xsl:choose>
  1610. <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
  1611. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:私有类型='图片'">
  1612. <xsl:element name="draw:frame">
  1613. <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
  1614. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1615. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1616. </xsl:if>
  1617. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1618. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1619. </xsl:if>
  1620. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1621. <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
  1622. <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  1623. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  1624. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1625. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  1626. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  1627. <xsl:variable name="jiaodu">
  1628. <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
  1629. </xsl:variable>
  1630. <xsl:variable name="shibie">
  1631. <xsl:value-of select="图:预定义图形/图:生成软件"/>
  1632. </xsl:variable>
  1633. <xsl:variable name="rotate-angle">
  1634. <xsl:choose>
  1635. <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
  1636. <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
  1637. </xsl:when>
  1638. <xsl:otherwise>
  1639. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  1640. </xsl:otherwise>
  1641. </xsl:choose>
  1642. </xsl:variable>
  1643. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  1644. </xsl:if>
  1645. <xsl:if test="图:文本内容">
  1646. <xsl:apply-templates select="图:文本内容/字:段落"/>
  1647. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  1648. </xsl:if>
  1649. </xsl:for-each>
  1650. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
  1651. <draw:image>
  1652. <office:binary-data>
  1653. <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
  1654. </office:binary-data>
  1655. </draw:image>
  1656. </xsl:if>
  1657. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
  1658. <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
  1659. </xsl:if>
  1660. </xsl:element>
  1661. </xsl:if>
  1662. </xsl:when>
  1663. <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/@图:其他对象 and /uof:UOF/uof:对象集/uof:其他对象/@uof:公共类型='jpg'">
  1664. <xsl:variable name="bshi">
  1665. <xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:其他对象"/>
  1666. </xsl:variable>
  1667. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$bshi]/@uof:公共类型='jpg'">
  1668. <xsl:element name="draw:frame">
  1669. <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
  1670. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1671. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1672. </xsl:if>
  1673. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1674. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1675. </xsl:if>
  1676. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1677. <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
  1678. <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  1679. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  1680. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1681. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  1682. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  1683. <xsl:variable name="jiaodu">
  1684. <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
  1685. </xsl:variable>
  1686. <xsl:variable name="shibie">
  1687. <xsl:value-of select="图:预定义图形/图:生成软件"/>
  1688. </xsl:variable>
  1689. <xsl:variable name="rotate-angle">
  1690. <xsl:choose>
  1691. <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
  1692. <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
  1693. </xsl:when>
  1694. <xsl:otherwise>
  1695. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  1696. </xsl:otherwise>
  1697. </xsl:choose>
  1698. </xsl:variable>
  1699. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  1700. </xsl:if>
  1701. <xsl:if test="图:文本内容">
  1702. <xsl:apply-templates select="图:文本内容/字:段落"/>
  1703. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  1704. </xsl:if>
  1705. <xsl:variable name="qita">
  1706. <xsl:value-of select="self::node()/@图:其他对象"/>
  1707. </xsl:variable>
  1708. <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$qita]/uof:数据">
  1709. <draw:image>
  1710. <office:binary-data>
  1711. <xsl:value-of select="."/>
  1712. </office:binary-data>
  1713. </draw:image>
  1714. </xsl:for-each>
  1715. </xsl:for-each>
  1716. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
  1717. <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
  1718. </xsl:if>
  1719. </xsl:element>
  1720. </xsl:if>
  1721. </xsl:when>
  1722. <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true'] and not($paiban='排版框')">
  1723. <draw:frame text:anchor-type="paragraph">
  1724. <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
  1725. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1726. <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
  1727. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1728. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1729. </xsl:if>
  1730. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1731. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1732. </xsl:if>
  1733. <xsl:attribute name="draw:z-index">
  1734. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]"><xsl:value-of select="@图:层次"/></xsl:for-each>
  1735. </xsl:attribute>
  1736. <draw:text-box>
  1737. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
  1738. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
  1739. </draw:text-box>
  1740. </draw:frame>
  1741. </xsl:when>
  1742. <xsl:otherwise>
  1743. <xsl:variable name="leibie">
  1744. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
  1745. <xsl:value-of select="图:预定义图形/图:类别"/>
  1746. </xsl:for-each>
  1747. </xsl:variable>
  1748. <xsl:variable name="leibie2">
  1749. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
  1750. <xsl:value-of select="图:预定义图形/图:名称"/>
  1751. </xsl:for-each>
  1752. </xsl:variable>
  1753. <xsl:choose>
  1754. <xsl:when test="$leibie='22'">
  1755. <xsl:call-template name="排版框">
  1756. <xsl:with-param name="biaoshi" select="$tuxing1"/>
  1757. <xsl:with-param name="name" select="$leibie2"/>
  1758. </xsl:call-template>
  1759. </xsl:when>
  1760. <xsl:when test="$leibie='23'">
  1761. <xsl:call-template name="文本框">
  1762. <xsl:with-param name="biaoshi" select="$tuxing1"/>
  1763. <xsl:with-param name="name" select="$leibie2"/>
  1764. </xsl:call-template>
  1765. </xsl:when>
  1766. <xsl:when test="$leibie='11'">
  1767. <xsl:call-template name="Rectangle"/>
  1768. </xsl:when>
  1769. <xsl:when test="$leibie='19'">
  1770. <xsl:call-template name="Oval"/>
  1771. </xsl:when>
  1772. <xsl:when test="$leibie='61'">
  1773. <xsl:call-template name="Line"/>
  1774. </xsl:when>
  1775. <xsl:when test="$leibie='62'">
  1776. <xsl:call-template name="Line"/>
  1777. </xsl:when>
  1778. <xsl:when test="$leibie='63'">
  1779. <xsl:call-template name="Line"/>
  1780. </xsl:when>
  1781. <xsl:when test="$leibie='64'">
  1782. <xsl:call-template name="Curve"/>
  1783. </xsl:when>
  1784. <xsl:when test="$leibie='65'">
  1785. <xsl:call-template name="Freeform"/>
  1786. </xsl:when>
  1787. <xsl:when test="$leibie='66'">
  1788. <xsl:call-template name="Scribble"/>
  1789. </xsl:when>
  1790. </xsl:choose>
  1791. </xsl:otherwise>
  1792. </xsl:choose>
  1793. </xsl:template>
  1794. <xsl:template name="文本框">
  1795. <xsl:param name="biaoshi"/>
  1796. <xsl:param name="name"/>
  1797. <draw:frame text:anchor-type="paragraph">
  1798. <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
  1799. <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
  1800. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1801. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1802. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1803. </xsl:if>
  1804. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1805. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1806. </xsl:if>
  1807. <xsl:attribute name="draw:z-index">
  1808. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
  1809. <xsl:value-of select="@图:层次"/>
  1810. </xsl:for-each>
  1811. </xsl:attribute>
  1812. <draw:text-box>
  1813. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
  1814. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
  1815. </draw:text-box>
  1816. </draw:frame>
  1817. </xsl:template>
  1818. <xsl:template name="Curve">
  1819. <xsl:element name="draw:path">
  1820. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1821. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
  1822. <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
  1823. <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
  1824. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  1825. <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
  1826. </xsl:for-each>
  1827. <xsl:call-template name="common"/>
  1828. </xsl:element>
  1829. </xsl:template>
  1830. <xsl:template name="common">
  1831. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1832. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1833. </xsl:if>
  1834. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1835. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1836. </xsl:if>
  1837. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1838. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1839. <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
  1840. <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  1841. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  1842. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1843. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  1844. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  1845. <xsl:variable name="jiaodu">
  1846. <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
  1847. </xsl:variable>
  1848. <xsl:variable name="shibie">
  1849. <xsl:value-of select="图:预定义图形/图:生成软件"/>
  1850. </xsl:variable>
  1851. <xsl:variable name="rotate-angle">
  1852. <xsl:choose>
  1853. <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
  1854. <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
  1855. </xsl:when>
  1856. <xsl:otherwise>
  1857. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  1858. </xsl:otherwise>
  1859. </xsl:choose>
  1860. </xsl:variable>
  1861. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  1862. </xsl:if>
  1863. <xsl:if test="图:文本内容">
  1864. <xsl:apply-templates select="图:文本内容/字:段落"/>
  1865. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  1866. </xsl:if>
  1867. </xsl:for-each>
  1868. </xsl:template>
  1869. <xsl:template name="common1">
  1870. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1871. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1872. </xsl:if>
  1873. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1874. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1875. </xsl:if>
  1876. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1877. <xsl:attribute name="svg:width"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
  1878. <xsl:attribute name="svg:height"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:高度,$uofUnit)"/></xsl:attribute>
  1879. <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  1880. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  1881. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1882. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  1883. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  1884. <xsl:variable name="jiaodu">
  1885. <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
  1886. </xsl:variable>
  1887. <xsl:variable name="shibie">
  1888. <xsl:value-of select="图:预定义图形/图:生成软件"/>
  1889. </xsl:variable>
  1890. <xsl:variable name="rotate-angle">
  1891. <xsl:choose>
  1892. <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
  1893. <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
  1894. </xsl:when>
  1895. <xsl:otherwise>
  1896. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  1897. </xsl:otherwise>
  1898. </xsl:choose>
  1899. </xsl:variable>
  1900. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  1901. </xsl:if>
  1902. <xsl:if test="图:文本内容">
  1903. <xsl:apply-templates select="图:文本内容/字:段落"/>
  1904. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  1905. </xsl:if>
  1906. </xsl:for-each>
  1907. </xsl:template>
  1908. <xsl:template name="Freeform">
  1909. <xsl:element name="draw:polygon">
  1910. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1911. <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
  1912. <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
  1913. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  1914. <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
  1915. <xsl:call-template name="common"/>
  1916. </xsl:element>
  1917. </xsl:template>
  1918. <xsl:template name="drawpoints">
  1919. <xsl:param name="points"/>
  1920. <xsl:param name="point-pos"/>
  1921. <xsl:choose>
  1922. <xsl:when test="图:坐标[$point-pos]">
  1923. <xsl:variable name="points1" select="concat($points,' ',number(图:坐标[$point-pos]/@x坐标)*1000,',',number(图:坐标[$point-pos]/@y坐标)*1000)"/>
  1924. <xsl:call-template name="drawpoints">
  1925. <xsl:with-param name="points" select="$points1"/>
  1926. <xsl:with-param name="point-pos" select="$point-pos+1"/>
  1927. </xsl:call-template>
  1928. </xsl:when>
  1929. <xsl:otherwise>
  1930. <xsl:value-of select="$points"/>
  1931. </xsl:otherwise>
  1932. </xsl:choose>
  1933. </xsl:template>
  1934. <xsl:template name="Scribble">
  1935. <xsl:element name="draw:polyline">
  1936. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1937. <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
  1938. <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
  1939. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  1940. <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
  1941. <xsl:call-template name="common"/>
  1942. </xsl:element>
  1943. </xsl:template>
  1944. <xsl:template name="Oval">
  1945. <xsl:element name="draw:ellipse">
  1946. <xsl:call-template name="common1"/>
  1947. </xsl:element>
  1948. </xsl:template>
  1949. <xsl:template name="排版框">
  1950. <xsl:param name="biaoshi"/>
  1951. <xsl:param name="name"/>
  1952. <draw:frame text:anchor-type="paragraph">
  1953. <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
  1954. <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
  1955. <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
  1956. <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
  1957. <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1958. </xsl:if>
  1959. <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
  1960. <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1961. </xsl:if>
  1962. <xsl:attribute name="draw:z-index">
  1963. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
  1964. <xsl:value-of select="@图:层次"/>
  1965. </xsl:for-each>
  1966. </xsl:attribute>
  1967. <draw:text-box>
  1968. <xsl:attribute name="fo:min-height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
  1969. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
  1970. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
  1971. </draw:text-box>
  1972. </draw:frame>
  1973. </xsl:template>
  1974. <xsl:template name="Rectangle">
  1975. <xsl:element name="draw:rect">
  1976. <xsl:call-template name="common1"/>
  1977. </xsl:element>
  1978. </xsl:template>
  1979. <xsl:template name="Line">
  1980. <xsl:element name="draw:line">
  1981. <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
  1982. <xsl:attribute name="svg:x1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1983. <xsl:attribute name="svg:y1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  1984. <xsl:attribute name="svg:x2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:水平/字:绝对/@字:值 + 字:锚点属性/字:宽度),$uofUnit)"/></xsl:attribute>
  1985. <xsl:attribute name="svg:y2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:垂直/字:绝对/@字:值 + 字:锚点属性/字:高度),$uofUnit)"/></xsl:attribute>
  1986. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  1987. <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
  1988. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  1989. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  1990. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  1991. <xsl:variable name="jiaodu">
  1992. <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
  1993. </xsl:variable>
  1994. <xsl:variable name="shibie">
  1995. <xsl:value-of select="图:预定义图形/图:生成软件"/>
  1996. </xsl:variable>
  1997. <xsl:variable name="rotate-angle">
  1998. <xsl:choose>
  1999. <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
  2000. <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
  2001. </xsl:when>
  2002. <xsl:otherwise>
  2003. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  2004. </xsl:otherwise>
  2005. </xsl:choose>
  2006. </xsl:variable>
  2007. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  2008. </xsl:if>
  2009. <xsl:if test="图:文本内容">
  2010. <xsl:apply-templates select="图:文本内容/字:段落"/>
  2011. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  2012. </xsl:if>
  2013. </xsl:for-each>
  2014. </xsl:element>
  2015. </xsl:template>
  2016. <xsl:template name="processPageBreaks">
  2017. <xsl:variable name="pageBreak" select="字:句/字:分页符"/>
  2018. <xsl:call-template name="createSubParagraph">
  2019. <xsl:with-param name="list" select="$pageBreak[1]/preceding-sibling::字:句"/>
  2020. <xsl:with-param name="pageBreak"/>
  2021. <xsl:with-param name="needsPageBreak">false</xsl:with-param>
  2022. </xsl:call-template>
  2023. <xsl:for-each select="$pageBreak">
  2024. <xsl:call-template name="createSubParagraph">
  2025. <xsl:with-param name="list" select="./following-sibling::字:句[preceding::字:句/字:分页符 = '.']"/>
  2026. <xsl:with-param name="pageBreak" select="."/>
  2027. <xsl:with-param name="needsPageBreak">true</xsl:with-param>
  2028. </xsl:call-template>
  2029. </xsl:for-each>
  2030. </xsl:template>
  2031. <xsl:template name="createSubParagraph">
  2032. <xsl:param name="list"/>
  2033. <xsl:param name="pageBreak"/>
  2034. <xsl:param name="needsPageBreak"/>
  2035. <xsl:if test="(count($list) &gt; 0) or ($needsPageBreak ='true') ">
  2036. <xsl:element name="text:p">
  2037. <xsl:choose>
  2038. <xsl:when test="$needsPageBreak = 'true'">
  2039. <xsl:choose>
  2040. <xsl:when test="ancestor::字:段落/字:段落属性">
  2041. <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落属性"/></xsl:attribute>
  2042. </xsl:when>
  2043. <xsl:otherwise>
  2044. <xsl:attribute name="text:style-name">PageBreak</xsl:attribute>
  2045. </xsl:otherwise>
  2046. </xsl:choose>
  2047. </xsl:when>
  2048. </xsl:choose>
  2049. <xsl:if test="$pageBreak">
  2050. <xsl:apply-templates select="$pageBreak"/>
  2051. </xsl:if>
  2052. <xsl:apply-templates select="$list"/>
  2053. </xsl:element>
  2054. </xsl:if>
  2055. </xsl:template>
  2056. <xsl:template match="字:句/字:区域开始[@字:类型='bookmark']">
  2057. <xsl:variable name="biaoshi">
  2058. <xsl:value-of select="@字:标识符"/>
  2059. </xsl:variable>
  2060. <xsl:choose>
  2061. <xsl:when test="not(@字:名称)">
  2062. <text:bookmark-start text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
  2063. </xsl:when>
  2064. <xsl:otherwise>
  2065. <text:bookmark-start text:name="{@字:名称}"/>
  2066. </xsl:otherwise>
  2067. </xsl:choose>
  2068. </xsl:template>
  2069. <xsl:template match="字:句/字:区域结束[preceding::字:区域开始[1]/@字:类型='bookmark']">
  2070. <xsl:variable name="biaoshi">
  2071. <xsl:value-of select="@字:标识符引用"/>
  2072. </xsl:variable>
  2073. <xsl:choose>
  2074. <xsl:when test="not(@字:名称)">
  2075. <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
  2076. </xsl:when>
  2077. <xsl:otherwise>
  2078. <text:bookmark-end text:name="{@字:名称}"/>
  2079. </xsl:otherwise>
  2080. </xsl:choose>
  2081. </xsl:template>
  2082. <xsl:template match="字:区域开始[@字:类型='annotation']">
  2083. <text:bookmark-start text:name="{@字:标识符}"/>
  2084. </xsl:template>
  2085. <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='annotation']">
  2086. <text:bookmark-end text:name="{@字:标识符引用}"/>
  2087. </xsl:template>
  2088. <xsl:template match="字:区域开始[@字:类型='user-data']">
  2089. <text:alphabetical-index-mark-start text:id="{@字:标识符}" text:string-value-phonetic="{@字:名称}"/>
  2090. </xsl:template>
  2091. <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='user-data']">
  2092. <text:alphabetical-index-mark-end text:id="{@字:标识符引用}"/>
  2093. </xsl:template>
  2094. <xsl:template match="字:段落/字:域开始">
  2095. <xsl:choose>
  2096. <xsl:when test="@字:类型='createdate'">
  2097. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2098. <xsl:element name="text:creation-date">
  2099. <xsl:attribute name="style:data-style-name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
  2100. <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
  2101. <xsl:value-of select="$datestr"/>
  2102. </xsl:element>
  2103. </xsl:when>
  2104. <xsl:when test="@字:类型='savedate'">
  2105. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2106. <xsl:element name="text:date">
  2107. <xsl:attribute name="style:data-style-name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
  2108. <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
  2109. <xsl:attribute name="text:fixed">true</xsl:attribute>
  2110. <xsl:value-of select="$datestr"/>
  2111. </xsl:element>
  2112. </xsl:when>
  2113. <xsl:when test="@字:类型='date'">
  2114. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2115. <xsl:element name="text:date">
  2116. <xsl:attribute name="style:data-style-name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
  2117. <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
  2118. <xsl:value-of select="$datestr"/>
  2119. </xsl:element>
  2120. </xsl:when>
  2121. <xsl:when test="@字:类型='time'">
  2122. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2123. <xsl:element name="text:time">
  2124. <xsl:attribute name="style:data-style-name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
  2125. <xsl:attribute name="text:time-value"><xsl:value-of select="$datestr"/></xsl:attribute>
  2126. <xsl:value-of select="$datestr"/>
  2127. </xsl:element>
  2128. </xsl:when>
  2129. <xsl:when test="@字:类型='edittime'">
  2130. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2131. <xsl:element name="text:editing-duration">
  2132. <xsl:attribute name="style:data-style-name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
  2133. <xsl:value-of select="$datestr"/>
  2134. </xsl:element>
  2135. </xsl:when>
  2136. <xsl:when test="@字:类型='createtime'">
  2137. <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
  2138. <xsl:element name="text:creation-time">
  2139. <xsl:attribute name="style:data-style-name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
  2140. <xsl:value-of select="$datestr"/>
  2141. </xsl:element>
  2142. </xsl:when>
  2143. <xsl:when test="@字:类型='page'">
  2144. <xsl:call-template name="页码域"/>
  2145. </xsl:when>
  2146. <xsl:when test="@字:类型='numpages'">
  2147. <xsl:call-template name="页数域"/>
  2148. </xsl:when>
  2149. <xsl:when test="@字:类型='author'">
  2150. <xsl:call-template name="作者域"/>
  2151. </xsl:when>
  2152. <xsl:when test="@字:类型='username'">
  2153. <xsl:call-template name="用户域"/>
  2154. </xsl:when>
  2155. <xsl:when test="@字:类型='userinitials'">
  2156. <xsl:call-template name="缩写域"/>
  2157. </xsl:when>
  2158. <xsl:when test="@字:类型='title'">
  2159. <xsl:call-template name="标题域"/>
  2160. </xsl:when>
  2161. <xsl:when test="@字:类型='subject'">
  2162. <xsl:call-template name="主题域"/>
  2163. </xsl:when>
  2164. <xsl:when test="@字:类型='numchars'">
  2165. <xsl:call-template name="字符数"/>
  2166. </xsl:when>
  2167. <xsl:when test="@字:类型='filename'">
  2168. <xsl:call-template name="文件名"/>
  2169. </xsl:when>
  2170. <xsl:when test="@字:类型='edittime'">
  2171. <xsl:call-template name="编辑时间"/>
  2172. </xsl:when>
  2173. <xsl:when test="@字:类型='creation-time'">
  2174. <xsl:call-template name="创建时间"/>
  2175. </xsl:when>
  2176. <xsl:when test="@字:类型='seq'">
  2177. <xsl:call-template name="题注"/>
  2178. </xsl:when>
  2179. </xsl:choose>
  2180. </xsl:template>
  2181. <xsl:template name="commonParagraph">
  2182. <xsl:choose>
  2183. <xsl:when test="字:段落属性/字:大纲级别">
  2184. <xsl:element name="text:h">
  2185. <xsl:call-template name="commonParagraphAttributes"/>
  2186. <xsl:apply-templates/>
  2187. </xsl:element>
  2188. </xsl:when>
  2189. <xsl:when test="not (字:域开始/@字:类型='ref') and not(字:域开始/@字:类型='index')">
  2190. <xsl:element name="text:p">
  2191. <xsl:call-template name="commonParagraphAttributes"/>
  2192. <xsl:apply-templates/>
  2193. </xsl:element>
  2194. </xsl:when>
  2195. <xsl:otherwise/>
  2196. </xsl:choose>
  2197. </xsl:template>
  2198. <xsl:template name="commonParagraphAttributes">
  2199. <xsl:choose>
  2200. <xsl:when test="字:段落属性">
  2201. <xsl:variable name="pp">
  2202. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
  2203. </xsl:variable>
  2204. <xsl:variable name="aa">
  2205. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:域结束]"/>
  2206. </xsl:variable>
  2207. <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
  2208. <xsl:choose>
  2209. <xsl:when test="preceding-sibling::字:段落/字:域结束">
  2210. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp+$aa)"/></xsl:attribute>
  2211. </xsl:when>
  2212. <xsl:when test="contains($stylename,'Heading')">
  2213. <xsl:attribute name="text:style-name"><xsl:value-of select="$stylename"/></xsl:attribute>
  2214. </xsl:when>
  2215. <xsl:otherwise>
  2216. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp)"/></xsl:attribute>
  2217. </xsl:otherwise>
  2218. </xsl:choose>
  2219. <xsl:if test="字:段落属性/字:大纲级别">
  2220. <xsl:attribute name="text:outline-level"><xsl:value-of select="字:段落属性/字:大纲级别"/></xsl:attribute>
  2221. </xsl:if>
  2222. </xsl:when>
  2223. <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
  2224. <xsl:variable name="paragraph-number">
  2225. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
  2226. </xsl:variable>
  2227. <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
  2228. </xsl:when>
  2229. <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
  2230. <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
  2231. </xsl:when>
  2232. <xsl:when test="字:句">
  2233. <xsl:apply-templates select="字:文本串"/>
  2234. </xsl:when>
  2235. </xsl:choose>
  2236. </xsl:template>
  2237. <xsl:template match="字:段落属性"/>
  2238. <xsl:template match="字:句/字:句属性"/>
  2239. <xsl:template match="字:句属性" mode="style">
  2240. <xsl:if test="not(@字:式样引用)">
  2241. <xsl:element name="style:style">
  2242. <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
  2243. <xsl:attribute name="style:family">text</xsl:attribute>
  2244. <xsl:if test="@字:式样引用">
  2245. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
  2246. </xsl:if>
  2247. <xsl:element name="style:text-properties">
  2248. <xsl:apply-templates select="./*"/>
  2249. </xsl:element>
  2250. </xsl:element>
  2251. </xsl:if>
  2252. </xsl:template>
  2253. <xsl:template match="字:句/字:文本串">
  2254. <xsl:choose>
  2255. <xsl:when test="string(.) = ' ' ">
  2256. <xsl:element name="text:s"/>
  2257. </xsl:when>
  2258. <xsl:when test="contains(.,' ')">
  2259. <xsl:call-template name="replace-spaces">
  2260. <xsl:with-param name="curr-string" select="."/>
  2261. </xsl:call-template>
  2262. </xsl:when>
  2263. <xsl:otherwise>
  2264. <xsl:value-of select="."/>
  2265. </xsl:otherwise>
  2266. </xsl:choose>
  2267. </xsl:template>
  2268. <xsl:template name="replace-spaces">
  2269. <xsl:param name="curr-string"/>
  2270. <xsl:if test="contains($curr-string,' ')">
  2271. <xsl:value-of select="substring-before($curr-string,' ')"/>
  2272. <text:s text:c="2"/>
  2273. <xsl:variable name="next-string" select="substring-after($curr-string,' ')"/>
  2274. <xsl:choose>
  2275. <xsl:when test="contains($next-string, ' ')">
  2276. <xsl:call-template name="replace-spaces">
  2277. <xsl:with-param name="curr-string" select="$next-string"/>
  2278. </xsl:call-template>
  2279. </xsl:when>
  2280. <xsl:otherwise>
  2281. <xsl:value-of select="$next-string"/>
  2282. </xsl:otherwise>
  2283. </xsl:choose>
  2284. </xsl:if>
  2285. </xsl:template>
  2286. <xsl:template match="字:空格符[parent::字:句]">
  2287. <xsl:element name="text:s">
  2288. <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
  2289. </xsl:element>
  2290. </xsl:template>
  2291. <xsl:template match="字:制表符[parent::字:句]">
  2292. <xsl:element name="text:tab"/>
  2293. </xsl:template>
  2294. <xsl:template match="字:句">
  2295. <xsl:if test="name(following-sibling::*[1])!='字:域结束'">
  2296. <xsl:if test="字:换行符">
  2297. <xsl:element name="text:line-break"/>
  2298. </xsl:if>
  2299. <xsl:variable name="currently-node" select="./字:锚点"/>
  2300. <xsl:choose>
  2301. <xsl:when test="字:句属性//字:隐藏文字/@字:值='true'">
  2302. <text:hidden-text text:is-hidden="true" text:string-value="{.}"/>
  2303. </xsl:when>
  2304. <xsl:when test="字:区域开始[@字:类型='hyperlink']">
  2305. <xsl:element name="text:a">
  2306. <xsl:attribute name="xlink:type">simple</xsl:attribute>
  2307. <xsl:variable name="hyperDest" select="字:区域开始/@字:标识符"/>
  2308. <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:if test="@uof:提示"><xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute></xsl:if><xsl:if test="@uof:目标"><xsl:variable name="bsh" select="@uof:目标"/><xsl:choose><xsl:when test="contains($bsh,'\')"><xsl:value-of select="concat('/',translate($bsh,'\','/'))"/></xsl:when><xsl:otherwise><xsl:value-of select="$bsh"/></xsl:otherwise></xsl:choose></xsl:if><xsl:if test="@uof:书签"><xsl:variable name="bookmarkDest" select="@uof:书签"/><xsl:choose><xsl:when test="/uof:UOF/uof:书签集/uof:书签"><xsl:for-each select="/uof:UOF/uof:书签集/uof:书签"><xsl:if test="@uof:名称=$bookmarkDest"><xsl:value-of select="concat('#',@uof:名称)"/></xsl:if></xsl:for-each></xsl:when><xsl:otherwise><xsl:value-of select="concat('#',$bookmarkDest)"/></xsl:otherwise></xsl:choose></xsl:if></xsl:if></xsl:for-each></xsl:attribute>
  2309. <xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接">
  2310. <xsl:if test="@uof:链源=$hyperDest">
  2311. <xsl:if test="@uof:提示">
  2312. <xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute>
  2313. </xsl:if>
  2314. </xsl:if>
  2315. </xsl:for-each>
  2316. <xsl:choose>
  2317. <xsl:when test="./字:文本串">
  2318. <xsl:apply-templates select="字:文本串"/>
  2319. </xsl:when>
  2320. <xsl:when test="following-sibling::字:句/字:文本串">
  2321. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  2322. </xsl:when>
  2323. </xsl:choose>
  2324. </xsl:element>
  2325. </xsl:when>
  2326. <xsl:when test="字:区域结束 and preceding::字:区域开始[1]/@字:类型='bookmark' and not(self::node()/字:区域开始)">
  2327. <xsl:variable name="aa">
  2328. <xsl:value-of select="字:区域结束/@字:标识符引用"/>
  2329. </xsl:variable>
  2330. <xsl:choose>
  2331. <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark' and not(preceding::字:区域开始[1]/@字:名称)">
  2332. <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$aa]/@uof:名称}"/>
  2333. </xsl:when>
  2334. <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark'">
  2335. <text:bookmark-end text:name="{preceding::字:区域开始[1]/@字:名称}"/>
  2336. </xsl:when>
  2337. </xsl:choose>
  2338. </xsl:when>
  2339. <xsl:when test="preceding-sibling::字:句[position()=1]/字:区域开始[@字:类型='hyperlink'] and not(preceding-sibling::字:句[position()=1]/字:区域结束)"/>
  2340. <xsl:when test="(preceding-sibling::字:句) or (字:句属性)or(字:区域开始)">
  2341. <xsl:element name="text:span">
  2342. <xsl:choose>
  2343. <xsl:when test="字:区域开始[@字:类型='annotation']">
  2344. <xsl:variable name="ref_comment">
  2345. <xsl:value-of select="字:区域开始/@字:标识符"/>
  2346. </xsl:variable>
  2347. <xsl:apply-templates/>
  2348. <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:公用处理规则/字:批注集/字:批注[@字:区域引用 = $ref_comment]"/>
  2349. </xsl:when>
  2350. <xsl:otherwise>
  2351. <xsl:variable name="stylenum">
  2352. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
  2353. </xsl:variable>
  2354. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
  2355. <xsl:apply-templates select="*[not(name()='字:引文符号')]"/>
  2356. </xsl:otherwise>
  2357. </xsl:choose>
  2358. </xsl:element>
  2359. </xsl:when>
  2360. <xsl:otherwise>
  2361. <xsl:apply-templates select="字:文本串|字:锚点|字:空格符|字:换行符|字:制表符|字:区域开始|字:区域结束|字:脚注|字:尾注"/>
  2362. </xsl:otherwise>
  2363. </xsl:choose>
  2364. </xsl:if>
  2365. </xsl:template>
  2366. <xsl:template match="node()[name() = '字:位置']">
  2367. <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2368. </xsl:template>
  2369. <xsl:template match="字:批注">
  2370. <office:annotation office:display="true">
  2371. <xsl:variable name="name" select="@字:作者"/>
  2372. <dc:creator>
  2373. <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$name]/@字:姓名"/>
  2374. </dc:creator>
  2375. <dc:date>
  2376. <xsl:value-of select="@字:日期"/>
  2377. </dc:date>
  2378. <xsl:apply-templates select="字:段落"/>
  2379. </office:annotation>
  2380. </xsl:template>
  2381. <xsl:template match="字:字体">
  2382. <xsl:if test="@字:字号">
  2383. <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  2384. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  2385. <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  2386. </xsl:if>
  2387. <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
  2388. <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
  2389. <xsl:variable name="zihao">
  2390. <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
  2391. <xsl:value-of select="字:字体/@字:字号"/>
  2392. </xsl:for-each>
  2393. </xsl:variable>
  2394. <xsl:variable name="font-size" select="@字:相对字号"/>
  2395. <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  2396. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  2397. <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  2398. </xsl:if>
  2399. <xsl:if test="@字:颜色">
  2400. <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
  2401. </xsl:if>
  2402. <xsl:if test="@字:中文字体引用">
  2403. <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
  2404. </xsl:if>
  2405. <xsl:if test="@字:西文字体引用">
  2406. <xsl:variable name="xiwen" select="@字:西文字体引用"/>
  2407. <xsl:attribute name="style:font-name"><xsl:value-of select="translate($xiwen,'_',' ')"/></xsl:attribute>
  2408. </xsl:if>
  2409. </xsl:template>
  2410. <xsl:template match="字:斜体">
  2411. <xsl:if test="@字:值='true'">
  2412. <xsl:attribute name="fo:font-style">italic</xsl:attribute>
  2413. <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
  2414. <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
  2415. <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
  2416. </xsl:if>
  2417. </xsl:template>
  2418. <xsl:template match="字:粗体">
  2419. <xsl:if test="@字:值='true'or @字:值='1'">
  2420. <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
  2421. <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
  2422. <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
  2423. </xsl:if>
  2424. </xsl:template>
  2425. <xsl:template match="字:下划线">
  2426. <xsl:choose>
  2427. <xsl:when test="@字:类型 = 'single'">
  2428. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  2429. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2430. </xsl:when>
  2431. <xsl:when test="@字:类型 = 'double'">
  2432. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  2433. <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
  2434. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2435. </xsl:when>
  2436. <xsl:when test="@字:类型 = 'thick'">
  2437. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  2438. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2439. </xsl:when>
  2440. <xsl:when test="@字:类型 = 'dotted'">
  2441. <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
  2442. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2443. </xsl:when>
  2444. <xsl:when test="@字:类型 = 'dotted-heavy'">
  2445. <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
  2446. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2447. </xsl:when>
  2448. <xsl:when test="@字:类型 = 'dash'">
  2449. <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
  2450. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2451. </xsl:when>
  2452. <xsl:when test="@字:类型 = 'dashed-heavy'">
  2453. <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
  2454. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2455. </xsl:when>
  2456. <xsl:when test="@字:类型 = 'dash-long'">
  2457. <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
  2458. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2459. </xsl:when>
  2460. <xsl:when test="@字:类型 = 'dash-long-heavy'">
  2461. <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
  2462. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2463. </xsl:when>
  2464. <xsl:when test="@字:类型 = 'dot-dash'">
  2465. <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
  2466. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2467. </xsl:when>
  2468. <xsl:when test="@字:类型 = 'dash-dot-heavy'">
  2469. <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
  2470. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2471. </xsl:when>
  2472. <xsl:when test="@字:类型 = 'dot-dot-dash'">
  2473. <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
  2474. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2475. </xsl:when>
  2476. <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
  2477. <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
  2478. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2479. </xsl:when>
  2480. <xsl:when test="@字:类型 = 'wave'">
  2481. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  2482. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2483. </xsl:when>
  2484. <xsl:when test="@字:类型 = 'wavy-heavy'">
  2485. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  2486. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  2487. </xsl:when>
  2488. <xsl:when test="@字:类型 = 'wavy-double'">
  2489. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  2490. <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
  2491. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  2492. </xsl:when>
  2493. <xsl:otherwise/>
  2494. </xsl:choose>
  2495. <xsl:choose>
  2496. <xsl:when test="@字:颜色">
  2497. <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2498. </xsl:when>
  2499. <xsl:otherwise>
  2500. <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
  2501. </xsl:otherwise>
  2502. </xsl:choose>
  2503. </xsl:template>
  2504. <xsl:template match="字:着重号">
  2505. <xsl:if test="not(@字:类型='none')">
  2506. <xsl:choose>
  2507. <xsl:when test="@字:类型='dot'">
  2508. <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
  2509. </xsl:when>
  2510. <xsl:when test="@字:类型='accent above' ">
  2511. <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
  2512. </xsl:when>
  2513. <xsl:when test="@字:类型='dot above' ">
  2514. <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
  2515. </xsl:when>
  2516. <xsl:when test="@字:类型='disc above' ">
  2517. <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
  2518. </xsl:when>
  2519. <xsl:when test="@字:类型='circle above' ">
  2520. <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
  2521. </xsl:when>
  2522. <xsl:when test="@字:类型='accent below' ">
  2523. <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
  2524. </xsl:when>
  2525. <xsl:when test="@字:类型='dot below' ">
  2526. <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
  2527. </xsl:when>
  2528. <xsl:when test="@字:类型='disc below' ">
  2529. <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
  2530. </xsl:when>
  2531. <xsl:when test="@字:类型='circle below' ">
  2532. <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
  2533. </xsl:when>
  2534. <xsl:otherwise>none</xsl:otherwise>
  2535. </xsl:choose>
  2536. </xsl:if>
  2537. <xsl:if test="字:颜色">
  2538. <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
  2539. </xsl:if>
  2540. </xsl:template>
  2541. <xsl:template match="字:隐藏文字">
  2542. <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
  2543. </xsl:template>
  2544. <xsl:template match="字:空心">
  2545. <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
  2546. </xsl:template>
  2547. <xsl:template match="字:阴影">
  2548. <xsl:if test="not(@字:值='false')">
  2549. <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
  2550. </xsl:if>
  2551. </xsl:template>
  2552. <xsl:template match="字:闪动的">
  2553. <xsl:attribute name="style:text-blinking"><xsl:value-of select="@字:闪动的"/></xsl:attribute>
  2554. </xsl:template>
  2555. <xsl:template match="字:删除线">
  2556. <xsl:choose>
  2557. <xsl:when test="@字:类型 = 'single' ">
  2558. <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
  2559. </xsl:when>
  2560. <xsl:when test="@字:类型 = 'double' ">
  2561. <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
  2562. </xsl:when>
  2563. <xsl:when test="@字:类型 = 'bold' ">
  2564. <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
  2565. </xsl:when>
  2566. <xsl:when test="@字:类型 = 'xl' ">
  2567. <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
  2568. </xsl:when>
  2569. <xsl:when test="@字:类型 = '/l' ">
  2570. <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
  2571. </xsl:when>
  2572. <xsl:otherwise>
  2573. <xsl:attribute name="style:text-crossing-out">none</xsl:attribute>
  2574. </xsl:otherwise>
  2575. </xsl:choose>
  2576. </xsl:template>
  2577. <xsl:template match="字:突出显示">
  2578. <xsl:attribute name="fo:background-color">
  2579. <xsl:choose>
  2580. <xsl:when test="@字:颜色='auto'">transparent</xsl:when>
  2581. <xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise>
  2582. </xsl:choose>
  2583. </xsl:attribute>
  2584. </xsl:template>
  2585. <xsl:template match="@字:颜色[not(.='auto')]">
  2586. <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
  2587. </xsl:template>
  2588. <xsl:template match="字:浮雕">
  2589. <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  2590. </xsl:template>
  2591. <xsl:template match="字:醒目字体">
  2592. <xsl:choose>
  2593. <xsl:when test="@字:类型='small-caps'">
  2594. <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
  2595. </xsl:when>
  2596. <xsl:when test="@字:类型='none'">
  2597. <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
  2598. <xsl:attribute name="fo:text-transform">none</xsl:attribute>
  2599. </xsl:when>
  2600. <xsl:otherwise>
  2601. <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
  2602. </xsl:otherwise>
  2603. </xsl:choose>
  2604. </xsl:template>
  2605. <xsl:template match="字:位置" mode="oo">
  2606. <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2607. </xsl:template>
  2608. <xsl:template match="字:缩放">
  2609. <xsl:attribute name="style:text-scale"><xsl:value-of select="."/>%</xsl:attribute>
  2610. </xsl:template>
  2611. <xsl:template match="字:字符间距">
  2612. <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/>cm</xsl:attribute>
  2613. </xsl:template>
  2614. <xsl:template match="字:调整字间距">
  2615. <xsl:variable name="tt" select="字:调整字间距"/>
  2616. <xsl:attribute name="style:letter-kerning"><xsl:choose><xsl:when test="$tt='1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2617. </xsl:template>
  2618. <xsl:template match="字:外框">
  2619. <xsl:attribute name="style:text-outline">true</xsl:attribute>
  2620. </xsl:template>
  2621. <xsl:template match="字:字符间距[parent::字:句属性]">
  2622. <xsl:variable name="aa">
  2623. <xsl:value-of select="."/>
  2624. </xsl:variable>
  2625. <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( $aa, $uofUnit)"/></xsl:attribute>
  2626. </xsl:template>
  2627. <xsl:template match="字:分节">
  2628. <xsl:if test="字:节属性/字:脚注设置">
  2629. <xsl:call-template name="脚注设置"/>
  2630. </xsl:if>
  2631. <xsl:if test="字:节属性/字:尾注设置">
  2632. <xsl:call-template name="尾注设置"/>
  2633. </xsl:if>
  2634. <xsl:if test="字:节属性/字:行号设置">
  2635. <xsl:call-template name="行编号"/>
  2636. </xsl:if>
  2637. </xsl:template>
  2638. <xsl:template name="行编号">
  2639. <xsl:element name="text:linenumbering-configuration">
  2640. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:行号设置">
  2641. <xsl:choose>
  2642. <xsl:when test="@字:使用行号='false'">
  2643. <xsl:attribute name="text:number-lines">false</xsl:attribute>
  2644. </xsl:when>
  2645. <xsl:otherwise>
  2646. <xsl:attribute name="text:style-name">Line numbering</xsl:attribute>
  2647. </xsl:otherwise>
  2648. </xsl:choose>
  2649. <xsl:if test="@字:编号方式">
  2650. <xsl:choose>
  2651. <xsl:when test="@字:编号方式='section'">
  2652. <xsl:attribute name="text:count-in-floating-frames">true</xsl:attribute>
  2653. </xsl:when>
  2654. <xsl:when test="@字:编号方式='page'">
  2655. <xsl:attribute name="text:restart-on-page">true</xsl:attribute>
  2656. </xsl:when>
  2657. <xsl:when test="字:编号方式='continuous'">
  2658. <xsl:attribute name="text:count-empty-lines">true</xsl:attribute>
  2659. </xsl:when>
  2660. </xsl:choose>
  2661. </xsl:if>
  2662. <xsl:if test="@字:起始编号">
  2663. <xsl:attribute name="style:num-format"><xsl:value-of select="@字:起始编号"/></xsl:attribute>
  2664. </xsl:if>
  2665. <xsl:if test="@字:距边界">
  2666. <xsl:attribute name="text:offset"><xsl:value-of select="concat(@字:距边界,$uofUnit)"/></xsl:attribute>
  2667. </xsl:if>
  2668. <xsl:if test="@字:行号间隔">
  2669. <xsl:attribute name="text:increment"><xsl:value-of select="@字:行号间隔"/></xsl:attribute>
  2670. </xsl:if>
  2671. </xsl:for-each>
  2672. </xsl:element>
  2673. </xsl:template>
  2674. <xsl:template name="脚注设置">
  2675. <xsl:element name="text:notes-configuration">
  2676. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:脚注设置">
  2677. <xsl:attribute name="text:note-class">footnote</xsl:attribute>
  2678. <xsl:attribute name="text:master-page-name">Footnote</xsl:attribute>
  2679. <xsl:attribute name="text:footnotes-position"><xsl:choose><xsl:when test="@字:位置='page-bottom'">page</xsl:when><xsl:when test="@字:位置='below-text'">document</xsl:when></xsl:choose></xsl:attribute>
  2680. <xsl:attribute name="text:start-numbering-at"><xsl:choose><xsl:when test="@字:编号方式='continuous'">document</xsl:when><xsl:when test="@字:编号方式='section'">chapter</xsl:when><xsl:when test="@字:编号方式='page'">page</xsl:when></xsl:choose></xsl:attribute>
  2681. <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
  2682. <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
  2683. </xsl:for-each>
  2684. </xsl:element>
  2685. </xsl:template>
  2686. <xsl:template name="尾注设置">
  2687. <xsl:element name="text:notes-configuration">
  2688. <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:尾注设置">
  2689. <xsl:attribute name="text:note-class">endnote</xsl:attribute>
  2690. <xsl:attribute name="text:master-page-name">Endnote</xsl:attribute>
  2691. <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
  2692. <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
  2693. </xsl:for-each>
  2694. </xsl:element>
  2695. </xsl:template>
  2696. <xsl:template name="paragraph-properties">
  2697. <xsl:choose>
  2698. <xsl:when test="descendant::字:页边距[@uof:左]">
  2699. <xsl:attribute name="fo:margin-left"><xsl:value-of select="number((descendant::字:页边距/@uof:左)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
  2700. </xsl:when>
  2701. <xsl:otherwise>
  2702. <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
  2703. </xsl:otherwise>
  2704. </xsl:choose>
  2705. <xsl:choose>
  2706. <xsl:when test="descendant::字:页边距[@uof:右]">
  2707. <xsl:attribute name="fo:margin-right"><xsl:value-of select="number((descendant::字:页边距/@uof:右)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
  2708. </xsl:when>
  2709. <xsl:otherwise>
  2710. <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
  2711. </xsl:otherwise>
  2712. </xsl:choose>
  2713. <xsl:attribute name="fo:text-indent">0cm</xsl:attribute>
  2714. <xsl:call-template name="bidi"/>
  2715. </xsl:template>
  2716. <xsl:template name="bidi">
  2717. </xsl:template>
  2718. <xsl:template match="字:文字表">
  2719. <xsl:choose>
  2720. <xsl:when test="@字:类型 = 'sub-table'">
  2721. <xsl:element name="table:table">
  2722. <xsl:attribute name="table:is-sub-table">true</xsl:attribute>
  2723. <xsl:apply-templates select="字:文字表属性">
  2724. <xsl:with-param name="sub-table" select="@字:类型"/>
  2725. </xsl:apply-templates>
  2726. <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
  2727. <xsl:element name="table:table-header-rows">
  2728. <xsl:for-each select="字:行">
  2729. <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
  2730. <xsl:apply-templates select="."/>
  2731. </xsl:if>
  2732. </xsl:for-each>
  2733. </xsl:element>
  2734. </xsl:if>
  2735. <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
  2736. <xsl:apply-templates select="."/>
  2737. </xsl:for-each>
  2738. </xsl:element>
  2739. </xsl:when>
  2740. <xsl:otherwise>
  2741. <xsl:element name="table:table">
  2742. <xsl:if test="字:文字表属性">
  2743. <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
  2744. </xsl:if>
  2745. <xsl:if test="not(字:文字表属性/字:列宽集/字:列宽)">
  2746. <xsl:for-each select="字:行[1]/字:单元格">
  2747. <xsl:element name="table:table-column">
  2748. <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
  2749. </xsl:element>
  2750. </xsl:for-each>
  2751. </xsl:if>
  2752. <xsl:apply-templates select="字:文字表属性"/>
  2753. <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
  2754. <xsl:element name="table:table-header-rows">
  2755. <xsl:for-each select="字:行">
  2756. <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
  2757. <xsl:apply-templates select="."/>
  2758. </xsl:if>
  2759. </xsl:for-each>
  2760. </xsl:element>
  2761. </xsl:if>
  2762. <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
  2763. <xsl:apply-templates select="."/>
  2764. </xsl:for-each>
  2765. </xsl:element>
  2766. </xsl:otherwise>
  2767. </xsl:choose>
  2768. </xsl:template>
  2769. <xsl:template match="字:文字表属性">
  2770. <xsl:param name="sub-table"/>
  2771. <xsl:apply-templates select="字:列宽集">
  2772. <xsl:with-param name="sub-table" select="$sub-table"/>
  2773. </xsl:apply-templates>
  2774. </xsl:template>
  2775. <xsl:template match="字:列宽集">
  2776. <xsl:param name="sub-table"/>
  2777. <xsl:apply-templates select="字:列宽">
  2778. <xsl:with-param name="sub-table" select="$sub-table"/>
  2779. </xsl:apply-templates>
  2780. </xsl:template>
  2781. <xsl:template match="字:列宽">
  2782. <xsl:param name="sub-table"/>
  2783. <xsl:element name="table:table-column">
  2784. <xsl:choose>
  2785. <xsl:when test="$sub-table='sub-table'">
  2786. <xsl:variable name="subtable-leikuan" select="."/>
  2787. <xsl:variable name="weizi">
  2788. <xsl:for-each select="ancestor::*[name()='字:文字表' and not(@字:类型='sub-table')]/字:文字表属性/字:列宽集/字:列宽">
  2789. <xsl:variable name="yyyyy" select="."/>
  2790. <xsl:if test="substring(string($yyyyy),1,string-length(string($yyyyy))-1)=substring(string($subtable-leikuan),1,string-length(string($subtable-leikuan))-1)">
  2791. <xsl:value-of select="concat(position(),';')"/>
  2792. </xsl:if>
  2793. </xsl:for-each>
  2794. </xsl:variable>
  2795. <xsl:variable name="xxxxx">
  2796. <xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>
  2797. </xsl:variable>
  2798. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('Table',$xxxxx,'.C',substring-before($weizi,';'))"/></xsl:attribute>
  2799. </xsl:when>
  2800. <xsl:otherwise>
  2801. <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
  2802. </xsl:otherwise>
  2803. </xsl:choose>
  2804. </xsl:element>
  2805. </xsl:template>
  2806. <xsl:template match="字:行">
  2807. <xsl:element name="table:table-row">
  2808. <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
  2809. <xsl:for-each select="node()">
  2810. <xsl:choose>
  2811. <xsl:when test="name()='字:单元格'">
  2812. <xsl:call-template name="字:单元格"/>
  2813. </xsl:when>
  2814. <xsl:when test="name()='字:单元格覆盖'">
  2815. </xsl:when>
  2816. <xsl:otherwise/>
  2817. </xsl:choose>
  2818. </xsl:for-each>
  2819. </xsl:element>
  2820. </xsl:template>
  2821. <xsl:template name="字:单元格">
  2822. <xsl:element name="table:table-cell">
  2823. <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
  2824. <xsl:if test="字:单元格属性">
  2825. <xsl:apply-templates select="字:单元格属性"/>
  2826. </xsl:if>
  2827. <xsl:for-each select="node( )">
  2828. <xsl:choose>
  2829. <xsl:when test="name( )='字:段落'">
  2830. <xsl:apply-templates select="."/>
  2831. </xsl:when>
  2832. <xsl:when test="name( )='字:文字表'">
  2833. <xsl:apply-templates select="."/>
  2834. </xsl:when>
  2835. <xsl:otherwise>
  2836. </xsl:otherwise>
  2837. </xsl:choose>
  2838. </xsl:for-each>
  2839. </xsl:element>
  2840. </xsl:template>
  2841. <xsl:template match="字:单元格属性/字:边框">
  2842. <xsl:apply-templates/>
  2843. </xsl:template>
  2844. <xsl:template match="字:对齐[parent::字:文字表属性]">
  2845. </xsl:template>
  2846. <xsl:template match="uof:上">
  2847. <xsl:choose>
  2848. <xsl:when test="@uof:宽度='nil' ">
  2849. <xsl:attribute name="fo:border-top">none</xsl:attribute>
  2850. </xsl:when>
  2851. <xsl:when test="@uof:宽度 and @uof:颜色">
  2852. <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2853. </xsl:when>
  2854. <xsl:when test="@uof:宽度">
  2855. <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
  2856. </xsl:when>
  2857. </xsl:choose>
  2858. </xsl:template>
  2859. <xsl:template match="uof:下">
  2860. <xsl:choose>
  2861. <xsl:when test="@uof:宽度='nil' ">
  2862. <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
  2863. </xsl:when>
  2864. <xsl:when test="@uof:宽度 and @uof:颜色">
  2865. <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2866. </xsl:when>
  2867. <xsl:when test="@uof:宽度">
  2868. <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
  2869. </xsl:when>
  2870. </xsl:choose>
  2871. </xsl:template>
  2872. <xsl:template match="uof:左">
  2873. <xsl:choose>
  2874. <xsl:when test="@uof:宽度='nil'">
  2875. <xsl:attribute name="fo:border-left">none</xsl:attribute>
  2876. </xsl:when>
  2877. <xsl:when test="@uof:宽度 and @uof:颜色">
  2878. <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2879. </xsl:when>
  2880. <xsl:when test="@uof:宽度">
  2881. <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
  2882. </xsl:when>
  2883. </xsl:choose>
  2884. </xsl:template>
  2885. <xsl:template match="uof:右">
  2886. <xsl:choose>
  2887. <xsl:when test="@uof:宽度='nil' ">
  2888. <xsl:attribute name="fo:border-right">none</xsl:attribute>
  2889. </xsl:when>
  2890. <xsl:when test="@uof:宽度 and @uof:颜色">
  2891. <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2892. </xsl:when>
  2893. <xsl:when test="@uof:宽度">
  2894. <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
  2895. </xsl:when>
  2896. </xsl:choose>
  2897. </xsl:template>
  2898. <xsl:template match="字:文字表属性/字:边框">
  2899. <xsl:apply-templates/>
  2900. </xsl:template>
  2901. <xsl:template match="字:单元格属性/字:边框">
  2902. <xsl:call-template name="uof:边框"/>
  2903. </xsl:template>
  2904. <xsl:template match="字:左缩进">
  2905. </xsl:template>
  2906. <xsl:template match="字:单元格属性">
  2907. <xsl:if test="字:跨列/@字:值">
  2908. <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="字:跨列/@字:值"/></xsl:attribute>
  2909. </xsl:if>
  2910. </xsl:template>
  2911. <xsl:template name="编号风格">
  2912. <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
  2913. <xsl:element name="style:style">
  2914. <xsl:attribute name="style:name"><xsl:value-of select="concat('P',@字:标识符)"/></xsl:attribute>
  2915. <xsl:attribute name="style:family">paragraph</xsl:attribute>
  2916. <xsl:attribute name="style:parent-style-name">Standard</xsl:attribute>
  2917. <xsl:attribute name="style:list-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  2918. <xsl:element name="style:text-properties">
  2919. <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
  2920. <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
  2921. <xsl:attribute name="fo:color"><xsl:value-of select="字:级别/字:符号字体/字:字体/字:颜色"/></xsl:attribute>
  2922. <xsl:attribute name="fo:text-indent"/>
  2923. <xsl:attribute name="style:auto-text-indent">false</xsl:attribute>
  2924. </xsl:element>
  2925. </xsl:element>
  2926. </xsl:for-each>
  2927. </xsl:template>
  2928. <xsl:template name="编号格式">
  2929. <xsl:attribute name="style:num-format"><xsl:choose><xsl:when test="string(字:编号格式)='lower-letter'">a</xsl:when><xsl:when test="string(字:编号格式)='upper-letter'">A</xsl:when><xsl:when test="string(字:编号格式)='lower-roman'">i</xsl:when><xsl:when test="string(字:编号格式)='upper-roman'">I</xsl:when><xsl:when test="string(字:编号格式)='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-counting'">一, 二, 三, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
  2930. </xsl:template>
  2931. <xsl:template name="图形style">
  2932. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形">
  2933. <xsl:element name="style:style">
  2934. <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  2935. <xsl:attribute name="style:family">graphic</xsl:attribute>
  2936. <xsl:attribute name="style:parent-style-name">Graphics</xsl:attribute>
  2937. <xsl:element name="style:text-properties">
  2938. <xsl:attribute name="svg:stroke-width"><xsl:value-of select="图:预定义图形/图:属性/图:线粗细"/></xsl:attribute>
  2939. <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
  2940. <xsl:attribute name="draw:stroke-dash"><xsl:value-of select="图:预定义图形/图:属性/图:线型"/></xsl:attribute>
  2941. <xsl:attribute name="draw:marker-start"><xsl:value-of select="图:预定义图形/图:属性/图:前端箭头/图:式样"/></xsl:attribute>
  2942. <xsl:attribute name="draw:marker-end"><xsl:value-of select="图:预定义图形/图:属性/图:后端箭头/图:式样"/></xsl:attribute>
  2943. </xsl:element>
  2944. </xsl:element>
  2945. </xsl:for-each>
  2946. </xsl:template>
  2947. <xsl:template name="duanluoshuxing">
  2948. <xsl:for-each select="/uof:UOF/uof:文字处理//字:段落">
  2949. <xsl:choose>
  2950. <xsl:when test="count(字:句)&lt;=1">
  2951. <xsl:call-template name="单个或者没有句"/>
  2952. </xsl:when>
  2953. <xsl:otherwise>
  2954. <xsl:call-template name="多个句"/>
  2955. </xsl:otherwise>
  2956. </xsl:choose>
  2957. </xsl:for-each>
  2958. </xsl:template>
  2959. <xsl:template name="单个或者没有句">
  2960. <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
  2961. <xsl:element name="style:style">
  2962. <xsl:attribute name="style:name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落"/></xsl:attribute>
  2963. <xsl:attribute name="style:family">paragraph</xsl:attribute>
  2964. <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
  2965. <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::字:分节[1]/@字:名称"/></xsl:attribute>
  2966. </xsl:if>
  2967. <xsl:if test="字:段落属性/@字:式样引用">
  2968. <xsl:variable name="duanluoyinyong">
  2969. <xsl:value-of select="字:段落属性/@字:式样引用"/>
  2970. </xsl:variable>
  2971. <xsl:for-each select="/uof:UOF//uof:段落式样">
  2972. <xsl:if test="$duanluoyinyong=@字:标识符">
  2973. <xsl:if test="@字:基式样引用">
  2974. <xsl:choose>
  2975. <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:段落属性/字:格式修订/@字:修订信息引用">
  2976. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  2977. </xsl:when>
  2978. <xsl:otherwise>
  2979. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
  2980. <xsl:variable name="aa">
  2981. <xsl:value-of select="@字:基式样引用"/>
  2982. </xsl:variable>
  2983. <xsl:for-each select="/uof:UOF//uof:段落式样">
  2984. <xsl:if test="$aa=@字:标识符">
  2985. <xsl:attribute name="style:display-name"><xsl:choose><xsl:when test="@字:别名"><xsl:value-of select="@字:别名"/></xsl:when><xsl:otherwise><xsl:value-of select="@字:名称"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2986. <xsl:element name="style:paragraph-properties">
  2987. <xsl:if test="字:对齐">
  2988. <xsl:if test="字:对齐/@字:文字对齐">
  2989. <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
  2990. </xsl:if>
  2991. <xsl:if test="字:对齐/@字:水平对齐">
  2992. <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
  2993. <xsl:if test="字:对齐/@字:水平对齐='distributed'">
  2994. <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
  2995. </xsl:if>
  2996. <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
  2997. </xsl:if>
  2998. </xsl:if>
  2999. <xsl:call-template name="ParagraphAttr"/>
  3000. <xsl:if test="字:段落属性/字:制表位设置">
  3001. <xsl:call-template name="ootab"/>
  3002. </xsl:if>
  3003. </xsl:element>
  3004. <xsl:if test="字:句属性">
  3005. <xsl:variable name="bsh">
  3006. <xsl:value-of select="字:句属性/@字:式样引用"/>
  3007. </xsl:variable>
  3008. <xsl:element name="style:text-properties">
  3009. <xsl:for-each select="/uof:UOF//uof:句式样">
  3010. <xsl:if test="$bsh=@字:标识符">
  3011. <xsl:apply-templates select="./*"/>
  3012. </xsl:if>
  3013. </xsl:for-each>
  3014. </xsl:element>
  3015. </xsl:if>
  3016. </xsl:if>
  3017. </xsl:for-each>
  3018. </xsl:otherwise>
  3019. </xsl:choose>
  3020. </xsl:if>
  3021. <xsl:if test="字:边框">
  3022. <xsl:call-template name="uof:边框"/>
  3023. </xsl:if>
  3024. </xsl:if>
  3025. </xsl:for-each>
  3026. </xsl:if>
  3027. <xsl:element name="style:text-properties">
  3028. <xsl:if test="字:句/字:句属性/字:字体">
  3029. <xsl:variable name="ziti">
  3030. <xsl:value-of select="字:句/字:句属性/字:字体/@字:中文字体引用"/>
  3031. </xsl:variable>
  3032. <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
  3033. <xsl:if test="@uof:标识符=$ziti">
  3034. <xsl:attribute name="style:font-name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
  3035. <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@uof:名称"/></xsl:attribute>
  3036. </xsl:if>
  3037. </xsl:for-each>
  3038. <xsl:if test="字:句/字:句属性/字:字体/@字:字号">
  3039. <xsl:attribute name="fo:font-size"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
  3040. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
  3041. </xsl:if>
  3042. </xsl:if>
  3043. <xsl:if test="字:段落属性/字:句属性">
  3044. <xsl:for-each select="字:段落属性/字:句属性">
  3045. <xsl:apply-templates select="./*"/>
  3046. </xsl:for-each>
  3047. </xsl:if>
  3048. <xsl:apply-templates select="字:句/字:句属性/字:浮雕 | 字:句/字:句属性/字:边框 | 字:句/字:句属性/字:缩放 | 字:句/字:句属性/字:阴影 | 字:句/字:句属性/字:删除线 | 字:句/字:句属性/字:下划线 | 字:句/字:填充"/>
  3049. <xsl:call-template name="ParagraphAttr"/>
  3050. <xsl:if test="字:段落属性/字:制表位设置">
  3051. <xsl:call-template name="ootab"/>
  3052. </xsl:if>
  3053. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样[@字:标识符=$stylename]">
  3054. <xsl:apply-templates select="./*"/>
  3055. </xsl:for-each>
  3056. </xsl:element>
  3057. <style:paragraph-properties>
  3058. <xsl:if test="字:句/字:分栏符">
  3059. <xsl:attribute name="fo:break-before">column</xsl:attribute>
  3060. </xsl:if>
  3061. <xsl:if test="字:句/字:分页符">
  3062. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  3063. </xsl:if>
  3064. <xsl:call-template name="ParagraphAttr"/>
  3065. <xsl:if test="字:段落属性/字:制表位设置">
  3066. <xsl:call-template name="ootab"/>
  3067. </xsl:if>
  3068. </style:paragraph-properties>
  3069. </xsl:element>
  3070. </xsl:template>
  3071. <xsl:template name="ParagraphAttr">
  3072. <xsl:apply-templates select="字:段落属性/字:填充"/>
  3073. <xsl:if test="字:段落属性/字:对齐">
  3074. <xsl:if test="字:段落属性/字:对齐/@字:文字对齐">
  3075. <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3076. </xsl:if>
  3077. <xsl:if test="字:段落属性/字:对齐/@字:水平对齐">
  3078. <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
  3079. <xsl:if test="字:段落属性/字:对齐/@字:水平对齐='distributed'">
  3080. <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
  3081. </xsl:if>
  3082. <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
  3083. </xsl:if>
  3084. </xsl:if>
  3085. <xsl:choose>
  3086. <xsl:when test="字:段落属性/字:缩进">
  3087. <xsl:variable name="a1">
  3088. <xsl:value-of select="字:段落属性/字:缩进/字:左/字:相对/@字:值"/>
  3089. </xsl:variable>
  3090. <xsl:variable name="a2">
  3091. <xsl:value-of select="字:段落属性/字:缩进/字:右/字:相对/@字:值"/>
  3092. </xsl:variable>
  3093. <xsl:choose>
  3094. <xsl:when test="字:段落属性/字:缩进/字:左/字:相对 or 字:段落属性/字:缩进/字:右/字:相对">
  3095. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat($a1 * 0.37,'cm')"/></xsl:attribute>
  3096. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat($a2 * 0.37,'cm')"/></xsl:attribute>
  3097. </xsl:when>
  3098. <xsl:otherwise>
  3099. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:段落属性/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3100. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:段落属性/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3101. </xsl:otherwise>
  3102. </xsl:choose>
  3103. <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:段落属性/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3104. </xsl:when>
  3105. <xsl:when test="ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进">
  3106. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3107. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3108. <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3109. </xsl:when>
  3110. </xsl:choose>
  3111. <xsl:if test="字:段落属性/字:行距">
  3112. <xsl:variable name="type">
  3113. <xsl:value-of select="字:段落属性/字:行距/@字:类型"/>
  3114. </xsl:variable>
  3115. <xsl:variable name="val">
  3116. <xsl:value-of select="字:段落属性/字:行距/@字:值"/>
  3117. </xsl:variable>
  3118. <xsl:choose>
  3119. <xsl:when test="$type='fixed'">
  3120. <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3121. </xsl:when>
  3122. <xsl:when test="$type='multi-lines'">
  3123. <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
  3124. </xsl:when>
  3125. <xsl:when test="$type='at-least'">
  3126. <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3127. </xsl:when>
  3128. <xsl:when test="$type='line-space'">
  3129. <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3130. </xsl:when>
  3131. </xsl:choose>
  3132. </xsl:if>
  3133. <xsl:if test="字:段落属性/字:段间距">
  3134. <xsl:if test="字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值">
  3135. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
  3136. </xsl:if>
  3137. <xsl:if test="字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值">
  3138. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
  3139. </xsl:if>
  3140. <xsl:variable name="aa">
  3141. <xsl:value-of select="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值"/>
  3142. </xsl:variable>
  3143. <xsl:variable name="bb">
  3144. <xsl:value-of select="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值"/>
  3145. </xsl:variable>
  3146. <xsl:if test="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值">
  3147. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat($aa * 15.6,$uofUnit)"/></xsl:attribute>
  3148. </xsl:if>
  3149. <xsl:if test="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值">
  3150. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat($bb * 15.6,$uofUnit)"/></xsl:attribute>
  3151. </xsl:if>
  3152. </xsl:if>
  3153. <xsl:if test="字:段落属性/字:孤行控制">
  3154. <xsl:attribute name="fo:widows"><xsl:value-of select="字:段落属性/字:孤行控制"/></xsl:attribute>
  3155. </xsl:if>
  3156. <xsl:if test="字:段落属性/字:寡行控制">
  3157. <xsl:attribute name="fo:orphans"><xsl:value-of select="字:段落属性/字:寡行控制"/></xsl:attribute>
  3158. </xsl:if>
  3159. <xsl:if test="字:段落属性/字:段中不分页">
  3160. <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段落属性/字:段中不分页/@字:值='1' or 字:段落属性/字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
  3161. </xsl:if>
  3162. <xsl:if test="字:段落属性/字:与下段同页">
  3163. <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:段落属性/字:与下段同页/@字:值='1' or 字:段落属性/字:与下段同页/@字:值='true'">always</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3164. </xsl:if>
  3165. <xsl:for-each select="字:段落属性/字:边框">
  3166. <xsl:call-template name="uof:边框"/>
  3167. </xsl:for-each>
  3168. <xsl:for-each select="字:段落属性/字:填充">
  3169. <xsl:call-template name="uof:填充"/>
  3170. </xsl:for-each>
  3171. <xsl:if test="字:段落属性/字:对齐网格">
  3172. <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:段落属性/字:对齐网格/@字:值='1' or 字:段落属性/字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3173. </xsl:if>
  3174. <xsl:if test="字:段落属性/字:取消断字">
  3175. <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
  3176. <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
  3177. <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
  3178. <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:段落属性/字:取消断字/@字:值='1' or 字:段落属性/字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3179. </xsl:if>
  3180. <xsl:if test="字:段落属性/字:取消行号">
  3181. <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:段落属性/字:取消行号/@字:值='1' or 字:段落属性/字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3182. </xsl:if>
  3183. <xsl:if test="字:段落属性/字:行首尾标点控制">
  3184. <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:段落属性/字:行首尾标点控制/@字:值='1' or 字:段落属性/字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
  3185. </xsl:if>
  3186. <xsl:if test="字:段落属性/字:是否行首标点压缩/@字:值='true'">
  3187. <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
  3188. </xsl:if>
  3189. <xsl:if test="字:段落属性/字:中文习惯首尾字符">
  3190. <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:段落属性/字:中文习惯首尾字符/@字:值='1' or 字:段落属性/字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
  3191. </xsl:if>
  3192. <xsl:if test="字:段落属性/字:自动调整中英文字符间距 or 字:段落属性/字:自动调整中文与数字间距">
  3193. <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:段落属性/字:自动调整中英文字符间距/@字:值='1' or 字:段落属性/字:自动调整中文与数字间距/@字:值='1'or 字:段落属性/字:自动调整中英文字符间距/@字:值='true' or 字:段落属性/字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3194. </xsl:if>
  3195. <xsl:if test="字:段落属性/字:首字下沉">
  3196. <xsl:element name="style:drop-cap">
  3197. <xsl:if test="字:段落属性/字:首字下沉/@字:行数">
  3198. <xsl:attribute name="style:lines"><xsl:value-of select="字:段落属性/字:首字下沉/@字:行数"/></xsl:attribute>
  3199. </xsl:if>
  3200. <xsl:if test="字:段落属性/字:首字下沉/@字:间距">
  3201. <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:段落属性/字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
  3202. </xsl:if>
  3203. <xsl:if test="字:段落属性/字:首字下沉/@字:字体引用">
  3204. <xsl:attribute name="style:style-name"><xsl:value-of select="translate(字:段落属性/字:首字下沉/@字:字体引用,'_',' ')"/></xsl:attribute>
  3205. </xsl:if>
  3206. <xsl:if test="字:段落属性/字:首字下沉/@字:字符数">
  3207. <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:段落属性/字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3208. </xsl:if>
  3209. </xsl:element>
  3210. </xsl:if>
  3211. </xsl:template>
  3212. <xsl:template name="XDParagraphAttr">
  3213. <xsl:apply-templates select="字:填充"/>
  3214. <xsl:if test="字:对齐">
  3215. <xsl:if test="字:对齐/@字:文字对齐">
  3216. <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3217. </xsl:if>
  3218. <xsl:if test="字:对齐/@字:水平对齐">
  3219. <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
  3220. <xsl:if test="字:对齐/@字:水平对齐='distributed'">
  3221. <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
  3222. </xsl:if>
  3223. <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
  3224. </xsl:if>
  3225. </xsl:if>
  3226. <xsl:if test="字:缩进">
  3227. <xsl:if test="字:缩进/字:左/字:绝对/@字:值">
  3228. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3229. </xsl:if>
  3230. <xsl:if test="字:缩进/字:右/字:绝对/@字:值">
  3231. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3232. </xsl:if>
  3233. <xsl:if test="字:缩进/字:首行/字:绝对/@字:值">
  3234. <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  3235. </xsl:if>
  3236. </xsl:if>
  3237. <xsl:if test="字:行距">
  3238. <xsl:variable name="type">
  3239. <xsl:value-of select="字:行距/@字:类型"/>
  3240. </xsl:variable>
  3241. <xsl:variable name="val">
  3242. <xsl:value-of select="字:行距/@字:值"/>
  3243. </xsl:variable>
  3244. <xsl:choose>
  3245. <xsl:when test="$type='fixed'">
  3246. <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3247. </xsl:when>
  3248. <xsl:when test="$type='multi-lines'">
  3249. <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
  3250. </xsl:when>
  3251. <xsl:when test="$type='at-least'">
  3252. <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3253. </xsl:when>
  3254. <xsl:when test="$type='line-space'">
  3255. <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
  3256. </xsl:when>
  3257. </xsl:choose>
  3258. </xsl:if>
  3259. <xsl:if test="字:段间距">
  3260. <xsl:if test="字:段间距/字:段前距/字:绝对值/@字:值">
  3261. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
  3262. </xsl:if>
  3263. <xsl:if test="字:段间距/字:段后距/字:绝对值/@字:值">
  3264. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
  3265. </xsl:if>
  3266. </xsl:if>
  3267. <xsl:if test="字:孤行控制">
  3268. <xsl:attribute name="fo:orphans"><xsl:value-of select="字:孤行控制"/></xsl:attribute>
  3269. </xsl:if>
  3270. <xsl:if test="字:寡行控制">
  3271. <xsl:attribute name="fo:widows"><xsl:value-of select="字:寡行控制"/></xsl:attribute>
  3272. </xsl:if>
  3273. <xsl:if test="字:段中不分页">
  3274. <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段中不分页/@字:值='1' or 字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
  3275. </xsl:if>
  3276. <xsl:if test="字:与下段同页">
  3277. <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:与下段同页/@字:值='1' or 字:与下段同页/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3278. </xsl:if>
  3279. <xsl:for-each select="字:边框">
  3280. <xsl:call-template name="uof:边框"/>
  3281. </xsl:for-each>
  3282. <xsl:for-each select="字:填充">
  3283. <xsl:call-template name="uof:填充"/>
  3284. </xsl:for-each>
  3285. <xsl:if test="字:对齐网格">
  3286. <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:对齐网格/@字:值='1' or 字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3287. </xsl:if>
  3288. <xsl:if test="字:取消断字">
  3289. <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
  3290. <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
  3291. <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
  3292. <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:取消断字/@字:值='1' or 字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3293. </xsl:if>
  3294. <xsl:if test="字:取消行号">
  3295. <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:取消行号/@字:值='1' or 字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3296. </xsl:if>
  3297. <xsl:if test="字:行首尾标点控制">
  3298. <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:行首尾标点控制/@字:值='1' or 字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
  3299. </xsl:if>
  3300. <xsl:if test="字:是否行首标点压缩/@字:值='true'">
  3301. <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
  3302. </xsl:if>
  3303. <xsl:if test="字:中文习惯首尾字符">
  3304. <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:中文习惯首尾字符/@字:值='1' or 字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
  3305. </xsl:if>
  3306. <xsl:if test="字:自动调整中英文字符间距 or 字:自动调整中文与数字间距">
  3307. <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:自动调整中英文字符间距/@字:值='1' or 字:自动调整中文与数字间距/@字:值='1'or 字:自动调整中英文字符间距/@字:值='true' or 字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3308. </xsl:if>
  3309. <xsl:if test="字:首字下沉">
  3310. <xsl:element name="style:drop-cap">
  3311. <xsl:if test="字:首字下沉/@字:行数">
  3312. <xsl:attribute name="style:lines"><xsl:value-of select="字:首字下沉/@字:行数"/></xsl:attribute>
  3313. </xsl:if>
  3314. <xsl:if test="字:首字下沉/@字:间距">
  3315. <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
  3316. </xsl:if>
  3317. <xsl:if test="字:首字下沉/@字:字体引用">
  3318. <xsl:attribute name="style:style-name"><xsl:value-of select="字:首字下沉/@字:字体引用"/></xsl:attribute>
  3319. </xsl:if>
  3320. <xsl:if test="字:首字下沉/@字:字符数">
  3321. <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3322. </xsl:if>
  3323. </xsl:element>
  3324. </xsl:if>
  3325. </xsl:template>
  3326. <xsl:template name="多个句">
  3327. <xsl:call-template name="单个或者没有句"/>
  3328. </xsl:template>
  3329. <xsl:template name="jibianhao">
  3330. <xsl:param name="biaoshifu"/>
  3331. <xsl:element name="text:list-level-style-number">
  3332. <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
  3333. <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
  3334. <xsl:attribute name="text:style-name">Numbering Symbols</xsl:attribute>
  3335. <xsl:if test="@字:尾随字符">
  3336. <xsl:attribute name="style:num-suffix"><xsl:choose><xsl:when test="@字:尾随字符='space'"><xsl:value-of select="' ' "/></xsl:when><xsl:when test="@字:尾随字符='tab'"><xsl:value-of select="' '"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3337. </xsl:if>
  3338. <xsl:if test="字:符号字体">
  3339. <xsl:variable name="Font-ID">
  3340. <xsl:value-of select="字:符号字体/@字:式样引用"/>
  3341. </xsl:variable>
  3342. <xsl:attribute name="text:style-name"><xsl:value-of select="$Font-ID"/></xsl:attribute>
  3343. </xsl:if>
  3344. <xsl:if test="字:起始编号">
  3345. <xsl:attribute name="text:start-value"><xsl:value-of select="字:起始编号"/></xsl:attribute>
  3346. </xsl:if>
  3347. <xsl:if test="字:正规格式">
  3348. <xsl:attribute name="text:num-regular-exp"><xsl:value-of select="字:正规格式/@值"/></xsl:attribute>
  3349. </xsl:if>
  3350. <xsl:attribute name="text:display-levels"><xsl:value-of select="string-length(字:编号格式表示) - string-length(translate(字:编号格式表示,'%','') )"/></xsl:attribute>
  3351. <xsl:if test="字:编号格式">
  3352. <xsl:call-template name="编号格式"/>
  3353. </xsl:if>
  3354. <xsl:if test="字:编号格式表示">
  3355. <xsl:variable name="last" select="substring-after(字:编号格式表示,concat('%',$currlevel))"/>
  3356. <xsl:variable name="first">
  3357. <xsl:variable name="aa" select="substring-before(字:编号格式表示,concat('%',$currlevel))"/>
  3358. <xsl:choose>
  3359. <xsl:when test="not(substring-after($aa,'%'))">
  3360. <xsl:value-of select="$aa"/>
  3361. </xsl:when>
  3362. </xsl:choose>
  3363. </xsl:variable>
  3364. <xsl:if test="$first!=''">
  3365. <xsl:attribute name="style:num-prefix"><xsl:value-of select="$first"/></xsl:attribute>
  3366. </xsl:if>
  3367. <xsl:if test="$last!=''">
  3368. <xsl:attribute name="style:num-suffix"><xsl:value-of select="$last"/></xsl:attribute>
  3369. </xsl:if>
  3370. <xsl:call-template name="bianhaogeshi">
  3371. <xsl:with-param name="biaoshi">
  3372. <xsl:value-of select="字:编号格式表示"/>
  3373. </xsl:with-param>
  3374. <xsl:with-param name="jibie">
  3375. <xsl:value-of select="1"/>
  3376. </xsl:with-param>
  3377. </xsl:call-template>
  3378. </xsl:if>
  3379. <xsl:element name="style:text-properties">
  3380. <xsl:call-template name="suojinleixing"/>
  3381. <xsl:if test="@字:编号对齐方式">
  3382. <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
  3383. </xsl:if>
  3384. <xsl:if test="字:符号字体">
  3385. <xsl:if test="字:符号字体/@字:式样引用">
  3386. <xsl:variable name="Font-ID">
  3387. <xsl:value-of select="字:符号字体/@字:式样引用"/>
  3388. </xsl:variable>
  3389. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
  3390. <xsl:if test="@字:标识符=$Font-ID">
  3391. <xsl:if test="字:字体/@字:中文字体引用">
  3392. <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
  3393. </xsl:if>
  3394. </xsl:if>
  3395. </xsl:for-each>
  3396. </xsl:if>
  3397. </xsl:if>
  3398. </xsl:element>
  3399. </xsl:element>
  3400. </xsl:template>
  3401. <xsl:template name="bianhaogeshi">
  3402. <xsl:param name="biaoshi"/>
  3403. <xsl:param name="jibie"/>
  3404. <xsl:variable name="bb">
  3405. <xsl:value-of select="substring-after($biaoshi,'%')"/>
  3406. </xsl:variable>
  3407. <xsl:choose>
  3408. <xsl:when test="substring-after($bb,'%')">
  3409. <xsl:call-template name="bianhaogeshi">
  3410. <xsl:with-param name="biaoshi" select="$bb"/>
  3411. <xsl:with-param name="jibie" select="$jibie +1"/>
  3412. </xsl:call-template>
  3413. </xsl:when>
  3414. <xsl:otherwise>
  3415. <xsl:if test="not($jibie=1)">
  3416. <xsl:attribute name="text:display-levels"><xsl:value-of select="$jibie"/></xsl:attribute>
  3417. </xsl:if>
  3418. </xsl:otherwise>
  3419. </xsl:choose>
  3420. </xsl:template>
  3421. <xsl:template name="xiangmufuhao">
  3422. <xsl:param name="biaoshifu"/>
  3423. <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
  3424. <xsl:element name="text:list-level-style-bullet">
  3425. <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
  3426. <xsl:attribute name="text:style-name"><xsl:value-of select="../@字:名称"/></xsl:attribute>
  3427. <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
  3428. <xsl:attribute name="text:bullet-char"><xsl:value-of select="字:项目符号"/></xsl:attribute>
  3429. <xsl:element name="style:text-properties">
  3430. <xsl:if test="字:符号字体">
  3431. <xsl:variable name="Font-ID">
  3432. <xsl:value-of select="字:符号字体/@字:式样引用"/>
  3433. </xsl:variable>
  3434. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
  3435. <xsl:if test="@字:标识符=$Font-ID">
  3436. <xsl:if test="字:字体/@字:中文字体引用">
  3437. <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
  3438. </xsl:if>
  3439. </xsl:if>
  3440. </xsl:for-each>
  3441. </xsl:if>
  3442. <xsl:if test="字:项目符号">
  3443. <xsl:attribute name="fo:font-family"><xsl:value-of select="'WingDings'"/></xsl:attribute>
  3444. </xsl:if>
  3445. <xsl:call-template name="suojinleixing"/>
  3446. <xsl:if test="@字:编号对齐方式">
  3447. <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
  3448. </xsl:if>
  3449. </xsl:element>
  3450. </xsl:element>
  3451. </xsl:template>
  3452. <xsl:template name="imagefuhao">
  3453. <xsl:param name="biaoshifu"/>
  3454. <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
  3455. <xsl:element name="text:list-level-style-image" style:vertical-pos="middle" style:vertical-rel="line" fo:width="0.265cm" fo:height="0.265cm">
  3456. <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
  3457. <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
  3458. <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
  3459. <xsl:if test="字:图片符号引用">
  3460. <xsl:variable name="gid">
  3461. <xsl:value-of select="字:图片符号引用"/>
  3462. </xsl:variable>
  3463. <xsl:element name="office:binary-data">
  3464. <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
  3465. </xsl:element>
  3466. </xsl:if>
  3467. <xsl:element name="style:list-level-properties">
  3468. <xsl:attribute name="style:vertical-pos">middle</xsl:attribute>
  3469. <xsl:attribute name="style:vertical-rel">line</xsl:attribute>
  3470. <xsl:attribute name="fo:width"><xsl:value-of select="concat(字:图片符号引用/@字:宽度,$uofUnit)"/></xsl:attribute>
  3471. <xsl:attribute name="fo:height"><xsl:value-of select="concat(字:图片符号引用/@字:高度,$uofUnit)"/></xsl:attribute>
  3472. <xsl:if test="字:符号字体">
  3473. <xsl:variable name="Font-ID">
  3474. <xsl:value-of select="字:符号字体/@字:式样引用"/>
  3475. </xsl:variable>
  3476. <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
  3477. <xsl:if test="@字:标识符=$Font-ID">
  3478. <xsl:if test="字:字体/@字:中文字体引用">
  3479. <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
  3480. </xsl:if>
  3481. </xsl:if>
  3482. </xsl:for-each>
  3483. </xsl:if>
  3484. <xsl:call-template name="suojinleixing"/>
  3485. <xsl:if test="@字:编号对齐方式">
  3486. <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
  3487. </xsl:if>
  3488. </xsl:element>
  3489. </xsl:element>
  3490. </xsl:template>
  3491. <xsl:template name="ootab">
  3492. <xsl:element name="style:tab-stops">
  3493. <xsl:for-each select="字:段落属性/字:制表位设置/字:制表位 | 字:制表位设置/字:制表位">
  3494. <xsl:element name="style:tab-stop">
  3495. <xsl:attribute name="style:position"><xsl:value-of select="concat(@字:位置,$uofUnit)"/></xsl:attribute>
  3496. <xsl:attribute name="style:type"><xsl:choose><xsl:when test="@字:类型='decimal'">char</xsl:when><xsl:when test="@字:类型='left' or @字:类型='right' or @字:类型='center'"><xsl:value-of select="@字:类型"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
  3497. <xsl:if test="@字:制表位字符">
  3498. <xsl:attribute name="style:leader-text"><xsl:value-of select="@字:制表位字符"/></xsl:attribute>
  3499. </xsl:if>
  3500. <xsl:attribute name="style:leader-style"><xsl:value-of select="@字:前导符"/></xsl:attribute>
  3501. </xsl:element>
  3502. </xsl:for-each>
  3503. </xsl:element>
  3504. </xsl:template>
  3505. <xsl:template match="字:段落[字:段落属性[字:自动编号信息]]">
  3506. <xsl:call-template name="编号解析">
  3507. </xsl:call-template>
  3508. </xsl:template>
  3509. <xsl:template name="编号解析">
  3510. <xsl:variable name="bianhao">
  3511. <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号引用"/>
  3512. </xsl:variable>
  3513. <xsl:variable name="bianhaojibie">
  3514. <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号级别"/>
  3515. </xsl:variable>
  3516. <xsl:variable name="isxiangmuorisimage">
  3517. <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
  3518. <xsl:choose>
  3519. <xsl:when test="$bianhao=@字:标识符">
  3520. <xsl:choose>
  3521. <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:项目符号">true</xsl:when>
  3522. <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:图片符号引用">true</xsl:when>
  3523. <xsl:otherwise>false</xsl:otherwise>
  3524. </xsl:choose>
  3525. </xsl:when>
  3526. <xsl:otherwise>false</xsl:otherwise>
  3527. </xsl:choose>
  3528. </xsl:for-each>
  3529. </xsl:variable>
  3530. <xsl:choose>
  3531. <xsl:when test="$isxiangmuorisimage='true'">
  3532. <xsl:call-template name="无序"/>
  3533. </xsl:when>
  3534. <xsl:otherwise>
  3535. <xsl:call-template name="有序"/>
  3536. </xsl:otherwise>
  3537. </xsl:choose>
  3538. </xsl:template>
  3539. <xsl:template name="有序">
  3540. <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
  3541. <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
  3542. <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
  3543. <xsl:element name="text:list">
  3544. <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
  3545. <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  3546. <xsl:if test="字:段落属性/字:自动编号信息/@字:重新编号">
  3547. <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='1'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  3548. </xsl:if>
  3549. <xsl:element name="text:list-item">
  3550. <xsl:call-template name="ordered-levels">
  3551. <xsl:with-param name="level" select="$currlistlvl - 1"/>
  3552. </xsl:call-template>
  3553. </xsl:element>
  3554. </xsl:element>
  3555. </xsl:template>
  3556. <xsl:template name="ordered-levels">
  3557. <xsl:param name="level"/>
  3558. <xsl:choose>
  3559. <xsl:when test="$level = '0'">
  3560. <xsl:call-template name="commonParagraph"/>
  3561. </xsl:when>
  3562. <xsl:otherwise>
  3563. <xsl:element name="text:list">
  3564. <xsl:element name="text:list-item">
  3565. <xsl:call-template name="ordered-levels">
  3566. <xsl:with-param name="level" select="$level - 1"/>
  3567. </xsl:call-template>
  3568. </xsl:element>
  3569. </xsl:element>
  3570. </xsl:otherwise>
  3571. </xsl:choose>
  3572. </xsl:template>
  3573. <xsl:template name="无序">
  3574. <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
  3575. <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
  3576. <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
  3577. <xsl:element name="text:list">
  3578. <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
  3579. <xsl:element name="text:list-item">
  3580. <xsl:call-template name="unordered-levels">
  3581. <xsl:with-param name="level" select="$currlistlvl - 1"/>
  3582. </xsl:call-template>
  3583. </xsl:element>
  3584. </xsl:element>
  3585. </xsl:template>
  3586. <xsl:template name="unordered-levels">
  3587. <xsl:param name="level"/>
  3588. <xsl:choose>
  3589. <xsl:when test="$level = '0'">
  3590. <xsl:call-template name="commonParagraph"/>
  3591. </xsl:when>
  3592. <xsl:otherwise>
  3593. <xsl:element name="text:list">
  3594. <xsl:element name="text:list-item">
  3595. <xsl:call-template name="unordered-levels">
  3596. <xsl:with-param name="level" select="$level - 1"/>
  3597. </xsl:call-template>
  3598. </xsl:element>
  3599. </xsl:element>
  3600. </xsl:otherwise>
  3601. </xsl:choose>
  3602. </xsl:template>
  3603. <!-- measure_conversion.xsl Begin-->
  3604. <xsl:param name="dpi" select="111"/>
  3605. <xsl:param name="centimeter-in-mm" select="10"/>
  3606. <xsl:param name="inch-in-mm" select="25.4"/>
  3607. <xsl:param name="didot-point-in-mm" select="0.376065"/>
  3608. <xsl:param name="pica-in-mm" select="4.2333333"/>
  3609. <xsl:param name="point-in-mm" select="0.3527778"/>
  3610. <xsl:param name="twip-in-mm" select="0.017636684"/>
  3611. <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
  3612. <!-- ***** MEASUREMENT CONVERSIONS *****
  3613. PARAM 'value'
  3614. The measure to be converted.
  3615. The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
  3616. directly added to the number.
  3617. PARAM 'rounding-factor'
  3618. Is used for the rounding of decimal places.
  3619. The parameter number is the product of 1 and some '10', where
  3620. every zero represents a decimal place.
  3621. For example, providing as parameter:
  3622. <xsl:param name="rounding-factor" select="10000" />
  3623. Gives by default four decimal places.
  3624. To round two decimal places, basically the following is done:
  3625. <xsl:value-of select="round(100 * value) div 100"/>
  3626. RETURN The converted number, by default rounded to four decimal places.
  3627. In case the input measure could not be matched the same value is
  3628. returned and a warning message is written out.
  3629. MEASURE LIST:
  3630. * 1 millimeter (mm), the basic measure
  3631. * 1 centimeter (cm) = 10 mm
  3632. * 1 inch (in) = 25.4 mm
  3633. While the English have already seen the light (read: the metric system), the US
  3634. remains loyal to this medieval system.
  3635. * 1 point (pt) = 0.35277777.. mm
  3636. Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
  3637. There are exactly 72 PostScript points in 1 inch.
  3638. * 1 twip = twentieth of a (PostScript) point
  3639. A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
  3640. * 1 didot point (dpt) = 0.376065 mm
  3641. Didot point after the French typographer Firmin Didot (1764-1836).
  3642. More details under
  3643. http://www.unc.edu/~rowlett/units/dictP.html:
  3644. "A unit of length used by typographers and printers. When printing was done
  3645. from hand-set metal type, one point represented the smallest element of type
  3646. that could be handled, roughly 1/64 inch. Eventually, the point was standardized
  3647. in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
  3648. about 0.35 mm (351.46 micrometers). In continental Europe, typographers
  3649. traditionally used a slightly larger point of 0.014 83 inch (about
  3650. 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
  3651. after the French typographer Firmin Didot (1764-1836). In the U.S.,
  3652. Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
  3653. or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
  3654. of 0.351 459 8035 mm. The German standards agency DIN has proposed that
  3655. all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
  3656. * 1 pica = 4.233333 mm
  3657. 1/6 inch or 12 points
  3658. * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
  3659. Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
  3660. -->
  3661. <!-- changing measure to mm -->
  3662. <xsl:template name="convert2cm">
  3663. <xsl:param name="value"/>
  3664. <xsl:param name="rounding-factor" select="10000"/>
  3665. <xsl:choose>
  3666. <xsl:when test="contains($value, 'mm')">
  3667. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
  3668. </xsl:when>
  3669. <xsl:when test="contains($value, $uofUnit)">
  3670. <xsl:value-of select="substring-before($value, $uofUnit)"/>
  3671. </xsl:when>
  3672. <xsl:when test="contains($value, 'in')">
  3673. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
  3674. </xsl:when>
  3675. <xsl:when test="contains($value, 'pt')">
  3676. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
  3677. </xsl:when>
  3678. <xsl:when test="contains($value, 'dpt')">
  3679. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  3680. </xsl:when>
  3681. <xsl:when test="contains($value, 'pica')">
  3682. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
  3683. </xsl:when>
  3684. <xsl:when test="contains($value, 'twip')">
  3685. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
  3686. </xsl:when>
  3687. <xsl:when test="contains($value, 'px')">
  3688. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  3689. </xsl:when>
  3690. <xsl:otherwise>
  3691. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
  3692. <xsl:value-of select="$value"/>
  3693. </xsl:otherwise>
  3694. </xsl:choose>
  3695. </xsl:template>
  3696. <xsl:template name="uof:通用边框">
  3697. <xsl:param name="lineType"/>
  3698. <xsl:param name="width"/>
  3699. <xsl:param name="color"/>
  3700. <xsl:choose>
  3701. <xsl:when test="$lineType='none'">none</xsl:when>
  3702. <xsl:otherwise>
  3703. <xsl:value-of select="$width"/>
  3704. <xsl:choose>
  3705. <xsl:when test="$lineType='single'">solid </xsl:when>
  3706. <xsl:when test="$lineType='double'">double </xsl:when>
  3707. <xsl:otherwise>solid </xsl:otherwise>
  3708. </xsl:choose>
  3709. <xsl:choose>
  3710. <xsl:when test="$color='auto' or $color='none' or $color=''">#808080</xsl:when>
  3711. <xsl:otherwise>
  3712. <xsl:value-of select="$color"/>
  3713. </xsl:otherwise>
  3714. </xsl:choose>
  3715. </xsl:otherwise>
  3716. </xsl:choose>
  3717. </xsl:template>
  3718. <xsl:template name="uof:边框">
  3719. <xsl:if test="uof:上">
  3720. <xsl:variable name="type" select="uof:上/@uof:类型"/>
  3721. <xsl:variable name="size" select="concat(uof:上/@uof:宽度,$uofUnit,' ')"/>
  3722. <xsl:variable name="clr" select="uof:上/@uof:颜色"/>
  3723. <xsl:attribute name="fo:border-top"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
  3724. <xsl:if test="uof:上/@uof:线宽度">
  3725. <xsl:attribute name="style:border-line-width-top"><xsl:value-of select="uof:上/@uof:线宽度"/></xsl:attribute>
  3726. </xsl:if>
  3727. </xsl:if>
  3728. <xsl:if test="uof:下">
  3729. <xsl:variable name="type" select="uof:下/@uof:类型"/>
  3730. <xsl:variable name="size" select="concat(uof:下/@uof:宽度,$uofUnit,' ')"/>
  3731. <xsl:variable name="clr" select="uof:下/@uof:颜色"/>
  3732. <xsl:attribute name="fo:border-bottom"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
  3733. <xsl:if test="uof:下/@uof:线宽度">
  3734. <xsl:attribute name="style:border-line-width-bottom"><xsl:value-of select="uof:下/@uof:线宽度"/></xsl:attribute>
  3735. </xsl:if>
  3736. </xsl:if>
  3737. <xsl:if test="uof:左">
  3738. <xsl:variable name="type" select="uof:左/@uof:类型"/>
  3739. <xsl:variable name="size" select="concat(uof:左/@uof:宽度,$uofUnit,' ')"/>
  3740. <xsl:variable name="clr" select="uof:左/@uof:颜色"/>
  3741. <xsl:attribute name="fo:border-left"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
  3742. <xsl:if test="uof:左/@uof:线宽度">
  3743. <xsl:attribute name="style:border-line-width-left"><xsl:value-of select="uof:左/@uof:线宽度"/></xsl:attribute>
  3744. </xsl:if>
  3745. </xsl:if>
  3746. <xsl:if test="uof:右">
  3747. <xsl:variable name="type" select="uof:右/@uof:类型"/>
  3748. <xsl:variable name="size" select="concat(uof:右/@uof:宽度,$uofUnit,' ')"/>
  3749. <xsl:variable name="clr" select="uof:右/@uof:颜色"/>
  3750. <xsl:attribute name="fo:border-right"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
  3751. <xsl:if test="uof:右/@uof:线宽度">
  3752. <xsl:attribute name="style:border-line-width-right"><xsl:value-of select="uof:右/@uof:线宽度"/></xsl:attribute>
  3753. </xsl:if>
  3754. </xsl:if>
  3755. <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
  3756. <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
  3757. <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
  3758. </xsl:if>
  3759. </xsl:if>
  3760. <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
  3761. <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
  3762. <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
  3763. </xsl:if>
  3764. </xsl:if>
  3765. <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
  3766. <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
  3767. <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
  3768. </xsl:if>
  3769. </xsl:if>
  3770. <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
  3771. <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
  3772. <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
  3773. </xsl:if>
  3774. </xsl:if>
  3775. <xsl:if test="uof:上/@uof:边距">
  3776. <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(uof:上/@uof:边距,$uofUnit)"/></xsl:attribute>
  3777. </xsl:if>
  3778. <xsl:if test="uof:下/@uof:边距">
  3779. <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(uof:下/@uof:边距,$uofUnit)"/></xsl:attribute>
  3780. </xsl:if>
  3781. <xsl:if test="uof:左/@uof:边距">
  3782. <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(uof:左/@uof:边距,$uofUnit)"/></xsl:attribute>
  3783. </xsl:if>
  3784. <xsl:if test="uof:右/@uof:边距">
  3785. <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(uof:右/@uof:边距,$uofUnit)"/></xsl:attribute>
  3786. </xsl:if>
  3787. </xsl:template>
  3788. <xsl:template name="uof:填充">
  3789. <xsl:choose>
  3790. <xsl:when test="图:颜色">
  3791. <xsl:attribute name="fo:background-color"><xsl:choose><xsl:when test="图:颜色"><xsl:value-of select="图:颜色"/></xsl:when><xsl:otherwise>transparent</xsl:otherwise></xsl:choose></xsl:attribute>
  3792. </xsl:when>
  3793. <xsl:when test="contains(图:图案/@图:前景色,'#')">
  3794. <xsl:attribute name="fo:text-background-color"><xsl:value-of select="图:图案/@图:前景色"/></xsl:attribute>
  3795. </xsl:when>
  3796. <xsl:when test="图:图案/@图:背景色">
  3797. <xsl:attribute name="fo:background-color"><xsl:value-of select="图:图案/@图:背景色"/></xsl:attribute>
  3798. </xsl:when>
  3799. <xsl:otherwise/>
  3800. </xsl:choose>
  3801. <xsl:if test="图:图片">
  3802. <xsl:element name="style:background-image">
  3803. <xsl:variable name="gid">
  3804. <xsl:value-of select="图:图片/@图:图形引用"/>
  3805. </xsl:variable>
  3806. <xsl:if test="图:图片/@图:位置 and not(图:图片/@图:位置='tile')">
  3807. <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when></xsl:choose></xsl:attribute>
  3808. </xsl:if>
  3809. <xsl:choose>
  3810. <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据">
  3811. <xsl:element name="office:binary-data">
  3812. <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
  3813. </xsl:element>
  3814. </xsl:when>
  3815. <xsl:otherwise>
  3816. <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:路径"/></xsl:attribute>
  3817. <xsl:attribute name="xlink:type">simple</xsl:attribute>
  3818. <xsl:attribute name="xlink:actuate">onLoad</xsl:attribute>
  3819. </xsl:otherwise>
  3820. </xsl:choose>
  3821. </xsl:element>
  3822. </xsl:if>
  3823. </xsl:template>
  3824. <xsl:template name="日期域">
  3825. <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
  3826. <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
  3827. <xsl:variable name="datestr">
  3828. <xsl:choose>
  3829. <xsl:when test="contains($date0,'\*')">
  3830. <xsl:value-of select="string(substring-before($date0,'\*'))"/>
  3831. </xsl:when>
  3832. <xsl:otherwise>
  3833. <xsl:value-of select="$date0"/>
  3834. </xsl:otherwise>
  3835. </xsl:choose>
  3836. </xsl:variable>
  3837. <xsl:call-template name="zydate">
  3838. <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
  3839. </xsl:call-template>
  3840. </xsl:if>
  3841. </xsl:template>
  3842. <xsl:template name="zydate">
  3843. <xsl:param name="str1"/>
  3844. <xsl:choose>
  3845. <xsl:when test="substring($str1,1,5)='am/pm'">
  3846. <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
  3847. <xsl:variable name="str1-after" select="substring($str1,6)"/>
  3848. <number:am-pm/>
  3849. <xsl:if test="not($str1-after)=''">
  3850. <number:text>
  3851. <xsl:value-of select="substring($str1-after,1,1)"/>
  3852. </number:text>
  3853. </xsl:if>
  3854. <xsl:if test="string-length($str1-after)&gt;1">
  3855. <xsl:call-template name="zytime">
  3856. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3857. </xsl:call-template>
  3858. </xsl:if>
  3859. </xsl:when>
  3860. <xsl:otherwise>
  3861. <xsl:choose>
  3862. <xsl:when test="substring($str1,1,4)='yyyy'">
  3863. <xsl:variable name="str1-before" select="substring($str1,1,4)"/>
  3864. <xsl:variable name="str1-after" select="substring($str1,5)"/>
  3865. <number:year number:style="long"/>
  3866. <number:text>
  3867. <xsl:value-of select="substring($str1-after,1,1)"/>
  3868. </number:text>
  3869. <xsl:if test="string-length($str1-after)&gt;1">
  3870. <xsl:call-template name="zydate">
  3871. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3872. </xsl:call-template>
  3873. </xsl:if>
  3874. </xsl:when>
  3875. <xsl:otherwise>
  3876. <xsl:choose>
  3877. <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
  3878. <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
  3879. <xsl:variable name="str1-after" select="substring($str1,3)"/>
  3880. <xsl:if test="substring($str1,1,1)='y'">
  3881. <number:year/>
  3882. </xsl:if>
  3883. <xsl:if test="substring($str1,1,1)='M'">
  3884. <number:month number:style="long"/>
  3885. </xsl:if>
  3886. <xsl:if test="substring($str1,1,1)='d'">
  3887. <number:day number:style="long"/>
  3888. </xsl:if>
  3889. <xsl:if test="substring($str1,1,1)='h'">
  3890. <number:hours number:style="long"/>
  3891. </xsl:if>
  3892. <xsl:if test="substring($str1,1,1)='m'">
  3893. <number:minutes number:style="long"/>
  3894. </xsl:if>
  3895. <xsl:if test="substring($str1,1,1)='s'">
  3896. <number:seconds number:style="long"/>
  3897. </xsl:if>
  3898. <xsl:if test="substring($str1,1,1)='W'">
  3899. <number:week-of-year number:style="long"/>
  3900. </xsl:if>
  3901. <number:text>
  3902. <xsl:value-of select="substring($str1-after,1,1)"/>
  3903. </number:text>
  3904. <xsl:if test="string-length($str1-after)&gt;1">
  3905. <xsl:call-template name="zydate">
  3906. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3907. </xsl:call-template>
  3908. </xsl:if>
  3909. </xsl:when>
  3910. <xsl:otherwise>
  3911. <xsl:if test="substring($str1,1,1)='M'or substring($str1,1,1)='d'or substring($str1,1,1)='h'or substring($str1,1,1)='m'or substring($str1,1,1)='s'">
  3912. <xsl:variable name="str1-after" select="substring($str1,2)"/>
  3913. <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
  3914. <xsl:if test="substring($str1,1,1)='M'">
  3915. <number:month/>
  3916. <number:text>
  3917. <xsl:value-of select="substring($str1-after,1,1)"/>
  3918. </number:text>
  3919. </xsl:if>
  3920. <xsl:if test="substring($str1,1,1)='d'">
  3921. <number:day/>
  3922. <number:text>
  3923. <xsl:value-of select="substring($str1-after,1,1)"/>
  3924. </number:text>
  3925. </xsl:if>
  3926. <xsl:if test="substring($str1,1,1)='h'">
  3927. <number:hours/>
  3928. <number:text>
  3929. <xsl:value-of select="substring($str1-after,1,1)"/>
  3930. </number:text>
  3931. </xsl:if>
  3932. <xsl:if test="substring($str1,1,1)='m'">
  3933. <number:minutes/>
  3934. <number:text>
  3935. <xsl:value-of select="substring($str1-after,1,1)"/>
  3936. </number:text>
  3937. </xsl:if>
  3938. <xsl:if test="substring($str1,1,1)='s'">
  3939. <number:seconds/>
  3940. <number:text>
  3941. <xsl:value-of select="substring($str1-after,1,1)"/>
  3942. </number:text>
  3943. </xsl:if>
  3944. <xsl:if test="string-length($str1-after)&gt;1">
  3945. <xsl:call-template name="zydate">
  3946. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3947. </xsl:call-template>
  3948. </xsl:if>
  3949. </xsl:if>
  3950. <xsl:if test="contains(substring($str1,1,3),'Q' )">
  3951. <xsl:choose>
  3952. <xsl:when test="substring($str1,1,1)='Q'">
  3953. <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
  3954. <xsl:variable name="str1-after" select="substring($str1,3)"/>
  3955. <number:quarter/>
  3956. <number:text>
  3957. <xsl:value-of select="substring($str1-after,1,1)"/>
  3958. </number:text>
  3959. <xsl:if test="string-length($str1-after)&gt;1">
  3960. <xsl:call-template name="zydate">
  3961. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3962. </xsl:call-template>
  3963. </xsl:if>
  3964. </xsl:when>
  3965. <xsl:otherwise>
  3966. <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
  3967. <xsl:variable name="str1-after" select="substring($str1,6)"/>
  3968. <number:quarter number:style="long"/>
  3969. <number:text>
  3970. <xsl:value-of select="substring($str1-after,1,1)"/>
  3971. </number:text>
  3972. <xsl:if test="string-length($str1-after)&gt;1">
  3973. <xsl:call-template name="zydate">
  3974. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3975. </xsl:call-template>
  3976. </xsl:if>
  3977. </xsl:otherwise>
  3978. </xsl:choose>
  3979. </xsl:if>
  3980. <xsl:if test="contains(substring(normalize-space($str1),1,3),'W' )">
  3981. <xsl:variable name="str1-before" select="substring(normalize-space($str1),1,3)"/>
  3982. <xsl:variable name="str1-after" select="substring(normalize-space($str1),4)"/>
  3983. <number:day-of-week number:style="long"/>
  3984. <number:text>
  3985. <xsl:value-of select="substring($str1-after,1,1)"/>
  3986. </number:text>
  3987. <xsl:if test="string-length($str1-after)&gt;1">
  3988. <xsl:call-template name="zydate">
  3989. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  3990. </xsl:call-template>
  3991. </xsl:if>
  3992. </xsl:if>
  3993. <xsl:if test="contains(substring($str1,1,3),'NN' ) and substring($str1,1,1)!='NN' ">
  3994. <xsl:variable name="str1-before" select="substring($str1,1,3)"/>
  3995. <xsl:variable name="str1-after" select="substring($str1,4)"/>
  3996. <number:text>第</number:text>
  3997. <number:week-of-year/>
  3998. <number:text>周</number:text>
  3999. <xsl:if test="string-length($str1-after)&gt;1">
  4000. <xsl:call-template name="zydate">
  4001. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  4002. </xsl:call-template>
  4003. </xsl:if>
  4004. </xsl:if>
  4005. </xsl:otherwise>
  4006. </xsl:choose>
  4007. </xsl:otherwise>
  4008. </xsl:choose>
  4009. </xsl:otherwise>
  4010. </xsl:choose>
  4011. </xsl:template>
  4012. <xsl:template name="时间域">
  4013. <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
  4014. <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
  4015. <xsl:variable name="datestr" select="$date0"/>
  4016. <xsl:call-template name="zytime">
  4017. <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
  4018. </xsl:call-template>
  4019. </xsl:if>
  4020. </xsl:template>
  4021. <xsl:template name="zytime">
  4022. <xsl:param name="str1"/>
  4023. <xsl:choose>
  4024. <xsl:when test="substring($str1,1,5)='am/pm'">
  4025. <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
  4026. <xsl:variable name="str1-after" select="substring($str1,6)"/>
  4027. <number:am-pm/>
  4028. <xsl:if test="not($str1-after)=''">
  4029. <number:text>
  4030. <xsl:value-of select="substring($str1-after,1,1)"/>
  4031. </number:text>
  4032. </xsl:if>
  4033. <xsl:if test="string-length($str1-after)&gt;1">
  4034. <xsl:call-template name="zytime">
  4035. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  4036. </xsl:call-template>
  4037. </xsl:if>
  4038. </xsl:when>
  4039. <xsl:otherwise>
  4040. <xsl:choose>
  4041. <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
  4042. <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
  4043. <xsl:variable name="str1-after" select="substring($str1,3)"/>
  4044. <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
  4045. <number:hours number:style="long"/>
  4046. </xsl:if>
  4047. <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
  4048. <number:minutes number:style="long"/>
  4049. </xsl:if>
  4050. <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
  4051. <number:seconds number:style="long"/>
  4052. </xsl:if>
  4053. <number:text>
  4054. <xsl:value-of select="substring($str1-after,1,1)"/>
  4055. </number:text>
  4056. <xsl:if test="string-length($str1-after)&gt;1">
  4057. <xsl:call-template name="zytime">
  4058. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  4059. </xsl:call-template>
  4060. </xsl:if>
  4061. </xsl:when>
  4062. <xsl:otherwise>
  4063. <xsl:if test="substring($str1,1,1)='H'or substring($str1,1,1)='M'or substring($str1,1,1)='S'or substring($str1,1,1)='h' or substring($str1,1,1)='m' or substring($str1,1,1)='s'">
  4064. <xsl:variable name="str1-after" select="substring($str1,2)"/>
  4065. <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
  4066. <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
  4067. <number:hours/>
  4068. <number:text>
  4069. <xsl:value-of select="substring($str1-after,1,1)"/>
  4070. </number:text>
  4071. </xsl:if>
  4072. <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
  4073. <number:minutes/>
  4074. <number:text>
  4075. <xsl:value-of select="substring($str1-after,1,1)"/>
  4076. </number:text>
  4077. </xsl:if>
  4078. <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
  4079. <number:seconds/>
  4080. <number:text>
  4081. <xsl:value-of select="substring($str1-after,1,1)"/>
  4082. </number:text>
  4083. </xsl:if>
  4084. <xsl:if test="string-length($str1-after)&gt;1">
  4085. <xsl:call-template name="zytime">
  4086. <xsl:with-param name="str1" select="substring($str1-after,2)"/>
  4087. </xsl:call-template>
  4088. </xsl:if>
  4089. </xsl:if>
  4090. </xsl:otherwise>
  4091. </xsl:choose>
  4092. </xsl:otherwise>
  4093. </xsl:choose>
  4094. </xsl:template>
  4095. <xsl:template name="oo数字格式域开关">
  4096. <xsl:param name="oo_format"/>
  4097. <xsl:choose>
  4098. <xsl:when test="$oo_format='Arabic'">1</xsl:when>
  4099. <xsl:when test="$oo_format='ROMAN'">I</xsl:when>
  4100. <xsl:when test="$oo_format='roman'">i</xsl:when>
  4101. <xsl:when test="$oo_format='ALPHABETIC'">A</xsl:when>
  4102. <xsl:when test="$oo_format='alphabetic'">a</xsl:when>
  4103. <xsl:when test="$oo_format='GB1'">1, 2, 3, ...</xsl:when>
  4104. <xsl:when test="$oo_format='GB3'">①, ②, ③, ...</xsl:when>
  4105. <xsl:when test="$oo_format='CHINESENUM3'">一, 二, 三, ...</xsl:when>
  4106. <xsl:when test="$oo_format='CHINESENUM2'">壹, 贰, 叁, ...</xsl:when>
  4107. <xsl:when test="$oo_format='ZODIAC1'">甲, 乙, 丙, ...</xsl:when>
  4108. <xsl:when test="$oo_format='ZODIAC2'">子, 丑, 寅, ...</xsl:when>
  4109. <xsl:otherwise>1</xsl:otherwise>
  4110. </xsl:choose>
  4111. </xsl:template>
  4112. <xsl:template name="题注">
  4113. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
  4114. <xsl:variable name="aa" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,'\f ')"/>
  4115. <xsl:variable name="ooow" select="substring-after($aa,'ooow:') "/>
  4116. <xsl:variable name="as" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4117. <xsl:variable name="ad">
  4118. <xsl:value-of select="substring-after($as,'SEQ ') "/>
  4119. </xsl:variable>
  4120. <xsl:variable name="num">
  4121. <xsl:value-of select="substring-after(substring-before(../字:域代码/字:段落/字:句/字:文本串,' \f'),'\* ')"/>
  4122. </xsl:variable>
  4123. <xsl:variable name="fmt">
  4124. <xsl:call-template name="oo数字格式域开关">
  4125. <xsl:with-param name="oo_format" select="$num"/>
  4126. </xsl:call-template>
  4127. </xsl:variable>
  4128. <xsl:element name="text:sequence">
  4129. <xsl:attribute name="text:name"><xsl:choose><xsl:when test="$ad='表格'">Table</xsl:when><xsl:when test="$ad='图表'">Drawing</xsl:when><xsl:otherwise><xsl:value-of select="$ad"/></xsl:otherwise></xsl:choose></xsl:attribute>
  4130. <xsl:attribute name="text:formula"><xsl:choose><xsl:when test="contains($aa,'ooow:')"><xsl:value-of select="$ooow"/></xsl:when><xsl:when test="contains($as,'表格')"><xsl:value-of select="concat('Table','+',$fmt)"/></xsl:when><xsl:when test="contains($as,'图表')"><xsl:value-of select="concat('Drawing','+',$fmt)"/></xsl:when><xsl:otherwise><xsl:value-of select="$aa"/></xsl:otherwise></xsl:choose></xsl:attribute>
  4131. <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
  4132. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4133. </xsl:element>
  4134. </xsl:if>
  4135. </xsl:template>
  4136. <xsl:template name="页码域">
  4137. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
  4138. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4139. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4140. <xsl:variable name="fmt">
  4141. <xsl:call-template name="oo数字格式域开关">
  4142. <xsl:with-param name="oo_format" select="$date0"/>
  4143. </xsl:call-template>
  4144. </xsl:variable>
  4145. <xsl:element name="text:page-number">
  4146. <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
  4147. <xsl:attribute name="text:select-page">current</xsl:attribute>
  4148. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4149. </xsl:element>
  4150. </xsl:if>
  4151. </xsl:template>
  4152. <xsl:template name="页数域">
  4153. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4154. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4155. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4156. <xsl:variable name="fmt">
  4157. <xsl:call-template name="oo数字格式域开关">
  4158. <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
  4159. </xsl:call-template>
  4160. </xsl:variable>
  4161. <xsl:element name="text:page-count">
  4162. <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
  4163. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4164. </xsl:element>
  4165. </xsl:if>
  4166. </xsl:template>
  4167. <xsl:template name="作者域">
  4168. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4169. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4170. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4171. <xsl:element name="text:initial-creator">
  4172. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4173. </xsl:element>
  4174. </xsl:if>
  4175. </xsl:template>
  4176. <xsl:template name="用户域">
  4177. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4178. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4179. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4180. <xsl:element name="text:author-name">
  4181. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4182. </xsl:element>
  4183. </xsl:if>
  4184. </xsl:template>
  4185. <xsl:template name="缩写域">
  4186. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4187. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4188. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4189. <xsl:element name="text:author-initials">
  4190. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4191. </xsl:element>
  4192. </xsl:if>
  4193. </xsl:template>
  4194. <xsl:template name="标题域">
  4195. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4196. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4197. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4198. <xsl:element name="text:title">
  4199. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4200. </xsl:element>
  4201. </xsl:if>
  4202. </xsl:template>
  4203. <xsl:template name="主题域">
  4204. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4205. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4206. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4207. <xsl:element name="text:subject">
  4208. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4209. </xsl:element>
  4210. </xsl:if>
  4211. </xsl:template>
  4212. <xsl:template name="文件名">
  4213. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4214. <xsl:element name="text:file-name">
  4215. <xsl:variable name="string">
  4216. <xsl:value-of select="../字:域代码/字:段落/字:句/字:文本串"/>
  4217. </xsl:variable>
  4218. <xsl:attribute name="text:display"><xsl:choose><xsl:when test="contains($string,' \p')">full</xsl:when><xsl:otherwise>name-and-extension</xsl:otherwise></xsl:choose></xsl:attribute>
  4219. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4220. </xsl:element>
  4221. </xsl:if>
  4222. </xsl:template>
  4223. <xsl:template name="编辑时间">
  4224. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4225. <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
  4226. <xsl:variable name="datestr" select="$date0"/>
  4227. <xsl:call-template name="zytime">
  4228. <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
  4229. </xsl:call-template>
  4230. </xsl:if>
  4231. </xsl:template>
  4232. <xsl:template name="创建时间">
  4233. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4234. <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
  4235. <xsl:variable name="datestr" select="$date0"/>
  4236. <xsl:call-template name="zytime">
  4237. <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
  4238. </xsl:call-template>
  4239. </xsl:if>
  4240. </xsl:template>
  4241. <xsl:template name="字符数">
  4242. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4243. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4244. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4245. <xsl:variable name="fmt">
  4246. <xsl:call-template name="oo数字格式域开关">
  4247. <xsl:with-param name="oo_format" select="substring-before($date0,' \#')"/>
  4248. </xsl:call-template>
  4249. </xsl:variable>
  4250. <xsl:element name="text:character-count">
  4251. <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
  4252. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4253. </xsl:element>
  4254. </xsl:if>
  4255. </xsl:template>
  4256. <xsl:key name="mulu" match="/uof:UOF/uof:式样集/uof:段落式样" use="@字:标识符"/>
  4257. <xsl:template name="索引域">
  4258. <xsl:element name="text:alphabetical-index">
  4259. <xsl:variable name="stylenum">
  4260. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
  4261. </xsl:variable>
  4262. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
  4263. <xsl:variable name="aanum">
  4264. <xsl:number value="0" format="1"/>
  4265. </xsl:variable>
  4266. <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1)"/></xsl:attribute>
  4267. <text:alphabetical-index-source text:main-entry-style-name="Main_index_entry" text:sort-algorithm="pinyin" fo:language="zh" fo:country="CN">
  4268. <text:index-title-template text:style-name="Index_20_Heading">索引目录</text:index-title-template>
  4269. <text:alphabetical-index-entry-template text:outline-level="separator" text:style-name="Index_Separator">
  4270. <text:index-entry-text/>
  4271. </text:alphabetical-index-entry-template>
  4272. <text:alphabetical-index-entry-template text:outline-level="1" text:style-name="Index_20_1">
  4273. <text:index-entry-text/>
  4274. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4275. <text:index-entry-page-number/>
  4276. </text:alphabetical-index-entry-template>
  4277. <text:alphabetical-index-entry-template text:outline-level="2" text:style-name="Index_20_2">
  4278. <text:index-entry-text/>
  4279. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4280. <text:index-entry-page-number/>
  4281. </text:alphabetical-index-entry-template>
  4282. <text:alphabetical-index-entry-template text:outline-level="3" text:style-name="Index_20_3">
  4283. <text:index-entry-text/>
  4284. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4285. <text:index-entry-page-number/>
  4286. </text:alphabetical-index-entry-template>
  4287. </text:alphabetical-index-source>
  4288. <text:index-body>
  4289. <text:index-title>
  4290. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
  4291. <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1,'_Head')"/></xsl:attribute>
  4292. <xsl:for-each select="字:域代码/字:段落[position()=2]">
  4293. <text:p text:style-name="Index_20_Heading">
  4294. <xsl:apply-templates select=".//字:文本串"/>
  4295. </text:p>
  4296. </xsl:for-each>
  4297. </text:index-title>
  4298. <xsl:if test="字:域开始/@字:类型='INDEX'">
  4299. <xsl:for-each select="字:域代码/字:段落[position()>2]">
  4300. <xsl:element name="text:p">
  4301. <xsl:variable name="aa">
  4302. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
  4303. </xsl:variable>
  4304. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
  4305. <xsl:for-each select="字:句">
  4306. <xsl:apply-templates select="self::node()/*"/>
  4307. </xsl:for-each>
  4308. </xsl:element>
  4309. </xsl:for-each>
  4310. </xsl:if>
  4311. </text:index-body>
  4312. </xsl:element>
  4313. </xsl:template>
  4314. <xsl:template name="目录域">
  4315. <xsl:element name="text:table-of-content">
  4316. <xsl:variable name="stylenum">
  4317. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
  4318. </xsl:variable>
  4319. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
  4320. <xsl:variable name="aanum">
  4321. <xsl:number value="0" format="1"/>
  4322. </xsl:variable>
  4323. <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1)"/></xsl:attribute>
  4324. <text:table-of-content-source text:outline-level="10">
  4325. <text:index-title-template text:style-name="Contents_20_Heading">内容目录</text:index-title-template>
  4326. <text:table-of-content-entry-template text:outline-level="1" text:style-name="Contents 1">
  4327. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4328. <text:index-entry-chapter/>
  4329. <text:index-entry-text/>
  4330. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4331. <text:index-entry-page-number/>
  4332. <text:index-entry-link-end/>
  4333. </text:table-of-content-entry-template>
  4334. <text:table-of-content-entry-template text:outline-level="2" text:style-name="Contents 2">
  4335. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4336. <text:index-entry-chapter/>
  4337. <text:index-entry-text/>
  4338. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4339. <text:index-entry-page-number/>
  4340. <text:index-entry-link-end/>
  4341. </text:table-of-content-entry-template>
  4342. <text:table-of-content-entry-template text:outline-level="3" text:style-name="Contents 3">
  4343. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4344. <text:index-entry-chapter/>
  4345. <text:index-entry-text/>
  4346. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4347. <text:index-entry-page-number/>
  4348. <text:index-entry-link-end/>
  4349. </text:table-of-content-entry-template>
  4350. <text:table-of-content-entry-template text:outline-level="4" text:style-name="Contents 4">
  4351. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4352. <text:index-entry-chapter/>
  4353. <text:index-entry-text/>
  4354. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4355. <text:index-entry-page-number/>
  4356. <text:index-entry-link-end/>
  4357. </text:table-of-content-entry-template>
  4358. <text:table-of-content-entry-template text:outline-level="5" text:style-name="Contents 5">
  4359. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4360. <text:index-entry-chapter/>
  4361. <text:index-entry-text/>
  4362. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4363. <text:index-entry-page-number/>
  4364. <text:index-entry-link-end/>
  4365. </text:table-of-content-entry-template>
  4366. <text:table-of-content-entry-template text:outline-level="6" text:style-name="Contents 6">
  4367. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4368. <text:index-entry-chapter/>
  4369. <text:index-entry-text/>
  4370. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4371. <text:index-entry-page-number/>
  4372. <text:index-entry-link-end/>
  4373. </text:table-of-content-entry-template>
  4374. <text:table-of-content-entry-template text:outline-level="7" text:style-name="Contents 7">
  4375. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4376. <text:index-entry-chapter/>
  4377. <text:index-entry-text/>
  4378. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4379. <text:index-entry-page-number/>
  4380. <text:index-entry-link-end/>
  4381. </text:table-of-content-entry-template>
  4382. <text:table-of-content-entry-template text:outline-level="8" text:style-name="Contents 8">
  4383. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4384. <text:index-entry-chapter/>
  4385. <text:index-entry-text/>
  4386. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4387. <text:index-entry-page-number/>
  4388. <text:index-entry-link-end/>
  4389. </text:table-of-content-entry-template>
  4390. <text:table-of-content-entry-template text:outline-level="9" text:style-name="Contents 9">
  4391. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4392. <text:index-entry-chapter/>
  4393. <text:index-entry-text/>
  4394. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4395. <text:index-entry-page-number/>
  4396. <text:index-entry-link-end/>
  4397. </text:table-of-content-entry-template>
  4398. <text:table-of-content-entry-template text:outline-level="10" text:style-name="Contents 10">
  4399. <text:index-entry-link-start text:style-name="Index_20_Link"/>
  4400. <text:index-entry-chapter/>
  4401. <text:index-entry-text/>
  4402. <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
  4403. <text:index-entry-page-number/>
  4404. <text:index-entry-link-end/>
  4405. </text:table-of-content-entry-template>
  4406. </text:table-of-content-source>
  4407. <text:index-body>
  4408. <text:index-title>
  4409. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
  4410. <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1,'_Head')"/></xsl:attribute>
  4411. <xsl:for-each select="字:域代码/字:段落[position()=2]">
  4412. <text:p text:style-name="Contents_20_Heading">
  4413. <xsl:apply-templates select=".//字:文本串"/>
  4414. </text:p>
  4415. </xsl:for-each>
  4416. </text:index-title>
  4417. <xsl:if test="字:域开始/@字:类型='REF'">
  4418. <xsl:for-each select="字:域代码/字:段落[position()>2]">
  4419. <xsl:element name="text:p">
  4420. <xsl:variable name="aa">
  4421. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
  4422. </xsl:variable>
  4423. <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
  4424. <xsl:element name="text:a">
  4425. <xsl:attribute name="xlink:type">simple</xsl:attribute>
  4426. <xsl:attribute name="text:style-name">Index Link</xsl:attribute>
  4427. <xsl:attribute name="text:visited-style-name">Index Link</xsl:attribute>
  4428. <xsl:variable name="hyperDest" select="./字:句/字:区域开始/@字:标识符"/>
  4429. <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:value-of select="concat('#',@uof:书签)"/></xsl:if></xsl:for-each></xsl:attribute>
  4430. <xsl:apply-templates select="字:句/*"/>
  4431. </xsl:element>
  4432. </xsl:element>
  4433. </xsl:for-each>
  4434. </xsl:if>
  4435. </text:index-body>
  4436. </xsl:element>
  4437. </xsl:template>
  4438. <xsl:template name="suojinleixing">
  4439. <xsl:if test="字:缩进/字:首行/字:绝对/@字:值 and 字:缩进/字:左/字:绝对/@字:值">
  4440. <xsl:attribute name="text:min-label-width"><xsl:value-of select="concat(0 - 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  4441. <xsl:attribute name="text:space-before"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值 + 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
  4442. </xsl:if>
  4443. </xsl:template>
  4444. <xsl:template match="字:修订开始[@字:类型='insert']">
  4445. <xsl:choose>
  4446. <xsl:when test="./@字:标识符">
  4447. <text:change-start text:change-id="{@字:标识符}"/>
  4448. </xsl:when>
  4449. <xsl:otherwise>
  4450. <text:change-start text:change-id="{@字:修订信息引用}"/>
  4451. </xsl:otherwise>
  4452. </xsl:choose>
  4453. </xsl:template>
  4454. <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='insert']">
  4455. <text:change-end>
  4456. <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
  4457. </text:change-end>
  4458. </xsl:template>
  4459. <xsl:template match="字:修订开始[@字:类型='delete']">
  4460. <xsl:choose>
  4461. <xsl:when test="./@字:标识符">
  4462. <text:change-start text:change-id="{@字:标识符}"/>
  4463. </xsl:when>
  4464. <xsl:otherwise>
  4465. <text:change-start text:change-id="{@字:修订信息引用}"/>
  4466. </xsl:otherwise>
  4467. </xsl:choose>
  4468. </xsl:template>
  4469. <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='delete']">
  4470. <text:change-end>
  4471. <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
  4472. </text:change-end>
  4473. </xsl:template>
  4474. <xsl:template match="字:修订开始[@字:类型='format']">
  4475. <xsl:choose>
  4476. <xsl:when test="./@字:标识符">
  4477. <text:change-start text:change-id="{@字:标识符}"/>
  4478. </xsl:when>
  4479. <xsl:otherwise>
  4480. <text:change-start text:change-id="{@字:修订信息引用}"/>
  4481. </xsl:otherwise>
  4482. </xsl:choose>
  4483. </xsl:template>
  4484. <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='format']">
  4485. <text:change-end>
  4486. <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
  4487. </text:change-end>
  4488. </xsl:template>
  4489. <xsl:template name="GenerateTrackChanges">
  4490. <text:tracked-changes>
  4491. <xsl:if test="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订">
  4492. <xsl:attribute name="text:track-changes"><xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订/@字:值"/></xsl:attribute>
  4493. </xsl:if>
  4494. <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
  4495. <xsl:for-each select="//字:段落/字:修订开始[@字:类型='insert']">
  4496. <xsl:variable name="id" select="@字:标识符"/>
  4497. <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
  4498. <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
  4499. <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
  4500. <text:changed-region text:id="{$id}">
  4501. <xsl:choose>
  4502. <xsl:when test="name()='字:修订开始'">
  4503. <xsl:choose>
  4504. <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
  4505. <text:insertion>
  4506. <office:change-info>
  4507. <dc:creator>
  4508. <xsl:value-of select="$sid"/>
  4509. </dc:creator>
  4510. <dc:date>
  4511. <xsl:value-of select="$bid"/>
  4512. </dc:date>
  4513. </office:change-info>
  4514. </text:insertion>
  4515. </xsl:when>
  4516. <xsl:otherwise>
  4517. <text:format-change>
  4518. <office:change-info>
  4519. <dc:creator>
  4520. <xsl:value-of select="$sid"/>
  4521. </dc:creator>
  4522. <dc:date>
  4523. <xsl:value-of select="$bid"/>
  4524. </dc:date>
  4525. </office:change-info>
  4526. </text:format-change>
  4527. </xsl:otherwise>
  4528. </xsl:choose>
  4529. </xsl:when>
  4530. </xsl:choose>
  4531. </text:changed-region>
  4532. </xsl:for-each>
  4533. </xsl:if>
  4534. <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
  4535. <xsl:for-each select="//字:段落/字:修订开始[@字:类型='delete']">
  4536. <xsl:variable name="id" select="@字:标识符"/>
  4537. <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
  4538. <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
  4539. <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
  4540. <text:changed-region text:id="{$id}">
  4541. <xsl:choose>
  4542. <xsl:when test="name()='字:修订开始'">
  4543. <xsl:choose>
  4544. <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
  4545. <text:deletion>
  4546. <office:change-info>
  4547. <dc:creator>
  4548. <xsl:value-of select="$sid"/>
  4549. </dc:creator>
  4550. <dc:date>
  4551. <xsl:value-of select="$bid"/>
  4552. </dc:date>
  4553. </office:change-info>
  4554. </text:deletion>
  4555. </xsl:when>
  4556. <xsl:otherwise>
  4557. <text:format-change>
  4558. <office:change-info>
  4559. <dc:creator>
  4560. <xsl:value-of select="$sid"/>
  4561. </dc:creator>
  4562. <dc:date>
  4563. <xsl:value-of select="$bid"/>
  4564. </dc:date>
  4565. </office:change-info>
  4566. </text:format-change>
  4567. </xsl:otherwise>
  4568. </xsl:choose>
  4569. </xsl:when>
  4570. </xsl:choose>
  4571. </text:changed-region>
  4572. </xsl:for-each>
  4573. </xsl:if>
  4574. <xsl:if test="//字:段落/字:修订开始[@字:类型='format']">
  4575. <xsl:for-each select="//字:段落/字:修订开始[@字:类型='format']">
  4576. <xsl:variable name="id" select="@字:标识符"/>
  4577. <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
  4578. <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
  4579. <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
  4580. <text:changed-region text:id="{$id}">
  4581. <xsl:choose>
  4582. <xsl:when test="name()='字:修订开始'">
  4583. <xsl:choose>
  4584. <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
  4585. <text:format-change>
  4586. <office:change-info>
  4587. <dc:creator>
  4588. <xsl:value-of select="$sid"/>
  4589. </dc:creator>
  4590. <dc:date>
  4591. <xsl:value-of select="$bid"/>
  4592. </dc:date>
  4593. </office:change-info>
  4594. </text:format-change>
  4595. </xsl:when>
  4596. <xsl:otherwise>
  4597. </xsl:otherwise>
  4598. </xsl:choose>
  4599. </xsl:when>
  4600. </xsl:choose>
  4601. </text:changed-region>
  4602. </xsl:for-each>
  4603. </xsl:if>
  4604. </text:tracked-changes>
  4605. </xsl:template>
  4606. <xsl:template name="oo数字格式">
  4607. <xsl:param name="oo_format"/>
  4608. <xsl:choose>
  4609. <xsl:when test="$oo_format='decimal'">1</xsl:when>
  4610. <xsl:when test="$oo_format='upper-roman'">I</xsl:when>
  4611. <xsl:when test="$oo_format='lower-roman'">i</xsl:when>
  4612. <xsl:when test="$oo_format='upper-letter'">A</xsl:when>
  4613. <xsl:when test="$oo_format='lower-letter'">a</xsl:when>
  4614. <xsl:when test="$oo_format='decimal-full-width'">1, 2, 3, ...</xsl:when>
  4615. <xsl:when test="$oo_format='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when>
  4616. <xsl:when test="$oo_format='chinese-counting'">一, 二, 三, ...</xsl:when>
  4617. <xsl:when test="$oo_format='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when>
  4618. <xsl:when test="$oo_format='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when>
  4619. <xsl:when test="$oo_format='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when>
  4620. <xsl:otherwise>1</xsl:otherwise>
  4621. </xsl:choose>
  4622. </xsl:template>
  4623. <xsl:template name="章节域">
  4624. <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
  4625. <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
  4626. <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
  4627. <xsl:variable name="fmt">
  4628. <xsl:choose>
  4629. <xsl:when test="substring-before($date0,' \*')='Arabic'">
  4630. <xsl:call-template name="oo数字格式域开关">
  4631. <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
  4632. </xsl:call-template>
  4633. </xsl:when>
  4634. <xsl:otherwise>1</xsl:otherwise>
  4635. </xsl:choose>
  4636. </xsl:variable>
  4637. <xsl:element name="text:chapter">
  4638. <xsl:attribute name="text:display">name</xsl:attribute>
  4639. <xsl:attribute name="text:outline-level"><xsl:value-of select="$fmt"/></xsl:attribute>
  4640. <xsl:value-of select="following-sibling::字:句/字:文本串"/>
  4641. </xsl:element>
  4642. </xsl:if>
  4643. </xsl:template>
  4644. </xsl:stylesheet>