odf2uof_text.xsl 312 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  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="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 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" exclude-result-prefixes="office style text table draw fo xlink dc meta number presentation svg chart dr3d math form script config ooo ooow oooc dom xforms smil anim">
  20. <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
  21. <!--xsl:key name="colWidth" match="/office:automatic/style:style/" use="@style:column-width"/-->
  22. <xsl:variable name="swValueWithUnit">
  23. <xsl:value-of select="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@fo:page-width"/>
  24. </xsl:variable>
  25. <xsl:variable name="uofUnit">
  26. <xsl:choose>
  27. <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
  28. <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
  29. <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
  30. <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
  31. <xsl:otherwise>inch</xsl:otherwise>
  32. </xsl:choose>
  33. </xsl:variable>
  34. <xsl:variable name="ooUnit">
  35. <xsl:choose>
  36. <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
  37. <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
  38. <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
  39. <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
  40. <xsl:otherwise>inch</xsl:otherwise>
  41. </xsl:choose>
  42. </xsl:variable>
  43. <xsl:template match="/">
  44. <xsl:apply-templates select="office:document"/>
  45. </xsl:template>
  46. <xsl:template match="office:document">
  47. <uof:UOF 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" uof:language="cn" uof:locID="u0000" uof:version="1.0" uof:mimetype="vnd.uof.text">
  48. <xsl:apply-templates select="office:meta"/>
  49. <xsl:if test="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
  50. <uof:书签集 uof:locID="u0027">
  51. <xsl:for-each select="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
  52. <uof:书签 uof:locID="u0028" uof:attrList="名称">
  53. <xsl:attribute name="uof:名称"><xsl:value-of select="@text:name"/></xsl:attribute>
  54. <uof:文本位置 uof:locID="u0029" uof:attrList="区域引用">
  55. <xsl:attribute name="字:区域引用"><xsl:value-of select="generate-id()"/></xsl:attribute>
  56. </uof:文本位置>
  57. </uof:书签>
  58. </xsl:for-each>
  59. </uof:书签集>
  60. </xsl:if>
  61. <xsl:if test="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
  62. <uof:链接集 uof:locID="u0031">
  63. <xsl:for-each select="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
  64. <xsl:variable name="hyperStr" select="@xlink:href"/>
  65. <uof:超级链接 uof:locID="u0032" uof:attrList="标识符 目标 书签 式样引用 已访问式样引用 提示 链源">
  66. <xsl:if test="contains($hyperStr,'#')">
  67. <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
  68. </xsl:if>
  69. <xsl:variable name="num">
  70. <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a | table:table/table:table-row/table:table-cell/text:a"/>
  71. </xsl:variable>
  72. <xsl:attribute name="uof:链源"><xsl:value-of select="concat('hlnk',$num)"/></xsl:attribute>
  73. <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('hyk_','hlnk',$num)"/></xsl:attribute>
  74. <xsl:if test="not(contains($hyperStr,'#'))">
  75. <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
  76. </xsl:if>
  77. <xsl:if test="@office:name">
  78. <xsl:attribute name="uof:提示"><xsl:value-of select="@office:name"/></xsl:attribute>
  79. </xsl:if>
  80. <xsl:if test="@text:style-name">
  81. <xsl:attribute name="uof:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  82. </xsl:if>
  83. <xsl:if test="@text:visited-style-name">
  84. <xsl:attribute name="uof:已访问式样引用"><xsl:value-of select="@text:visited-style-name"/></xsl:attribute>
  85. </xsl:if>
  86. </uof:超级链接>
  87. </xsl:for-each>
  88. </uof:链接集>
  89. </xsl:if>
  90. <uof:式样集 uof:locID="u0039">
  91. <xsl:apply-templates select="office:font-face-decls"/>
  92. <xsl:call-template name="自动编号集"/>
  93. <xsl:call-template name="shiyang"/>
  94. <xsl:apply-templates select="office:automatic-styles/style:style" mode="style"/>
  95. </uof:式样集>
  96. <uof:对象集 uof:locID="u0033">
  97. <xsl:for-each select="/office:document/office:body/office:text/draw:*">
  98. <xsl:variable name="nodename1">
  99. <xsl:value-of select="name()"/>
  100. </xsl:variable>
  101. <xsl:call-template name="draw">
  102. <xsl:with-param name="nodename1" select="$nodename1"/>
  103. </xsl:call-template>
  104. </xsl:for-each>
  105. <xsl:apply-templates select="/office:document/office:body/office:text//text:p" mode="styles"/>
  106. <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:header/text:p" mode="styles"/>
  107. <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:footer/text:p" mode="styles"/>
  108. <xsl:for-each select="(/office:document/office:styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/style:background-image) | /office:document/office:automatic-styles/style:style/style:table-cell-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:table-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:graphic-properties/style:background-image">
  109. <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
  110. <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
  111. <xsl:attribute name="uof:公共类型">png</xsl:attribute>
  112. <xsl:attribute name="uof:内嵌">true</xsl:attribute>
  113. <uof:数据 uof:locID="u0037">
  114. <xsl:value-of select="office:binary-data"/>
  115. </uof:数据>
  116. </uof:其他对象>
  117. </xsl:for-each>
  118. <xsl:for-each select="(/office:document/office:styles/text:list-style/text:list-level-style-image) | (/office:document/office:automatic-styles/text:list-style/text:list-level-style-image)">
  119. <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
  120. <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/></xsl:attribute>
  121. <xsl:attribute name="uof:公共类型">png</xsl:attribute>
  122. <xsl:attribute name="uof:内嵌">true</xsl:attribute>
  123. <uof:数据 uof:locID="u0037">
  124. <xsl:value-of select="office:binary-data"/>
  125. </uof:数据>
  126. </uof:其他对象>
  127. </xsl:for-each>
  128. <xsl:for-each select="/office:document/office:styles/draw:fill-image">
  129. <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
  130. <xsl:attribute name="uof:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
  131. <xsl:attribute name="uof:公共类型">png</xsl:attribute>
  132. <xsl:attribute name="uof:内嵌">true</xsl:attribute>
  133. <uof:数据 uof:locID="u0037">
  134. <xsl:value-of select="office:binary-data"/>
  135. </uof:数据>
  136. </uof:其他对象>
  137. </xsl:for-each>
  138. <!--xsl:apply-templates select="/office:document/office:automatic-styles/style:style[@style:family = 'graphics']"/>
  139. <xsl:apply-templates select="office:styles/style:style[@style:family = 'graphics']"/>
  140. <xsl:apply-templates select="office:styles/style:default-style [@style:family = 'graphics']"/-->
  141. </uof:对象集>
  142. <uof:文字处理 uof:locID="u0047">
  143. <字:公用处理规则 uof:locID="t0000">
  144. <xsl:apply-templates select="office:settings"/>
  145. <xsl:call-template name="GetUsers"/>
  146. <xsl:call-template name="GetTrackChanges"/>
  147. <xsl:call-template name="GetAnnotations"/>
  148. </字:公用处理规则>
  149. <字:主体 uof:locID="t0016">
  150. <xsl:for-each select="office:automatic-styles/style:page-layout[@style:name='pm1']">
  151. <xsl:call-template name="style:page-layout"/>
  152. </xsl:for-each>
  153. <!--xsl:call-template name="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
  154. <!--xsl:apply-templates select="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
  155. <xsl:apply-templates select="office:body/office:text"/>
  156. <xsl:call-template name="logic-chapter"/>
  157. </字:主体>
  158. </uof:文字处理>
  159. </uof:UOF>
  160. </xsl:template>
  161. <xsl:template name="logic-chapter">
  162. <xsl:element name="字:逻辑章节">
  163. <xsl:attribute name="uof:locID">t0050</xsl:attribute>
  164. </xsl:element>
  165. </xsl:template>
  166. <xsl:template name="GetAnnotations">
  167. <xsl:if test="/*/office:body/office:text//office:annotation ">
  168. <字:批注集 uof:locID="t0014">
  169. <xsl:for-each select="/*/office:body/office:text//office:annotation">
  170. <字:批注 uof:locID="t0015" uof:attrList="区域引用 作者 日期 作者缩写">
  171. <xsl:attribute name="字:作者"><xsl:value-of select="generate-id()"/></xsl:attribute>
  172. <xsl:attribute name="字:日期"><xsl:value-of select="dc:date"/></xsl:attribute>
  173. <xsl:attribute name="字:区域引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
  174. <xsl:for-each select="./node()">
  175. <xsl:choose>
  176. <xsl:when test="name()='text:p'">
  177. <xsl:call-template name="execParagraph">
  178. <xsl:with-param name="currlistlvl" select="number('0')"/>
  179. <xsl:with-param name="liststylename" select="string('00000')"/>
  180. </xsl:call-template>
  181. </xsl:when>
  182. <xsl:when test="name()='table:table'">
  183. <xsl:call-template name="exec_table"/>
  184. </xsl:when>
  185. <xsl:otherwise/>
  186. </xsl:choose>
  187. </xsl:for-each>
  188. </字:批注>
  189. </xsl:for-each>
  190. </字:批注集>
  191. </xsl:if>
  192. </xsl:template>
  193. <xsl:template name="GetTrackChanges">
  194. <xsl:if test="/*/office:body/office:text/text:tracked-changes">
  195. <字:修订信息集 uof:locID="t0012">
  196. <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
  197. <字:修订信息 字:标识符="{@text:id}" 字:作者="{generate-id()}" 字:日期="{node()//office:change-info/dc:date}" uof:locID="t0013" uof:attrList="标识符 作者 日期"/>
  198. </xsl:for-each>
  199. </字:修订信息集>
  200. </xsl:if>
  201. </xsl:template>
  202. <xsl:template name="GetUsers">
  203. <xsl:if test="/*/office:body/office:text/text:tracked-changes//office:change-info/dc:creator or //office:annotation/@office:author or //office:annotation/dc:creator">
  204. <字:用户集 uof:locID="t0010">
  205. <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
  206. <字:用户 字:标识符="{generate-id()}" 字:姓名="{node()//office:change-info/dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
  207. </xsl:for-each>
  208. <xsl:for-each select="//office:annotation">
  209. <字:用户 字:标识符="{generate-id()}" 字:姓名="{dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
  210. </xsl:for-each>
  211. </字:用户集>
  212. </xsl:if>
  213. </xsl:template>
  214. <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
  215. <xsl:template match="text:p" mode="styles">
  216. <xsl:for-each select="child::*">
  217. <xsl:variable name="nodename1">
  218. <xsl:value-of select="name()"/>
  219. </xsl:variable>
  220. <xsl:if test="(substring-before($nodename1,':') = 'draw')">
  221. <xsl:call-template name="draw">
  222. <xsl:with-param name="nodename1" select="$nodename1"/>
  223. </xsl:call-template>
  224. </xsl:if>
  225. </xsl:for-each>
  226. </xsl:template>
  227. <xsl:template name="draw">
  228. <xsl:param name="nodename1"/>
  229. <xsl:choose>
  230. <xsl:when test="substring-after($nodename1,':') = 'a'">
  231. <xsl:for-each select="child::*">
  232. <xsl:call-template name="draw">
  233. <xsl:with-param name="nodename">
  234. <xsl:value-of select="name()"/>
  235. </xsl:with-param>
  236. </xsl:call-template>
  237. </xsl:for-each>
  238. </xsl:when>
  239. <xsl:when test="substring-after($nodename1,':') = 'g'">
  240. <xsl:call-template name="draw:g"/>
  241. </xsl:when>
  242. <xsl:otherwise>
  243. <xsl:call-template name="creategraphicstyles"/>
  244. </xsl:otherwise>
  245. </xsl:choose>
  246. </xsl:template>
  247. <xsl:template name="draw:g">
  248. <xsl:variable name="picnumber1">
  249. <xsl:value-of select="count(preceding::draw:g)"/>
  250. </xsl:variable>
  251. <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
  252. <xsl:attribute name="图:标识符"><xsl:value-of select="concat(@draw:style-name,'_',$picnumber1)"/></xsl:attribute>
  253. <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when><xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise></xsl:choose></xsl:attribute>
  254. <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
  255. </图:图形>
  256. <xsl:for-each select="child::*">
  257. <xsl:choose>
  258. <xsl:when test="name()='draw:g'">
  259. <xsl:call-template name="draw:g"/>
  260. </xsl:when>
  261. <xsl:otherwise>
  262. <xsl:call-template name="creategraphicstyles"/>
  263. </xsl:otherwise>
  264. </xsl:choose>
  265. </xsl:for-each>
  266. </xsl:template>
  267. <xsl:template name="zuheliebiao">
  268. <xsl:param name="allnode"/>
  269. <xsl:param name="pos"/>
  270. <xsl:choose>
  271. <xsl:when test="../child::*[$pos]">
  272. <xsl:for-each select="../child::*[$pos]">
  273. <xsl:variable name="nodepos">
  274. <xsl:value-of select="@draw:style-name"/>
  275. </xsl:variable>
  276. <xsl:variable name="picnumber1">
  277. <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
  278. </xsl:variable>
  279. <xsl:variable name="pic-name1">
  280. <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
  281. </xsl:variable>
  282. <xsl:variable name="allnode1">
  283. <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
  284. </xsl:variable>
  285. <xsl:call-template name="zuheliebiao">
  286. <xsl:with-param name="allnode" select="$allnode1"/>
  287. <xsl:with-param name="pos" select="$pos+1"/>
  288. </xsl:call-template>
  289. </xsl:for-each>
  290. </xsl:when>
  291. <xsl:otherwise>
  292. <xsl:value-of select="$allnode"/>
  293. </xsl:otherwise>
  294. </xsl:choose>
  295. </xsl:template>
  296. <xsl:template name="creategraphicstyles">
  297. <xsl:variable name="nodename">
  298. <xsl:value-of select="name()"/>
  299. </xsl:variable>
  300. <xsl:variable name="pic-name">
  301. <xsl:value-of select="@draw:style-name"/>
  302. </xsl:variable>
  303. <xsl:variable name="pic-num">
  304. <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
  305. </xsl:variable>
  306. <xsl:variable name="picnumber">
  307. <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
  308. </xsl:variable>
  309. <xsl:call-template name="pic-process">
  310. <xsl:with-param name="pic-name" select="$pic-name"/>
  311. <xsl:with-param name="nodename" select="$nodename"/>
  312. <xsl:with-param name="picnumber" select="$picnumber"/>
  313. </xsl:call-template>
  314. </xsl:template>
  315. <!--xsl:key match="/office:document/office:automatic-styles/style:style" name="graphicset" use="@style:name"/>
  316. <xsl:template match="style:style[@style:family = 'graphics']">
  317. <xsl:variable name="pic-name">
  318. <xsl:value-of select="@style:name"/>
  319. </xsl:variable>
  320. <xsl:variable name="pic-num">
  321. <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
  322. </xsl:variable>
  323. <xsl:call-template name="pic-process">
  324. <xsl:with-param name="pic-name" select="$pic-name"/>
  325. <xsl:with-param name="pic-num" select="$pic-num"/>
  326. <xsl:with-param name="current-num" select="1"/>
  327. </xsl:call-template>
  328. </xsl:template-->
  329. <xsl:template name="pic-process">
  330. <xsl:param name="pic-name"/>
  331. <xsl:param name="nodename"/>
  332. <xsl:param name="picnumber"/>
  333. <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
  334. <xsl:attribute name="图:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
  335. <xsl:attribute name="图:层次"><xsl:value-of select="@draw:z-index"/></xsl:attribute>
  336. <xsl:if test=".//office:binary-data">
  337. <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
  338. </xsl:if>
  339. <xsl:variable name="arrow-sign">
  340. <xsl:choose>
  341. <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
  342. <xsl:value-of select="'1'"/>
  343. </xsl:when>
  344. <xsl:otherwise>0</xsl:otherwise>
  345. </xsl:choose>
  346. </xsl:variable>
  347. <xsl:choose>
  348. <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:path'or $nodename='draw:g' or $nodename='draw:text-box' or child::draw:text-box">
  349. <图:预定义图形 uof:locID="g0005">
  350. <图:类别 uof:locID="g0006">
  351. <xsl:choose>
  352. <xsl:when test="$nodename='draw:line' and $arrow-sign='1'">62</xsl:when>
  353. <xsl:when test="$nodename='draw:rect'">11</xsl:when>
  354. <xsl:when test="$nodename='draw:line'">61</xsl:when>
  355. <xsl:when test="$nodename='draw:circle'">19</xsl:when>
  356. <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
  357. <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
  358. <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
  359. <xsl:when test="child::draw:text-box[@fo:min-height]">22</xsl:when>
  360. <xsl:when test="child::draw:text-box">23</xsl:when>
  361. </xsl:choose>
  362. </图:类别>
  363. <图:名称 uof:locID="g0007">
  364. <xsl:choose>
  365. <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
  366. <xsl:when test="$nodename='draw:line'">Line</xsl:when>
  367. <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
  368. <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
  369. <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
  370. <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
  371. <xsl:when test="$nodename='draw:frame' and child::draw:text-box[@fo:min-height]">排版框</xsl:when>
  372. <xsl:when test="$nodename='draw:frame' and child::draw:text-box">排版框</xsl:when>
  373. </xsl:choose>
  374. </图:名称>
  375. <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
  376. <xsl:if test="./@draw:points or ./@svg:d">
  377. <图:关键点坐标 uof:locID="g0009" uof:attrList="路径">
  378. <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
  379. </图:关键点坐标>
  380. </xsl:if>
  381. <图:属性 uof:locID="g0011">
  382. <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
  383. <xsl:if test="style:graphic-properties/@draw:fill-color or style:graphic-properties/@fo:background-color or style:graphic-properties/@draw:fill-image-name or style:graphic-properties/@draw:fill-gradient-name">
  384. <图:填充 uof:locID="g0012">
  385. <xsl:choose>
  386. <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
  387. <xsl:variable name="gradient-name">
  388. <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
  389. </xsl:variable>
  390. <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
  391. <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
  392. <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
  393. <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
  394. <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
  395. <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
  396. <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
  397. <xsl:variable name="angle">
  398. <xsl:value-of select="@draw:angle div 10"/>
  399. </xsl:variable>
  400. <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
  401. <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
  402. <xsl:if test="@draw:cx">
  403. <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
  404. </xsl:if>
  405. <xsl:if test="@draw:cy">
  406. <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
  407. </xsl:if>
  408. <xsl:attribute name="图:类型">-2</xsl:attribute>
  409. </图:渐变>
  410. </xsl:for-each>
  411. </xsl:when>
  412. <xsl:when test="style:graphic-properties/@draw:fill-image-name or style:graphic-properties/style:background-image/office:binary-data">
  413. <xsl:choose>
  414. <xsl:when test="style:graphic-properties/@draw:fill-image-name">
  415. <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
  416. <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
  417. <xsl:attribute name="图:图形引用"><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:attribute>
  418. <xsl:attribute name="图:类型">png</xsl:attribute>
  419. <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
  420. </图:图片>
  421. </xsl:when>
  422. <xsl:when test="style:graphic-properties/style:background-image/office:binary-data">
  423. <xsl:for-each select="style:graphic-properties">
  424. <xsl:call-template name="图:填充"/>
  425. </xsl:for-each>
  426. </xsl:when>
  427. </xsl:choose>
  428. </xsl:when>
  429. <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
  430. <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
  431. <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
  432. <xsl:attribute name="图:图形引用"/>
  433. <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
  434. <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
  435. </图:图案>
  436. </xsl:when>
  437. <xsl:otherwise>
  438. <图:颜色 uof:locID="g0034">
  439. <xsl:choose>
  440. <xsl:when test="style:graphic-properties/@draw:fill-color">
  441. <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
  442. </xsl:when>
  443. <xsl:when test="style:graphic-properties/@fo:background-color">
  444. <xsl:value-of select="style:graphic-properties/@fo:background-color"/>
  445. </xsl:when>
  446. <xsl:otherwise>#99ccff</xsl:otherwise>
  447. </xsl:choose>
  448. </图:颜色>
  449. </xsl:otherwise>
  450. </xsl:choose>
  451. </图:填充>
  452. </xsl:if>
  453. <xsl:if test="style:graphic-properties/@svg:stroke-color">
  454. <图:线颜色 uof:locID="g0013">
  455. <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
  456. </图:线颜色>
  457. </xsl:if>
  458. <图:线型 uof:locID="g0014">
  459. <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
  460. <xsl:choose>
  461. <xsl:when test="style:graphic-properties/@fo:border='none'">none</xsl:when>
  462. <xsl:when test="not(style:graphic-properties/@draw:stroke)">
  463. <xsl:choose>
  464. <xsl:when test="not(style:graphic-properties/@svg:stroke-width)">single</xsl:when>
  465. <xsl:otherwise>thick</xsl:otherwise>
  466. </xsl:choose>
  467. </xsl:when>
  468. <xsl:otherwise>
  469. <xsl:choose>
  470. <xsl:when test="style:graphic-properties/@draw:stroke = 'none'">none</xsl:when>
  471. <xsl:otherwise>
  472. <xsl:choose>
  473. <xsl:when test="$linetype='Fine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dash-long-heavy</xsl:when>
  474. <xsl:when test="$linetype='Fine_20_Dashed'">dash-long</xsl:when>
  475. <xsl:when test="$linetype='2 Dots 1 Dash' and style:graphic-properties/@svg:stroke-width">dash-dot-dot-heavy</xsl:when>
  476. <xsl:when test="$linetype='2 Dots 1 Dash'">dot-dot-dash</xsl:when>
  477. <xsl:when test="$linetype='Ultrafine Dashed' and style:graphic-properties/@svg:stroke-width">dashed-heavy</xsl:when>
  478. <xsl:when test="$linetype='Ultrafine Dotted (var)'and style:graphic-properties/@svg:stroke-width">dotted-heavy</xsl:when>
  479. <xsl:when test="$linetype='Ultrafine Dotted (var)'">dotted</xsl:when>
  480. <xsl:when test="$linetype='Line with Fine Dots'">double</xsl:when>
  481. <xsl:when test="$linetype='3 Dashes 3 Dots (var)' and style:graphic-properties/@svg:stroke-width">dash-dot-heavy</xsl:when>
  482. <xsl:when test="$linetype='3 Dashes 3 Dots (var)'">dot-dash</xsl:when>
  483. <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'and style:graphic-properties/@svg:stroke-width">wavy-heavy</xsl:when>
  484. <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'">wave</xsl:when>
  485. <xsl:when test="$linetype='Fine Dashed (var)'">wavy-double</xsl:when>
  486. <xsl:otherwise>dash</xsl:otherwise>
  487. </xsl:choose>
  488. </xsl:otherwise>
  489. </xsl:choose>
  490. </xsl:otherwise>
  491. </xsl:choose>
  492. </图:线型>
  493. <xsl:if test="style:graphic-properties/@svg:stroke-width">
  494. <图:线粗细 uof:locID="g0016">
  495. <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
  496. </图:线粗细>
  497. </xsl:if>
  498. <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
  499. <图:前端箭头 uof:locID="g0017">
  500. <图:式样 uof:locID="g0018">
  501. <xsl:choose>
  502. <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
  503. <xsl:when test="style:graphic-properties/@draw:marker-start='Line Arrow'">open</xsl:when>
  504. <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow concave'">stealth</xsl:when>
  505. <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
  506. <xsl:when test="style:graphic-properties/@draw:marker-start='Square 45'">diamond</xsl:when>
  507. <xsl:otherwise>normal</xsl:otherwise>
  508. </xsl:choose>
  509. </图:式样>
  510. <图:大小 uof:locID="g0019">
  511. <xsl:choose>
  512. <xsl:when test="not(style:graphic-properties/@draw:marker-start-width)">4</xsl:when>
  513. <xsl:otherwise>
  514. <xsl:call-template name="graphsize">
  515. <xsl:with-param name="width" select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
  516. <xsl:with-param name="Unitofsize" select="$uofUnit"/>
  517. </xsl:call-template>
  518. </xsl:otherwise>
  519. </xsl:choose>
  520. </图:大小>
  521. </图:前端箭头>
  522. </xsl:if>
  523. <xsl:if test="style:graphic-properties/@draw:marker-end">
  524. <图:后端箭头 uof:locID="g0017">
  525. <图:式样 uof:locID="g0018">
  526. <xsl:choose>
  527. <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
  528. <xsl:when test="style:graphic-properties/@draw:marker-end='Line Arrow'">open</xsl:when>
  529. <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow concave'">stealth</xsl:when>
  530. <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
  531. <xsl:when test="style:graphic-properties/@draw:marker-end='Square 45'">diamond</xsl:when>
  532. <xsl:otherwise>normal</xsl:otherwise>
  533. </xsl:choose>
  534. </图:式样>
  535. <图:大小 uof:locID="g0022">
  536. <xsl:choose>
  537. <xsl:when test="not(style:properties/@draw:marker-start-width)">4</xsl:when>
  538. <xsl:otherwise>
  539. <xsl:variable name="width">
  540. <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit)"/>
  541. </xsl:variable>
  542. <xsl:choose>
  543. <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
  544. <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
  545. <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
  546. <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
  547. <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
  548. <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
  549. <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
  550. <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
  551. <xsl:otherwise>9</xsl:otherwise>
  552. </xsl:choose>
  553. </xsl:otherwise>
  554. </xsl:choose>
  555. </图:大小>
  556. </图:后端箭头>
  557. </xsl:if>
  558. <xsl:if test="style:graphic-properties/@draw:opacity or style:graphic-properties/@draw:transparency">
  559. <图:透明度 uof:locID="g0038">
  560. <xsl:choose>
  561. <xsl:when test="style:graphic-properties/@draw:transparency">
  562. <xsl:value-of select="substring-before(style:graphic-properties/@draw:transparency,'%')"/>
  563. </xsl:when>
  564. <xsl:when test="style:graphic-properties/@draw:opacity">
  565. <xsl:value-of select="100 - substring-before(style:graphic-properties/@draw:opacity,'%')"/>
  566. </xsl:when>
  567. </xsl:choose>
  568. </图:透明度>
  569. </xsl:if>
  570. </xsl:for-each>
  571. <xsl:choose>
  572. <xsl:when test="@svg:x1">
  573. <图:宽度 uof:locID="g0023">
  574. <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
  575. </图:宽度>
  576. <图:高度 uof:locID="g0024">
  577. <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
  578. </图:高度>
  579. </xsl:when>
  580. <xsl:when test="@svg:x">
  581. <图:宽度 uof:locID="g0023">
  582. <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
  583. </图:宽度>
  584. <图:高度 uof:locID="g0024">
  585. <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
  586. </图:高度>
  587. </xsl:when>
  588. <xsl:when test="child::draw:text-box/@fo:min-height">
  589. <图:宽度 uof:locID="g0023">
  590. <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
  591. </图:宽度>
  592. <图:高度 uof:locID="g0024">
  593. <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
  594. </图:高度>
  595. </xsl:when>
  596. <xsl:when test="@svg:width">
  597. <图:宽度 uof:locID="g0023">
  598. <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
  599. </图:宽度>
  600. <图:高度 uof:locID="g0024">
  601. <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
  602. </图:高度>
  603. </xsl:when>
  604. </xsl:choose>
  605. <图:旋转角度 uof:locID="g0025">
  606. <xsl:choose>
  607. <xsl:when test="@draw:transform">
  608. <xsl:variable name="rotate-angle">
  609. <xsl:value-of select="@draw:transform"/>
  610. </xsl:variable>
  611. <xsl:variable name="rotate-temp">
  612. <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
  613. </xsl:variable>
  614. <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
  615. </xsl:when>
  616. <xsl:otherwise>0.0</xsl:otherwise>
  617. </xsl:choose>
  618. </图:旋转角度>
  619. <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
  620. <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
  621. <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
  622. <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
  623. <图:打印对象 uof:locID="g0032">true</图:打印对象>
  624. <图:Web文字 uof:locID="g0033"/>
  625. </图:属性>
  626. </图:预定义图形>
  627. </xsl:when>
  628. <xsl:when test="name()='draw:path'">
  629. <图:svg图形对象 图:version="1.1" 图:xmlns_xlink="http://www.w3.org/1999/xlink">
  630. <xsl:attribute name="图:x"><xsl:value-of select="@svg:x"/></xsl:attribute>
  631. <xsl:attribute name="图:y"><xsl:value-of select="@svg:y"/></xsl:attribute>
  632. <xsl:attribute name="图:width"><xsl:value-of select="@svg:width"/></xsl:attribute>
  633. <xsl:attribute name="图:height"><xsl:value-of select="@svg:height"/></xsl:attribute>
  634. <xsl:attribute name="图:viewBox"><xsl:value-of select="@svg:viewBox"/></xsl:attribute>
  635. <图:path>
  636. <xsl:attribute name="图:d"><xsl:value-of select="@svg:d"/></xsl:attribute>
  637. </图:path>
  638. </图:svg图形对象>
  639. </xsl:when>
  640. </xsl:choose>
  641. <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
  642. <xsl:if test="./draw:text-box">
  643. <xsl:attribute name="图:文本框">true</xsl:attribute>
  644. <xsl:if test="./@draw:name = /office:document/office:body/office:text//draw:text-box/@draw:chain-next-name">
  645. <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$drawname]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($befor-link-name,'_',$picnumber)"/></xsl:attribute>
  646. </xsl:if>
  647. <xsl:if test="./@draw:chain-next-name">
  648. <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$next-link]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($link-name,'_',$picnumber)"/></xsl:attribute>
  649. </xsl:if>
  650. </xsl:if>
  651. <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
  652. <xsl:if test="style:text-properties/@fo:padding-left">
  653. <xsl:attribute name="图:左边距"><xsl:value-of select="style:text-properties/@fo:padding-left"/></xsl:attribute>
  654. <xsl:attribute name="图:右边距"><xsl:value-of select="style:text-properties/@fo:padding-right"/></xsl:attribute>
  655. <xsl:attribute name="图:上边距"><xsl:value-of select="style:text-properties/@fo:padding-top"/></xsl:attribute>
  656. <xsl:attribute name="图:下边距"><xsl:value-of select="style:text-properties/@fo:padding-bottom"/></xsl:attribute>
  657. </xsl:if>
  658. <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when><xsl:when test="style:paragraph-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
  659. <xsl:if test="style:text-properties/@fo:wrap-option">
  660. <xsl:attribute name="图:自动换行">true</xsl:attribute>
  661. </xsl:if>
  662. <xsl:if test="style:graphic-properties/@draw:textarea-horizontal-align">
  663. <xsl:attribute name="图:水平对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-horizontal-align"/></xsl:attribute>
  664. </xsl:if>
  665. <xsl:if test="style:graphic-properties/@draw:textarea-vertical-align">
  666. <xsl:attribute name="图:垂直对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-vertical-align"/></xsl:attribute>
  667. </xsl:if>
  668. <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">
  669. <xsl:attribute name="图:大小适应文字"><xsl:choose><xsl:when test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  670. </xsl:if>
  671. </xsl:for-each>
  672. <xsl:for-each select="text:p">
  673. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  674. <xsl:if test="style:paragraph-properties">
  675. <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
  676. <xsl:apply-templates select="style:paragraph-properties"/>
  677. </字:段落属性>
  678. </xsl:if>
  679. <xsl:call-template name="textp"/>
  680. </字:段落>
  681. </xsl:for-each>
  682. <xsl:for-each select="draw:text-box/text:p">
  683. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  684. <xsl:if test="style:paragraph-properties">
  685. <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
  686. <xsl:apply-templates select="style:paragraph-properties"/>
  687. </字:段落属性>
  688. </xsl:if>
  689. <xsl:call-template name="textp"/>
  690. </字:段落>
  691. </xsl:for-each>
  692. </图:文本内容>
  693. <xsl:if test="@svg:x and @svg:y">
  694. <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
  695. <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
  696. <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
  697. </图:控制点>
  698. </xsl:if>
  699. </图:图形>
  700. <xsl:if test="name()='draw:frame' and ./draw:image">
  701. <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
  702. <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
  703. <xsl:attribute name="uof:内嵌">true</xsl:attribute>
  704. <xsl:variable name="pic">
  705. <xsl:choose>
  706. <xsl:when test="contains(./draw:image/@xlink:href,'.png')">png</xsl:when>
  707. <xsl:when test="contains(./draw:image/@xlink:href,'.jpg')">jpg</xsl:when>
  708. <xsl:when test="contains(./draw:image/@xlink:href,'.gif')">gif</xsl:when>
  709. <xsl:when test="contains(./draw:image/@xlink:href,'.bmp')">bmp</xsl:when>
  710. <xsl:when test="contains(./draw:image/@xlink:href,'.pbm')">pbm</xsl:when>
  711. <xsl:when test="contains(./draw:image/@xlink:href,'.ras')">ras</xsl:when>
  712. <xsl:when test="contains(./draw:image/@xlink:href,'.txt')">text</xsl:when>
  713. <xsl:when test="contains(./draw:image/@xlink:href,'.xml')">xml</xsl:when>
  714. <xsl:when test="contains(./draw:image/@xlink:href,'.htm')">html</xsl:when>
  715. <xsl:when test="contains(./draw:image/@xlink:href,'.html')">html</xsl:when>
  716. <xsl:when test="contains(./draw:image/@xlink:href,'.wav')">wav</xsl:when>
  717. <xsl:when test="contains(./draw:image/@xlink:href,'.mid')">midi</xsl:when>
  718. <xsl:when test="contains(./draw:image/@xlink:href,'.ra')">ra</xsl:when>
  719. <xsl:when test="contains(./draw:image/@xlink:href,'.au')">au</xsl:when>
  720. <xsl:when test="contains(./draw:image/@xlink:href,'.mp3')">mp3</xsl:when>
  721. <xsl:when test="contains(./draw:image/@xlink:href,'.snd')">snd</xsl:when>
  722. <xsl:when test="contains(./draw:image/@xlink:href,'.svg')">svg</xsl:when>
  723. <xsl:when test="contains(./draw:image/@xlink:href,'.avi')">avi</xsl:when>
  724. <xsl:when test="contains(./draw:image/@xlink:href,'.mpeg')">mpeg4</xsl:when>
  725. <xsl:when test="contains(./draw:image/@xlink:href,'.qt')">qt</xsl:when>
  726. <xsl:when test="contains(./draw:image/@xlink:href,'.rm')">rm</xsl:when>
  727. <xsl:when test="contains(./draw:image/@xlink:href,'.asf')">asf</xsl:when>
  728. <xsl:otherwise>图片</xsl:otherwise>
  729. </xsl:choose>
  730. </xsl:variable>
  731. <xsl:choose>
  732. <xsl:when test="$pic!='图片'">
  733. <xsl:attribute name="uof:公共类型"><xsl:value-of select="$pic"/></xsl:attribute>
  734. </xsl:when>
  735. <xsl:otherwise>
  736. <xsl:attribute name="uof:私有类型">图片</xsl:attribute>
  737. </xsl:otherwise>
  738. </xsl:choose>
  739. <xsl:if test="./draw:image/office:binary-data">
  740. <uof:数据 uof:locID="u0037">
  741. <xsl:value-of select="./draw:image/office:binary-data"/>
  742. </uof:数据>
  743. </xsl:if>
  744. <xsl:if test="./draw:image/@xlink:href">
  745. <uof:路径 uof:locID="u0038">
  746. <xsl:value-of select="./draw:image/@xlink:href"/>
  747. </uof:路径>
  748. </xsl:if>
  749. </uof:其他对象>
  750. </xsl:if>
  751. <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
  752. <xsl:if test="style:text-properties/@draw:fill-image-name">
  753. <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
  754. <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'-b1')"/></xsl:attribute>
  755. <xsl:attribute name="uof:公共类型">png</xsl:attribute>
  756. <xsl:attribute name="uof:内嵌">true</xsl:attribute>
  757. <xsl:variable name="fill-name">
  758. <xsl:value-of select="style:text-properties/@draw:fill-image-name"/>
  759. </xsl:variable>
  760. <uof:数据 uof:locID="u0037">
  761. <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
  762. <xsl:value-of select="office:binary-data"/>
  763. </xsl:for-each>
  764. </uof:数据>
  765. <uof:路径 uof:locID="u0038">
  766. <xsl:value-of select="@xlink:href"/>
  767. </uof:路径>
  768. </uof:其他对象>
  769. </xsl:if>
  770. </xsl:for-each>
  771. </xsl:template>
  772. <xsl:template name="draw:points">
  773. <xsl:param name="point"/>
  774. <xsl:param name="lujing"/>
  775. <xsl:choose>
  776. <xsl:when test="contains($point,' ' )">
  777. <xsl:variable name="first-point" select="substring-before($point,' ')"/>
  778. <xsl:variable name="other-point" select="substring-after($point,' ')"/>
  779. <xsl:variable name="xzuobiao">
  780. <xsl:value-of select="substring-before($first-point,',') div 1000"/>
  781. </xsl:variable>
  782. <xsl:variable name="yzuobiao">
  783. <xsl:value-of select="substring-after($first-point,',') div 1000"/>
  784. </xsl:variable>
  785. <xsl:call-template name="draw:points">
  786. <xsl:with-param name="point" select="$other-point"/>
  787. <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
  788. </xsl:call-template>
  789. </xsl:when>
  790. <xsl:otherwise>
  791. <xsl:variable name="xzuobiao">
  792. <xsl:value-of select="substring-before($point,',') div 1000"/>
  793. </xsl:variable>
  794. <xsl:variable name="yzuobiao">
  795. <xsl:value-of select="substring-after($point,',') div 1000"/>
  796. </xsl:variable>
  797. <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
  798. </xsl:otherwise>
  799. </xsl:choose>
  800. </xsl:template>
  801. <xsl:template match="office:meta">
  802. <uof:元数据 uof:locID="u0001">
  803. <uof:标题 uof:locID="u0002">
  804. <xsl:value-of select="dc:title"/>
  805. </uof:标题>
  806. <uof:创建应用程序 uof:locID="u0011">
  807. <xsl:value-of select="meta:generator"/>
  808. </uof:创建应用程序>
  809. <uof:摘要 uof:locID="u0007">
  810. <xsl:value-of select="dc:description"/>
  811. </uof:摘要>
  812. <uof:主题 uof:locID="u0003">
  813. <xsl:value-of select="dc:subject"/>
  814. </uof:主题>
  815. <uof:创建者 uof:locID="u0004">
  816. <xsl:value-of select="meta:initial-creator"/>
  817. </uof:创建者>
  818. <!--uof:作者 uof:locID="u0005">
  819. <xsl:value-of select="meta:initial-creator"/>
  820. </uof:作者-->
  821. <uof:创建日期 uof:locID="u0008">
  822. <xsl:value-of select="meta:creation-date"/>
  823. </uof:创建日期>
  824. <uof:最后作者 uof:locID="u0006">
  825. <xsl:value-of select="dc:creator"/>
  826. </uof:最后作者>
  827. <uof:关键字集 uof:locID="u0014">
  828. <xsl:for-each select=".">
  829. <uof:关键字 uof:locID="u0015">
  830. <xsl:value-of select="meta:keywords/@meta:keyword"/>
  831. </uof:关键字>
  832. </xsl:for-each>
  833. </uof:关键字集>
  834. <uof:编辑次数 uof:locID="u0009">
  835. <xsl:value-of select="meta:editing-cycles"/>
  836. </uof:编辑次数>
  837. <xsl:if test="meta:editing-duration">
  838. <uof:编辑时间 uof:locID="u0010">
  839. <xsl:value-of select="meta:editing-duration"/>
  840. </uof:编辑时间>
  841. </xsl:if>
  842. <xsl:if test="meta:template/@xlink:href">
  843. <uof:文档模板 uof:locID="u0013">
  844. <xsl:value-of select="meta:template/@xlink:href"/>
  845. </uof:文档模板>
  846. </xsl:if>
  847. <xsl:if test="meta:user-defined/@meta:name">
  848. <uof:用户自定义元数据集 uof:locID="u0016">
  849. <xsl:for-each select="meta:user-defined">
  850. <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
  851. <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
  852. <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
  853. </uof:用户自定义元数据>
  854. </xsl:for-each>
  855. </uof:用户自定义元数据集>
  856. </xsl:if>
  857. <!--xsl:if test="meta:document-statistic/@meta:page-count"-->
  858. <uof:页数 uof:locID="u0020">
  859. <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
  860. </uof:页数>
  861. <!--/xsl:if-->
  862. <!--xsl:if test="meta:document-statistic/@meta:paragraph-count"-->
  863. <uof:段落数 uof:locID="u0025">
  864. <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
  865. </uof:段落数>
  866. <!--/xsl:if-->
  867. <!--xsl:if test="meta:document-statistic/@meta:object-count"-->
  868. <uof:对象数 uof:locID="u0026">
  869. <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
  870. </uof:对象数>
  871. <!--/xsl:if-->
  872. <!--xsl:if test="meta:document-statistic/@meta:character-count"-->
  873. <uof:字数 uof:locID="u0021">
  874. <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
  875. </uof:字数>
  876. <!--/xsl:if-->
  877. <!--xsl:if test="meta:document-statistic/@meta:word-count"-->
  878. <uof:中文字符数 uof:locID="u0023">
  879. <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
  880. </uof:中文字符数>
  881. <!--/xsl:if-->
  882. <uof:英文字符数 uof:locID="u0022">
  883. <xsl:value-of select="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count"/>
  884. </uof:英文字符数>
  885. <uof:行数 uof:locID="u0024">
  886. <xsl:variable name="quzhi">
  887. <xsl:value-of select="(meta:document-statistic/@meta:character-count div 39) + 0.9"/>
  888. </xsl:variable>
  889. <xsl:value-of select="substring-before($quzhi,'.')"/>
  890. </uof:行数>
  891. <uof:分类 uof:locID="u0012">
  892. <xsl:value-of select="meta:user-defined[@meta:name='Category']"/>
  893. </uof:分类>
  894. <uof:经理名称 uof:locID="u0019">
  895. <xsl:value-of select="meta:user-defined[meta:name='Manager']"/>
  896. </uof:经理名称>
  897. <uof:公司名称 uof:locID="u0018">
  898. <xsl:value-of select="meta:user-defined[meta:name='Company']"/>
  899. </uof:公司名称>
  900. </uof:元数据>
  901. </xsl:template>
  902. <xsl:template match="office:font-face-decls">
  903. <uof:字体集 uof:locID="u0040">
  904. <xsl:for-each select="style:font-face">
  905. <xsl:element name="uof:字体声明">
  906. <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
  907. <xsl:attribute name="uof:locID">u0041</xsl:attribute>
  908. <xsl:attribute name="uof:名称"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
  909. <xsl:attribute name="uof:标识符"><xsl:value-of select="translate(@style:name,' ','_')"/></xsl:attribute>
  910. <xsl:if test="@style:font-charset= '02'">
  911. <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
  912. </xsl:if>
  913. <xsl:if test="@style:font-family-generic">
  914. <xsl:choose>
  915. <xsl:when test="@style:font-family-generic = 'swiss'">
  916. <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
  917. </xsl:when>
  918. <xsl:when test="@style:font-family-generic ='modern'">
  919. <xsl:attribute name="uof:字体族">Modern</xsl:attribute>
  920. </xsl:when>
  921. <xsl:when test="@style:font-family-generic='roman'">
  922. <xsl:attribute name="uof:字体族">Roman</xsl:attribute>
  923. </xsl:when>
  924. <xsl:when test="@style:font-family-generic ='script'">
  925. <xsl:attribute name="uof:字体族">Script</xsl:attribute>
  926. </xsl:when>
  927. <xsl:when test="@style:font-family-generic ='decorative'">
  928. <xsl:attribute name="uof:字体族">Decorative</xsl:attribute>
  929. </xsl:when>
  930. <xsl:when test="@style:font-family-generic ='system'">
  931. <xsl:attribute name="uof:字体族">System</xsl:attribute>
  932. </xsl:when>
  933. <xsl:otherwise>
  934. <xsl:attribute name="uof:字体族">System</xsl:attribute>
  935. </xsl:otherwise>
  936. </xsl:choose>
  937. </xsl:if>
  938. </xsl:element>
  939. </xsl:for-each>
  940. <xsl:apply-templates select="style:font-decl"/>
  941. </uof:字体集>
  942. </xsl:template>
  943. <xsl:template name="自动编号集">
  944. <xsl:element name="uof:自动编号集">
  945. <xsl:attribute name="uof:locID">u0042</xsl:attribute>
  946. <xsl:for-each select="/office:document//text:list-style">
  947. <xsl:element name="字:自动编号">
  948. <xsl:attribute name="uof:locID">t0169</xsl:attribute>
  949. <xsl:attribute name="uof:attrList">标识符 名称 父编号引用 多级编号</xsl:attribute>
  950. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  951. <xsl:if test=".//@text:style-name">
  952. <xsl:attribute name="字:名称"><xsl:value-of select=".//@text:style-name"/></xsl:attribute>
  953. </xsl:if>
  954. <xsl:attribute name="字:多级编号">true</xsl:attribute>
  955. <xsl:for-each select="./* ">
  956. <xsl:if test="not(number(@text:level)=10)">
  957. <xsl:element name="字:级别">
  958. <xsl:attribute name="uof:locID">t0159</xsl:attribute>
  959. <xsl:attribute name="uof:attrList">级别值 编号对齐方式 尾随字符</xsl:attribute>
  960. <xsl:attribute name="字:级别值"><xsl:value-of select="number(@text:level) - 1"/></xsl:attribute>
  961. <xsl:if test="@style:num-suffix">
  962. <xsl:attribute name="字:尾随字符"><xsl:choose><xsl:when test="@style:num-suffix=' '">space</xsl:when><xsl:when test="@style:num-suffix=' '">tab</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  963. </xsl:if>
  964. <xsl:if test="style:list-level-properties/@fo:text-align">
  965. <xsl:attribute name="字:编号对齐方式"><xsl:variable name="vv"><xsl:value-of select="style:list-level-properties/@fo:text-align"/></xsl:variable><xsl:choose><xsl:when test="$vv='center' ">center</xsl:when><xsl:when test="$vv='end' ">right</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
  966. </xsl:if>
  967. <xsl:if test="@text:bullet-char">
  968. <xsl:element name="字:项目符号">
  969. <xsl:attribute name="uof:locID">t0171</xsl:attribute>
  970. <xsl:value-of select="@text:bullet-char"/>
  971. </xsl:element>
  972. </xsl:if>
  973. <xsl:if test="@text:style-name">
  974. <xsl:element name="字:符号字体">
  975. <xsl:attribute name="uof:locID">t0160</xsl:attribute>
  976. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  977. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  978. </xsl:element>
  979. </xsl:if>
  980. <xsl:if test="@style:num-format">
  981. <xsl:choose>
  982. <xsl:when test="string(@style:num-format)='a'">
  983. <xsl:element name="字:编号格式">
  984. <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-letter</xsl:element>
  985. </xsl:when>
  986. <xsl:when test="string(@style:num-format)='A'">
  987. <xsl:element name="字:编号格式">
  988. <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-letter</xsl:element>
  989. </xsl:when>
  990. <xsl:when test="string(@style:num-format)='i'">
  991. <xsl:element name="字:编号格式">
  992. <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-roman</xsl:element>
  993. </xsl:when>
  994. <xsl:when test="string(@style:num-format)='I'">
  995. <xsl:element name="字:编号格式">
  996. <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-roman</xsl:element>
  997. </xsl:when>
  998. <xsl:when test="string(@style:num-format)='①, ②, ③, ...'">
  999. <xsl:element name="字:编号格式">
  1000. <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal-enclosed-circle</xsl:element>
  1001. </xsl:when>
  1002. <xsl:when test="string(@style:num-format)='甲, 乙, 丙, ...'">
  1003. <xsl:element name="字:编号格式">
  1004. <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-traditional</xsl:element>
  1005. </xsl:when>
  1006. <xsl:when test="string(@style:num-format)='子, 丑, 寅, ...'">
  1007. <xsl:element name="字:编号格式">
  1008. <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-zodiac</xsl:element>
  1009. </xsl:when>
  1010. <xsl:when test="string(@style:num-format)='一, 二, 三, ...'">
  1011. <xsl:element name="字:编号格式">
  1012. <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-counting</xsl:element>
  1013. </xsl:when>
  1014. <xsl:when test="string(@style:num-format)='壹, 贰, 叁, ...'">
  1015. <xsl:element name="字:编号格式">
  1016. <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-legal-simplified</xsl:element>
  1017. </xsl:when>
  1018. <xsl:otherwise>
  1019. <xsl:element name="字:编号格式">
  1020. <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal</xsl:element>
  1021. </xsl:otherwise>
  1022. </xsl:choose>
  1023. </xsl:if>
  1024. <xsl:variable name="jibie">
  1025. <xsl:value-of select="position()"/>
  1026. </xsl:variable>
  1027. <xsl:variable name="xianshijibie">
  1028. <xsl:choose>
  1029. <xsl:when test="@text:display-levels">
  1030. <xsl:value-of select="@text:display-levels"/>
  1031. </xsl:when>
  1032. <xsl:otherwise>1</xsl:otherwise>
  1033. </xsl:choose>
  1034. </xsl:variable>
  1035. <xsl:element name="字:编号格式表示">
  1036. <xsl:attribute name="uof:locID">t0163</xsl:attribute>
  1037. <xsl:call-template name="字:编号格式表示">
  1038. <xsl:with-param name="bubianjibie" select="$jibie"/>
  1039. <xsl:with-param name="jibie" select="$jibie"/>
  1040. <xsl:with-param name="xianshijibie" select="$xianshijibie"/>
  1041. <xsl:with-param name="biaoshi" select="concat(string(@style:num-prefix),'%',$jibie,string(@style:num-suffix))"/>
  1042. </xsl:call-template>
  1043. </xsl:element>
  1044. <xsl:if test="office:binary-data">
  1045. <xsl:element name="字:图片符号引用">
  1046. <xsl:attribute name="uof:locID">t0164</xsl:attribute>
  1047. <xsl:attribute name="uof:attrList">宽度 高度</xsl:attribute>
  1048. <xsl:if test="style:list-level-properties/@fo:width">
  1049. <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:width,$uofUnit)"/></xsl:attribute>
  1050. </xsl:if>
  1051. <xsl:if test="style:list-level-properties/@fo:height">
  1052. <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:height,$uofUnit)"/></xsl:attribute>
  1053. </xsl:if>
  1054. <xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/>
  1055. </xsl:element>
  1056. </xsl:if>
  1057. <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
  1058. <xsl:element name="字:缩进">
  1059. <xsl:attribute name="uof:locID">t0165</xsl:attribute>
  1060. <xsl:for-each select="style:paragraph-properties">
  1061. <xsl:call-template name="字:缩进类型"/>
  1062. </xsl:for-each>
  1063. </xsl:element>
  1064. </xsl:if>
  1065. <xsl:if test="style:list-level-properties/@text:min-label-width">
  1066. <xsl:element name="字:制表符位置">
  1067. <xsl:attribute name="uof:locID">t0166</xsl:attribute>
  1068. <xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/>
  1069. </xsl:element>
  1070. </xsl:if>
  1071. <xsl:if test="@text:start-value">
  1072. <xsl:element name="字:起始编号">
  1073. <xsl:attribute name="uof:locID">t0167</xsl:attribute>
  1074. <xsl:value-of select="@text:start-value"/>
  1075. </xsl:element>
  1076. </xsl:if>
  1077. <xsl:if test="@text:num-regular-exp">
  1078. <xsl:element name="字:正规格式">
  1079. <xsl:attribute name="uof:locID">t0168</xsl:attribute>
  1080. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1081. <xsl:attribute name="字:值"><xsl:value-of select="@text:num-regular-exp"/></xsl:attribute>
  1082. </xsl:element>
  1083. </xsl:if>
  1084. </xsl:element>
  1085. </xsl:if>
  1086. </xsl:for-each>
  1087. </xsl:element>
  1088. </xsl:for-each>
  1089. </xsl:element>
  1090. </xsl:template>
  1091. <xsl:template name="shiyang">
  1092. <xsl:for-each select="office:styles/style:style">
  1093. <xsl:choose>
  1094. <xsl:when test="@style:family='text'">
  1095. <xsl:element name="uof:句式样">
  1096. <xsl:attribute name="uof:locID">u0043</xsl:attribute>
  1097. <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
  1098. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  1099. <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
  1100. <xsl:attribute name="字:类型">auto</xsl:attribute>
  1101. <xsl:choose>
  1102. <xsl:when test="@style:parent-style-name">
  1103. <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
  1104. </xsl:when>
  1105. <xsl:otherwise>
  1106. <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:name"/></xsl:attribute>
  1107. </xsl:otherwise>
  1108. </xsl:choose>
  1109. <xsl:call-template name="字:句属性"/>
  1110. </xsl:element>
  1111. </xsl:when>
  1112. </xsl:choose>
  1113. </xsl:for-each>
  1114. <xsl:for-each select="office:automatic-styles/style:style">
  1115. <xsl:choose>
  1116. <xsl:when test="@style:family='text'">
  1117. <xsl:element name="uof:句式样">
  1118. <xsl:attribute name="uof:locID">u0043</xsl:attribute>
  1119. <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
  1120. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  1121. <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
  1122. <xsl:attribute name="字:类型">custom</xsl:attribute>
  1123. <xsl:choose>
  1124. <xsl:when test="@style:parent-style-name">
  1125. <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
  1126. </xsl:when>
  1127. </xsl:choose>
  1128. <xsl:choose>
  1129. <xsl:when test="@style:parent-style-name and not(@style:parent-style-name='Standard')">
  1130. <xsl:variable name="stylename" select="@style:parent-style-name"/>
  1131. <xsl:for-each select="/office:document/office:styles/style:style[@style:name=$stylename]">
  1132. <xsl:call-template name="字:句属性"/>
  1133. </xsl:for-each>
  1134. </xsl:when>
  1135. <xsl:otherwise>
  1136. <xsl:call-template name="字:句属性"/>
  1137. </xsl:otherwise>
  1138. </xsl:choose>
  1139. </xsl:element>
  1140. </xsl:when>
  1141. </xsl:choose>
  1142. </xsl:for-each>
  1143. <xsl:for-each select="office:styles/style:style">
  1144. <xsl:choose>
  1145. <xsl:when test="@style:family='paragraph'">
  1146. <xsl:element name="uof:段落式样">
  1147. <xsl:attribute name="uof:locID">u0044</xsl:attribute>
  1148. <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
  1149. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  1150. <xsl:attribute name="字:类型">auto</xsl:attribute>
  1151. <xsl:if test="@style:parent-style-name">
  1152. <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
  1153. </xsl:if>
  1154. <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
  1155. <xsl:if test="@style:display-name">
  1156. <xsl:attribute name="字:别名"><xsl:value-of select="@style:display-name"/></xsl:attribute>
  1157. </xsl:if>
  1158. <xsl:element name="字:句属性">
  1159. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  1160. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  1161. <xsl:call-template name="字:句属性"/>
  1162. </xsl:element>
  1163. <xsl:call-template name="ParaAttribute"/>
  1164. </xsl:element>
  1165. </xsl:when>
  1166. </xsl:choose>
  1167. </xsl:for-each>
  1168. <xsl:for-each select="office:automatic-styles/style:style">
  1169. <xsl:choose>
  1170. <xsl:when test="@style:family='paragraph'">
  1171. <xsl:element name="uof:段落式样">
  1172. <xsl:attribute name="uof:locID">u0044</xsl:attribute>
  1173. <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
  1174. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  1175. <xsl:attribute name="字:类型">custom</xsl:attribute>
  1176. <xsl:if test="@style:parent-style-name">
  1177. <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
  1178. </xsl:if>
  1179. <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
  1180. <xsl:element name="字:句属性">
  1181. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  1182. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  1183. <xsl:call-template name="字:句属性"/>
  1184. </xsl:element>
  1185. <xsl:call-template name="ParaAttribute"/>
  1186. </xsl:element>
  1187. </xsl:when>
  1188. </xsl:choose>
  1189. </xsl:for-each>
  1190. </xsl:template>
  1191. <xsl:template name="字:编号格式表示">
  1192. <xsl:param name="bubianjibie"/>
  1193. <xsl:param name="jibie"/>
  1194. <xsl:param name="xianshijibie"/>
  1195. <xsl:param name="biaoshi"/>
  1196. <xsl:choose>
  1197. <xsl:when test="number($xianshijibie)= 1">
  1198. <xsl:value-of select="$biaoshi"/>
  1199. </xsl:when>
  1200. <xsl:otherwise>
  1201. <xsl:variable name="num-prefix">
  1202. <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-prefix"/>
  1203. </xsl:variable>
  1204. <xsl:variable name="num-suffix">
  1205. <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-suffix"/>
  1206. </xsl:variable>
  1207. <xsl:call-template name="字:编号格式表示">
  1208. <xsl:with-param name="bubianjibie" select="$bubianjibie"/>
  1209. <xsl:with-param name="jibie" select="$jibie -1"/>
  1210. <xsl:with-param name="xianshijibie" select="$xianshijibie -1"/>
  1211. <xsl:with-param name="biaoshi" select="concat($num-prefix,'%',number($jibie -1),$num-suffix,'.',$biaoshi)"/>
  1212. </xsl:call-template>
  1213. </xsl:otherwise>
  1214. </xsl:choose>
  1215. </xsl:template>
  1216. <xsl:template match="style:style[ancestor::office:automatic-styles]" mode="style">
  1217. <xsl:for-each select=".">
  1218. <xsl:choose>
  1219. <xsl:when test="@style:family='table' ">
  1220. <xsl:element name="uof:文字表式样">
  1221. <xsl:attribute name="uof:locID">u0045</xsl:attribute>
  1222. <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
  1223. <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
  1224. <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
  1225. <xsl:attribute name="字:别名"><xsl:value-of select="@style:name"/></xsl:attribute>
  1226. <xsl:attribute name="字:类型">auto</xsl:attribute>
  1227. <xsl:if test="style:table-properties">
  1228. <xsl:element name="字:宽度">
  1229. <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
  1230. <xsl:attribute name="uof:locID">t0130</xsl:attribute>
  1231. <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
  1232. </xsl:element>
  1233. <字:对齐 uof:locID="t0133">
  1234. <xsl:choose>
  1235. <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
  1236. <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
  1237. <xsl:otherwise>left</xsl:otherwise>
  1238. </xsl:choose>
  1239. </字:对齐>
  1240. </xsl:if>
  1241. </xsl:element>
  1242. </xsl:when>
  1243. <xsl:otherwise/>
  1244. </xsl:choose>
  1245. </xsl:for-each>
  1246. </xsl:template>
  1247. <xsl:template match="office:settings">
  1248. <字:文档设置 uof:locID="t0001">
  1249. <字:度量单位 uof:locID="t0006">
  1250. <xsl:value-of select="$ooUnit"/>
  1251. </字:度量单位>
  1252. <字:默认制表位位置 uof:locID="t0004">
  1253. <xsl:variable name="aa" select="substring-before(/office:document/office:styles/style:default-style[@style:family='paragraph']/style:paragraph-properties/@style:tab-stop-distance,$ooUnit)"/>
  1254. <xsl:variable name="bb" select="$aa - 0.74"/>
  1255. <xsl:value-of select="substring($bb,1,4)"/>
  1256. </字:默认制表位位置>
  1257. <字:当前视图 uof:locID="t0002">
  1258. <xsl:choose>
  1259. <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='false'">page</xsl:when>
  1260. <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='true'">web</xsl:when>
  1261. <xsl:otherwise>page</xsl:otherwise>
  1262. </xsl:choose>
  1263. </字:当前视图>
  1264. <xsl:if test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']">
  1265. <字:缩放 uof:locID="t0003">
  1266. <xsl:value-of select="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']"/>
  1267. </字:缩放>
  1268. </xsl:if>
  1269. <字:修订 uof:locID="t0005">
  1270. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1271. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="/office:document/office:body/office:text/text:tracked-changes">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1272. </字:修订>
  1273. <xsl:if test="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']">
  1274. <字:标点禁则 uof:locID="t0007">
  1275. <字:行首字符 uof:locID="t0008">
  1276. <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='BeginLine']"/>
  1277. </字:行首字符>
  1278. <字:行尾字符 uof:locID="t0009">
  1279. <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='EndLine']"/>
  1280. </字:行尾字符>
  1281. </字:标点禁则>
  1282. <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
  1283. <字:尾注位置 uof:locID="t0210" uof:attrList="位置">
  1284. <xsl:attribute name="字:位置">doc-end</xsl:attribute>
  1285. </字:尾注位置>
  1286. </xsl:if>
  1287. </xsl:if>
  1288. </字:文档设置>
  1289. </xsl:template>
  1290. <xsl:template name="style:page-layout">
  1291. <字:分节 uof:locID="t0017" uof:attrList="名称">
  1292. <xsl:attribute name="字:名称"><xsl:variable name="stylename"><xsl:value-of select="@style:name"/></xsl:variable><xsl:value-of select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$stylename]/@style:name"/></xsl:attribute>
  1293. <字:节属性 uof:locID="t0018">
  1294. <字:节类型 uof:locID="t0020">new-page</字:节类型>
  1295. <xsl:element name="字:页边距">
  1296. <xsl:attribute name="uof:locID">t0021</xsl:attribute>
  1297. <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
  1298. <xsl:attribute name="uof:上"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
  1299. <xsl:attribute name="uof:左"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
  1300. <xsl:attribute name="uof:下"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
  1301. <xsl:attribute name="uof:右"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
  1302. </xsl:element>
  1303. <xsl:element name="字:纸张">
  1304. <xsl:attribute name="uof:locID">t0022</xsl:attribute>
  1305. <xsl:attribute name="uof:attrList">纸型 宽度 高度</xsl:attribute>
  1306. <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-width,$ooUnit)"/></xsl:attribute>
  1307. <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-height,$ooUnit)"/></xsl:attribute>
  1308. <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="style:page-layout-properties/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="style:page-layout-properties/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$width='29.702cm' and $height='42cm'">A3</xsl:when><xsl:when test="$width='21.001cm' and $height='29.7cm'">A4</xsl:when><xsl:when test="$width='14.799cm' and $height='20.999cm'">A5</xsl:when><xsl:when test="$width='25cm' and $height='35.3cm'">B4</xsl:when><xsl:when test="$width='17.598cm' and $height='25cm'">B5</xsl:when><xsl:when test="$width='12.5cm' and $height='17.6cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
  1309. </xsl:element>
  1310. <xsl:if test="/office:document/office:master-styles/style:master-page/style:header-left">
  1311. <xsl:element name="字:奇偶页页眉页脚不同">
  1312. <xsl:attribute name="uof:locID">t0023</xsl:attribute>
  1313. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1314. <xsl:attribute name="字:值">true</xsl:attribute>
  1315. </xsl:element>
  1316. </xsl:if>
  1317. <xsl:element name="字:首页页眉页脚不同">
  1318. <xsl:attribute name="uof:locID">t0024</xsl:attribute>
  1319. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1320. <xsl:attribute name="字:值">false</xsl:attribute>
  1321. </xsl:element>
  1322. <xsl:if test="style:header-style/style:header-footer-properties">
  1323. <xsl:element name="字:页眉位置">
  1324. <xsl:attribute name="uof:locID">t0025</xsl:attribute>
  1325. <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
  1326. <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
  1327. <xsl:variable name="long1" select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/>
  1328. <xsl:variable name="long2" select="substring-before(style:header-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
  1329. <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
  1330. </xsl:element>
  1331. </xsl:if>
  1332. <xsl:if test="style:footer-style/style:header-footer-properties">
  1333. <xsl:element name="字:页脚位置">
  1334. <xsl:attribute name="uof:locID">t0026</xsl:attribute>
  1335. <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
  1336. <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
  1337. <xsl:variable name="long1" select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/>
  1338. <xsl:variable name="long2" select="substring-before(style:footer-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
  1339. <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
  1340. </xsl:element>
  1341. </xsl:if>
  1342. <xsl:variable name="masterPages" select="'Standard'"/>
  1343. <xsl:variable name="mp">
  1344. <xsl:value-of select="@style:name"/>
  1345. </xsl:variable>
  1346. <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
  1347. <xsl:if test="style:header-left or style:header">
  1348. <字:页眉 uof:locID="t0027">
  1349. <xsl:choose>
  1350. <xsl:when test="style:header-left">
  1351. <xsl:for-each select="style:header">
  1352. <字:首页页眉 uof:locID="t0030">
  1353. <xsl:if test="text:p">
  1354. <xsl:for-each select="text:p">
  1355. <xsl:call-template name="execParagraph">
  1356. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1357. <xsl:with-param name="liststylename" select="string('00000')"/>
  1358. </xsl:call-template>
  1359. </xsl:for-each>
  1360. </xsl:if>
  1361. <xsl:if test="table:table">
  1362. <xsl:for-each select="table:table">
  1363. <xsl:call-template name="exec_table"/>
  1364. </xsl:for-each>
  1365. </xsl:if>
  1366. </字:首页页眉>
  1367. </xsl:for-each>
  1368. <xsl:for-each select="style:header-left">
  1369. <字:偶数页页眉 uof:locID="t0029">
  1370. <xsl:if test="text:p">
  1371. <xsl:for-each select="text:p">
  1372. <xsl:call-template name="execParagraph">
  1373. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1374. <xsl:with-param name="liststylename" select="string('00000')"/>
  1375. </xsl:call-template>
  1376. </xsl:for-each>
  1377. </xsl:if>
  1378. <xsl:if test="table:table">
  1379. <xsl:for-each select="table:table">
  1380. <xsl:call-template name="exec_table"/>
  1381. </xsl:for-each>
  1382. </xsl:if>
  1383. </字:偶数页页眉>
  1384. </xsl:for-each>
  1385. </xsl:when>
  1386. <xsl:otherwise>
  1387. <xsl:for-each select="style:header">
  1388. <字:奇数页页眉 uof:locID="t0028">
  1389. <xsl:if test="text:p">
  1390. <xsl:for-each select="text:p">
  1391. <xsl:call-template name="execParagraph">
  1392. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1393. <xsl:with-param name="liststylename" select="string('00000')"/>
  1394. </xsl:call-template>
  1395. </xsl:for-each>
  1396. </xsl:if>
  1397. <xsl:if test="table:table">
  1398. <xsl:for-each select="table:table">
  1399. <xsl:call-template name="exec_table"/>
  1400. </xsl:for-each>
  1401. </xsl:if>
  1402. </字:奇数页页眉>
  1403. </xsl:for-each>
  1404. </xsl:otherwise>
  1405. </xsl:choose>
  1406. </字:页眉>
  1407. </xsl:if>
  1408. </xsl:for-each>
  1409. <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
  1410. <xsl:if test="style:footer-left or style:footer">
  1411. <字:页脚 uof:locID="t0031">
  1412. <xsl:choose>
  1413. <xsl:when test="style:footer-left">
  1414. <xsl:for-each select="style:footer">
  1415. <字:首页页脚 uof:locID="t0034">
  1416. <xsl:if test="text:p">
  1417. <xsl:for-each select="text:p">
  1418. <xsl:call-template name="execParagraph">
  1419. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1420. <xsl:with-param name="liststylename" select="string('00000')"/>
  1421. </xsl:call-template>
  1422. </xsl:for-each>
  1423. </xsl:if>
  1424. <xsl:if test="table:table">
  1425. <xsl:for-each select="table:table">
  1426. <xsl:call-template name="exec_table"/>
  1427. </xsl:for-each>
  1428. </xsl:if>
  1429. </字:首页页脚>
  1430. </xsl:for-each>
  1431. <xsl:for-each select="style:footer-left">
  1432. <字:偶数页页脚 uof:locID="t0033">
  1433. <xsl:if test="text:p">
  1434. <xsl:for-each select="text:p">
  1435. <xsl:call-template name="execParagraph">
  1436. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1437. <xsl:with-param name="liststylename" select="string('00000')"/>
  1438. </xsl:call-template>
  1439. </xsl:for-each>
  1440. </xsl:if>
  1441. <xsl:if test="table:table">
  1442. <xsl:for-each select="table:table">
  1443. <xsl:call-template name="exec_table"/>
  1444. </xsl:for-each>
  1445. </xsl:if>
  1446. </字:偶数页页脚>
  1447. </xsl:for-each>
  1448. </xsl:when>
  1449. <xsl:otherwise>
  1450. <xsl:for-each select="style:footer">
  1451. <字:奇数页页脚 uof:locID="t0032">
  1452. <xsl:if test="text:p">
  1453. <xsl:for-each select="text:p">
  1454. <xsl:call-template name="execParagraph">
  1455. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1456. <xsl:with-param name="liststylename" select="string('00000')"/>
  1457. </xsl:call-template>
  1458. </xsl:for-each>
  1459. </xsl:if>
  1460. <xsl:if test="table:table">
  1461. <xsl:for-each select="table:table">
  1462. <xsl:call-template name="exec_table"/>
  1463. </xsl:for-each>
  1464. </xsl:if>
  1465. </字:奇数页页脚>
  1466. </xsl:for-each>
  1467. </xsl:otherwise>
  1468. </xsl:choose>
  1469. </字:页脚>
  1470. </xsl:if>
  1471. </xsl:for-each>
  1472. <xsl:if test="@style:page-usage">
  1473. <字:对称页边距 uof:locID="t0036" uof:attrList="值">
  1474. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:page-usage='mirrored'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1475. </字:对称页边距>
  1476. </xsl:if>
  1477. <xsl:if test="@style:page-usage='mirrored'">
  1478. <xsl:element name="字:拼页">
  1479. <xsl:attribute name="uof:locID">t0037</xsl:attribute>
  1480. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1481. <xsl:attribute name="字:值">1</xsl:attribute>
  1482. </xsl:element>
  1483. </xsl:if>
  1484. <xsl:element name="字:纸张方向">
  1485. <xsl:attribute name="uof:locID">t0038</xsl:attribute>
  1486. <xsl:value-of select="style:page-layout-properties/@style:print-orientation"/>
  1487. </xsl:element>
  1488. <xsl:if test="style:page-layout-properties/@style:paper-tray-name">
  1489. <字:纸张来源 uof:locID="t0039" uof:attrList="首页 其他页" 字:首页="false" 字:其他页="style:page-layout-properties/@style:paper-tray-name"/>
  1490. </xsl:if>
  1491. <xsl:if test="style:page-layout-properties/@style:num-format">
  1492. <xsl:element name="字:页码设置">
  1493. <xsl:attribute name="uof:locID">t0042</xsl:attribute>
  1494. <xsl:attribute name="uof:attrList">首页显示 格式 包含章节号 章节起始样式引用 分隔符 起始编号</xsl:attribute>
  1495. <xsl:attribute name="字:首页显示">1</xsl:attribute>
  1496. <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="style:page-layout-properties/@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
  1497. <xsl:if test="style:text-properties/@style:first-page-number">
  1498. <xsl:attribute name="字:起始编号"><xsl:value-of select="style:text-properties/@style:first-page-number"/></xsl:attribute>
  1499. </xsl:if>
  1500. <xsl:attribute name="字:包含章节号">false</xsl:attribute>
  1501. <!--xsl:attribute name="字:章节起始样式引用">false</xsl:attribute-->
  1502. <xsl:attribute name="字:分隔符">hyphen</xsl:attribute>
  1503. </xsl:element>
  1504. </xsl:if>
  1505. <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
  1506. <xsl:element name="字:脚注设置">
  1507. <xsl:attribute name="uof:locID">t0040</xsl:attribute>
  1508. <xsl:attribute name="uof:attrList">位置 格式 起始编号 编号方式</xsl:attribute>
  1509. <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
  1510. <xsl:attribute name="字:位置"><xsl:choose><xsl:when test="@text:footnotes-position='page'">page-bottom</xsl:when><xsl:when test="@text:footnotes-position='document'">below-text</xsl:when></xsl:choose></xsl:attribute>
  1511. <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:start-numbering-at='document'">continuous</xsl:when><xsl:when test="@text:start-numbering-at='chapter'">section</xsl:when><xsl:when test="@text:start-numbering-at='page'">page</xsl:when></xsl:choose></xsl:attribute>
  1512. <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
  1513. <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
  1514. </xsl:for-each>
  1515. </xsl:element>
  1516. </xsl:if>
  1517. <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
  1518. <字:尾注设置 uof:locID="t0041" uof:attrList="格式 起始编号 编号方式">
  1519. <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
  1520. <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
  1521. <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
  1522. </xsl:for-each>
  1523. </字:尾注设置>
  1524. </xsl:if>
  1525. <xsl:if test="/office:document/office:styles/text:linenumbering-configuration">
  1526. <字:行号设置 uof:locID="t0043" uof:attrList="使用行号 编号方式 起始编号 距边界 行号间隔">
  1527. <xsl:for-each select="/office:document/office:styles/text:linenumbering-configuration">
  1528. <xsl:choose>
  1529. <xsl:when test="@text:number-lines='false'">
  1530. <xsl:attribute name="字:使用行号">false</xsl:attribute>
  1531. </xsl:when>
  1532. <xsl:otherwise>
  1533. <xsl:attribute name="字:使用行号">true</xsl:attribute>
  1534. <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:count-in-floating-frames='true'">section</xsl:when><xsl:when test="@text:restart-on-page='true'">page</xsl:when><xsl:when test="@text:count-empty-lines='false'"/><xsl:otherwise>continuous</xsl:otherwise></xsl:choose></xsl:attribute>
  1535. </xsl:otherwise>
  1536. </xsl:choose>
  1537. <xsl:if test="@style:num-format">
  1538. <xsl:attribute name="字:起始编号"><xsl:value-of select="@style:num-format"/></xsl:attribute>
  1539. </xsl:if>
  1540. <xsl:if test="@text:offset">
  1541. <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(@text:offset,$uofUnit)"/></xsl:attribute>
  1542. </xsl:if>
  1543. <xsl:if test="@text:increment">
  1544. <xsl:attribute name="字:行号间隔"><xsl:value-of select="@text:increment"/></xsl:attribute>
  1545. </xsl:if>
  1546. </xsl:for-each>
  1547. </字:行号设置>
  1548. </xsl:if>
  1549. <xsl:variable name="aa">
  1550. <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
  1551. </xsl:variable>
  1552. <xsl:if test="style:page-layout-properties/@style:layout-grid-display and $aa='0' ">
  1553. <字:网格设置 uof:locID="t0044" uof:attrList="网格类型 宽度 高度 显示网格 打印网格">
  1554. <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
  1555. <xsl:attribute name="字:网格类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both-nosnap'">line-char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">line</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='none'">none</xsl:when></xsl:choose></xsl:attribute>
  1556. </xsl:if>
  1557. <xsl:if test="style:page-layout-properties/@style:layout-grid-base-width">
  1558. <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/></xsl:attribute>
  1559. </xsl:if>
  1560. <xsl:if test="style:page-layout-properties/@style:layout-grid-base-height">
  1561. <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/></xsl:attribute>
  1562. </xsl:if>
  1563. <xsl:if test="style:page-layout-properties/@style:layout-grid-display">
  1564. <xsl:attribute name="字:显示网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-display='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1565. </xsl:if>
  1566. <xsl:if test="style:page-layout-properties/@style:layout-grid-print">
  1567. <xsl:attribute name="字:打印网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-print='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1568. </xsl:if>
  1569. </字:网格设置>
  1570. </xsl:if>
  1571. <xsl:if test="style:page-layout-properties/@style:layout-grid-display and not($aa = '0')">
  1572. <字:稿纸设置 uof:locID="t0211" uof:attrList="类型 格式 线型 颜色 方向">
  1573. <xsl:variable name="mode">
  1574. <xsl:value-of select="style:page-layout-properties/@style:layout-grid-mode"/>
  1575. </xsl:variable>
  1576. <xsl:variable name="ruby">
  1577. <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
  1578. </xsl:variable>
  1579. <xsl:variable name="width">
  1580. <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/>
  1581. </xsl:variable>
  1582. <xsl:variable name="height">
  1583. <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/>
  1584. </xsl:variable>
  1585. <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">letter-paper</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">draft-paper</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  1586. <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
  1587. <xsl:attribute name="字:格式"><xsl:choose><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.496' ">fourth-gear</xsl:when><xsl:when test="$mode='both' and $width='0.584' and $height='0.584' and $ruby='0.64' ">third-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.905' ">second-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='1.633' ">first-gear</xsl:when></xsl:choose></xsl:attribute>
  1588. </xsl:if>
  1589. <xsl:if test="style:page-layout-properties/@style:layout-grid-color">
  1590. <xsl:attribute name="字:颜色"><xsl:value-of select="style:page-layout-properties/@style:layout-grid-color"/></xsl:attribute>
  1591. </xsl:if>
  1592. </字:稿纸设置>
  1593. </xsl:if>
  1594. <xsl:if test="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@style:writing-mode='lr-tb' or style:text-properties/@style:writing-mode='rl-tb'">
  1595. <字:垂直对齐方式 uof:locID="t0045">
  1596. <xsl:variable name="path" select="/office:document/office:automatic-styles/style:style/style:paragraph-properties"/>
  1597. <xsl:choose>
  1598. <xsl:when test="$path/@fo:text-align='start'">top</xsl:when>
  1599. <xsl:when test="$path/@fo:text-align='end'">bottom</xsl:when>
  1600. <xsl:when test="$path/@fo:text-align='center'">center</xsl:when>
  1601. <xsl:otherwise>justified</xsl:otherwise>
  1602. </xsl:choose>
  1603. </字:垂直对齐方式>
  1604. </xsl:if>
  1605. <字:文字排列方向 uof:locID="t0046">
  1606. <xsl:variable name="writing_mode">
  1607. <xsl:value-of select="style:page-layout-properties/@style:writing-mode"/>
  1608. </xsl:variable>
  1609. <xsl:choose>
  1610. <xsl:when test="$writing_mode='lr-tb' or $writing_mode='lr'">hori-l2r</xsl:when>
  1611. <xsl:when test="$writing_mode='rl-tb' or $writing_mode='rl'">hori-r2l</xsl:when>
  1612. <xsl:when test="$writing_mode='tb-rl'">vert-r2l</xsl:when>
  1613. <xsl:when test="$writing_mode='tb-lr'">vert-l2r</xsl:when>
  1614. <xsl:otherwise>hori-l2r</xsl:otherwise>
  1615. </xsl:choose>
  1616. </字:文字排列方向>
  1617. <xsl:if test="style:page-layout-properties/@fo:border or style:page-layout-properties/@fo:border-top or style:page-layout-properties/@fo:border-bottom or style:page-layout-properties/@fo:border-left or style:page-layout-properties/@fo:border-right or style:page-layout-properties/@style:shadow[.!='none']">
  1618. <xsl:element name="字:边框">
  1619. <xsl:attribute name="uof:locID">t0047</xsl:attribute>
  1620. <xsl:for-each select="style:page-layout-properties">
  1621. <xsl:call-template name="uof:边框"/>
  1622. </xsl:for-each>
  1623. </xsl:element>
  1624. </xsl:if>
  1625. <xsl:if test="style:page-layout-properties/@fo:background-color">
  1626. <xsl:element name="字:填充">
  1627. <xsl:attribute name="uof:locID">t0048</xsl:attribute>
  1628. <xsl:for-each select="style:page-layout-properties">
  1629. <xsl:call-template name="图:填充"/>
  1630. </xsl:for-each>
  1631. </xsl:element>
  1632. </xsl:if>
  1633. <xsl:if test="style:page-layout-properties/style:columns">
  1634. <xsl:element name="字:分栏">
  1635. <xsl:attribute name="uof:locID">t0049</xsl:attribute>
  1636. <xsl:attribute name="uof:attrList">栏数 等宽 分隔线 分隔线宽度 分隔线颜色</xsl:attribute>
  1637. <xsl:if test="//@fo:column-count">
  1638. <xsl:attribute name="字:栏数"><xsl:choose><xsl:when test="//@fo:column-count='0'">1</xsl:when><xsl:otherwise><xsl:value-of select="//@fo:column-count"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1639. </xsl:if>
  1640. <xsl:variable name="第一宽度">
  1641. <xsl:value-of select="style:page-layout-properties/style:columns/style:column/@style:rel-width"/>
  1642. </xsl:variable>
  1643. <xsl:variable name="dkm">
  1644. <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
  1645. <xsl:if test="$第一宽度 != @style:rel-width">
  1646. <xsl:value-of select="boolean($第一宽度 = @style:rel-width)"/>
  1647. </xsl:if>
  1648. </xsl:for-each>
  1649. </xsl:variable>
  1650. <xsl:choose>
  1651. <xsl:when test="style:page-layout-properties/style:columns/@fo:column-gap">
  1652. <xsl:attribute name="字:等宽">true</xsl:attribute>
  1653. </xsl:when>
  1654. <xsl:otherwise>
  1655. <xsl:attribute name="字:等宽">false</xsl:attribute>
  1656. </xsl:otherwise>
  1657. </xsl:choose>
  1658. <xsl:if test="style:page-layout-properties/style:columns/style:column-sep">
  1659. <xsl:attribute name="字:分隔线宽度"><xsl:value-of select="substring-before(style:page-layout-properties/style:columns/style:column-sep/@style:width,$ooUnit)"/></xsl:attribute>
  1660. <xsl:attribute name="字:分隔线颜色"><xsl:value-of select="style:page-layout-properties/style:columns/style:column-sep/@style:color"/></xsl:attribute>
  1661. <xsl:attribute name="字:分隔线">single</xsl:attribute>
  1662. </xsl:if>
  1663. <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
  1664. <xsl:element name="字:栏">
  1665. <xsl:variable name="left">
  1666. <xsl:value-of select="substring-before(@fo:start-indent,$uofUnit)"/>
  1667. </xsl:variable>
  1668. <xsl:variable name="right">
  1669. <xsl:value-of select="substring-before(@fo:end-indent,$uofUnit)"/>
  1670. </xsl:variable>
  1671. <xsl:if test="@style:rel-width">
  1672. <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(@style:rel-width,'*')"/></xsl:attribute>
  1673. </xsl:if>
  1674. <xsl:if test="@fo:start-indent or @fo:end-indent">
  1675. <xsl:choose>
  1676. <xsl:when test="parent::style:columns/@fo:column-gap">
  1677. <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="$left - $right &gt;0 "><xsl:value-of select="$left - $right"/></xsl:when><xsl:when test="$right - $left &gt; 0 "><xsl:value-of select="$right - $left"/></xsl:when><xsl:otherwise><xsl:value-of select="$right"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1678. </xsl:when>
  1679. <xsl:otherwise>
  1680. <xsl:attribute name="字:间距"><xsl:value-of select="$right"/></xsl:attribute>
  1681. </xsl:otherwise>
  1682. </xsl:choose>
  1683. </xsl:if>
  1684. <xsl:attribute name="uof:locID">t0050</xsl:attribute>
  1685. <xsl:attribute name="uof:attrList">宽度 间距</xsl:attribute>
  1686. </xsl:element>
  1687. </xsl:for-each>
  1688. </xsl:element>
  1689. </xsl:if>
  1690. </字:节属性>
  1691. </字:分节>
  1692. </xsl:template>
  1693. <xsl:template match="office:text">
  1694. <xsl:for-each select="node( )">
  1695. <xsl:choose>
  1696. <xsl:when test="name()='text:list'or name()='text:ordered-list'">
  1697. <xsl:call-template name="unordered-ordered-list">
  1698. <xsl:with-param name="currlistlvl" select="number('1')"/>
  1699. <xsl:with-param name="liststylename" select="@text:style-name"/>
  1700. </xsl:call-template>
  1701. </xsl:when>
  1702. <xsl:when test="name()='text:p'or name()='text:h'">
  1703. <xsl:variable name="bs" select="./@text:style-name"/>
  1704. <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name">
  1705. <xsl:variable name="bs1" select="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name"/>
  1706. <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name">
  1707. <xsl:variable name="bs2" select="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name"/>
  1708. <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$bs2]">
  1709. <xsl:call-template name="style:page-layout"/>
  1710. </xsl:for-each>
  1711. </xsl:if>
  1712. </xsl:if>
  1713. <xsl:call-template name="execParagraph">
  1714. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1715. <xsl:with-param name="liststylename" select="string('00000')"/>
  1716. </xsl:call-template>
  1717. </xsl:when>
  1718. <xsl:when test="name()='table:table'">
  1719. <xsl:variable name="tbs" select="./@table:style-name"/>
  1720. <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name">
  1721. <xsl:variable name="tbs1" select="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name"/>
  1722. <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name">
  1723. <xsl:variable name="tbs2" select="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name"/>
  1724. <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$tbs2]">
  1725. <xsl:call-template name="style:page-layout"/>
  1726. </xsl:for-each>
  1727. </xsl:if>
  1728. </xsl:if>
  1729. <xsl:call-template name="exec_table"/>
  1730. </xsl:when>
  1731. <xsl:when test="name()='text:table-of-content'">
  1732. <xsl:call-template name="text:table-of-content"/>
  1733. </xsl:when>
  1734. <xsl:when test="name()='text:alphabetical-index'">
  1735. <xsl:call-template name="text:alphabetical-index"/>
  1736. </xsl:when>
  1737. </xsl:choose>
  1738. </xsl:for-each>
  1739. </xsl:template>
  1740. <xsl:template name="jiaozhu">
  1741. <字:脚注 uof:locID="t0107" uof:attrList="引文体">
  1742. <xsl:for-each select="text:note-citation">
  1743. <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
  1744. </xsl:for-each>
  1745. <xsl:for-each select="text:note-body/text:p">
  1746. <xsl:call-template name="execParagraph">
  1747. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1748. <xsl:with-param name="liststylename" select="string('00000')"/>
  1749. </xsl:call-template>
  1750. </xsl:for-each>
  1751. </字:脚注>
  1752. </xsl:template>
  1753. <xsl:template name="weizhu">
  1754. <字:尾注 uof:locID="t0108" uof:attrList="引文体">
  1755. <xsl:for-each select="text:note-citation">
  1756. <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
  1757. </xsl:for-each>
  1758. <xsl:for-each select="text:note-body/text:p">
  1759. <xsl:call-template name="execParagraph">
  1760. <xsl:with-param name="currlistlvl" select="number('0')"/>
  1761. <xsl:with-param name="liststylename" select="string('00000')"/>
  1762. </xsl:call-template>
  1763. </xsl:for-each>
  1764. </字:尾注>
  1765. </xsl:template>
  1766. <xsl:template name="unordered-ordered-list">
  1767. <xsl:param name="currlistlvl"/>
  1768. <xsl:param name="liststylename"/>
  1769. <xsl:for-each select="text:list-item">
  1770. <xsl:if test="text:p">
  1771. <xsl:for-each select="text:p">
  1772. <xsl:call-template name="execParagraph">
  1773. <xsl:with-param name="currlistlvl" select="$currlistlvl"/>
  1774. <xsl:with-param name="liststylename" select="$liststylename"/>
  1775. </xsl:call-template>
  1776. </xsl:for-each>
  1777. </xsl:if>
  1778. <xsl:for-each select="node( )">
  1779. <xsl:if test="name()='text:list'">
  1780. <xsl:call-template name="unordered-ordered-list">
  1781. <xsl:with-param name="currlistlvl" select="$currlistlvl +1"/>
  1782. <xsl:with-param name="liststylename" select="$liststylename"/>
  1783. </xsl:call-template>
  1784. </xsl:if>
  1785. </xsl:for-each>
  1786. </xsl:for-each>
  1787. </xsl:template>
  1788. <xsl:template name="execParagraph">
  1789. <xsl:param name="currlistlvl"/>
  1790. <xsl:param name="liststylename"/>
  1791. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  1792. <xsl:element name="字:段落属性">
  1793. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  1794. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  1795. <xsl:if test="@text:style-name">
  1796. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  1797. </xsl:if>
  1798. <xsl:if test="not(number($currlistlvl) =number('0'))">
  1799. <xsl:variable name="parent-position">
  1800. <xsl:number from="/office:document/office:body/office:text/text:list" level="any" count="text:list-item/text:p" format="1"/>
  1801. </xsl:variable>
  1802. <xsl:element name="字:自动编号信息">
  1803. <xsl:attribute name="uof:locID">t0059</xsl:attribute>
  1804. <xsl:attribute name="uof:attrList">编号引用 编号级别 重新编号 起始编号</xsl:attribute>
  1805. <xsl:attribute name="字:编号引用"><xsl:value-of select="$liststylename"/></xsl:attribute>
  1806. <xsl:attribute name="字:编号级别"><xsl:value-of select="$currlistlvl - 1"/></xsl:attribute>
  1807. <xsl:attribute name="字:重新编号"><xsl:choose><xsl:when test="number($parent-position)=number('1')">1</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1808. <xsl:attribute name="字:起始编号"><xsl:for-each select="/office:document//text:list-style[$liststylename=@style:name]/*[number($currlistlvl)=number(@text:level)]"><xsl:choose><xsl:when test="@text:start-value"><xsl:value-of select="@text:start-value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:for-each></xsl:attribute>
  1809. </xsl:element>
  1810. </xsl:if>
  1811. <xsl:variable name="stylename">
  1812. <xsl:value-of select="@text:style-name"/>
  1813. </xsl:variable>
  1814. <xsl:for-each select="/office:document//style:style">
  1815. <xsl:if test="@style:name=$stylename">
  1816. <xsl:element name="字:句属性">
  1817. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  1818. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  1819. <xsl:attribute name="字:式样引用"><xsl:value-of select="$stylename"/></xsl:attribute>
  1820. <xsl:call-template name="字:句属性"/>
  1821. </xsl:element>
  1822. <xsl:call-template name="ParaAttribute">
  1823. <xsl:with-param name="text-style-name" select="@style:name"/>
  1824. </xsl:call-template>
  1825. </xsl:if>
  1826. </xsl:for-each>
  1827. </xsl:element>
  1828. <xsl:call-template name="textp"/>
  1829. <xsl:if test="parent::office:text and not(preceding-sibling::text:p) and preceding-sibling::*[substring-before(name(),':')='draw']">
  1830. <xsl:for-each select="preceding-sibling::*[substring-before(name(),':')='draw']">
  1831. <字:句 uof:locID="t0085">
  1832. <xsl:call-template name="字:锚点"/>
  1833. </字:句>
  1834. </xsl:for-each>
  1835. </xsl:if>
  1836. <xsl:if test="draw:frame/draw:text-box/text:p">
  1837. <xsl:for-each select="draw:frame/draw:text-box/text:p">
  1838. <xsl:for-each select="child::*[substring-before(name(),':')='draw']">
  1839. <字:句 uof:locID="t0085">
  1840. <xsl:call-template name="字:锚点"/>
  1841. </字:句>
  1842. </xsl:for-each>
  1843. </xsl:for-each>
  1844. </xsl:if>
  1845. <xsl:variable name="aa">
  1846. <xsl:value-of select="@text:style-name"/>
  1847. </xsl:variable>
  1848. <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='column'">
  1849. <字:句 uof:locID="t0085">
  1850. <xsl:element name="字:分栏符">
  1851. <xsl:attribute name="uof:locID">t0125</xsl:attribute>
  1852. </xsl:element>
  1853. </字:句>
  1854. </xsl:if>
  1855. <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='page'">
  1856. <字:句 uof:locID="t0085">
  1857. <xsl:element name="字:分页符">
  1858. <xsl:attribute name="uof:locID">t0127</xsl:attribute>
  1859. </xsl:element>
  1860. </字:句>
  1861. </xsl:if>
  1862. <xsl:if test="/office:document/office:body/office:text/text:p/text:initial-creator">
  1863. <xsl:apply-templates select="text:initial-creator"/>
  1864. </xsl:if>
  1865. <xsl:if test="/office:document/office:body/office:text/text:p/text:title">
  1866. <xsl:apply-templates select="text:title"/>
  1867. </xsl:if>
  1868. <xsl:if test="/office:document/office:body/office:text/text:p/text:subject">
  1869. <xsl:apply-templates select="text:subject"/>
  1870. </xsl:if>
  1871. <xsl:if test="/office:document/office:body/office:text/text:p/text:file-name">
  1872. <xsl:apply-templates select="text:file-name"/>
  1873. </xsl:if>
  1874. <xsl:if test="/office:document/office:body/office:text/text:p/text:author-name">
  1875. <xsl:apply-templates select="text:author-name"/>
  1876. </xsl:if>
  1877. <xsl:if test="/office:document/office:body/office:text/text:p/text:author-initials">
  1878. <xsl:apply-templates select="text:author-initials"/>
  1879. </xsl:if>
  1880. <xsl:if test="/office:document/office:body/office:text/text:p/text:span/text:date">
  1881. <xsl:apply-templates select="text:date"/>
  1882. </xsl:if>
  1883. </字:段落>
  1884. </xsl:template>
  1885. <xsl:template name="ParaAttribute">
  1886. <xsl:param name="text-style-name"/>
  1887. <xsl:if test="substring-after(@style:display-name,'Heading')">
  1888. <xsl:element name="字:大纲级别">
  1889. <xsl:attribute name="uof:locID">t0054</xsl:attribute>
  1890. <xsl:value-of select="substring-after(@style:display-name,'Heading ')"/>
  1891. </xsl:element>
  1892. </xsl:if>
  1893. <xsl:if test="style:paragraph-properties/@fo:text-align or style:paragraph-properties/@style:vertical-align">
  1894. <xsl:element name="字:对齐">
  1895. <xsl:attribute name="uof:locID">t0055</xsl:attribute>
  1896. <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
  1897. <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:text-align='end'">right</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='center'">center</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and not(style:paragraph-properties/@fo:text-align-last='justify')">justified</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and style:paragraph-properties/@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
  1898. <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@style:vertical-align='baseline'">base</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='top'">top</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='middle'">center</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
  1899. </xsl:element>
  1900. </xsl:if>
  1901. <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
  1902. <xsl:element name="字:缩进">
  1903. <xsl:attribute name="uof:locID">t0056</xsl:attribute>
  1904. <xsl:for-each select="style:paragraph-properties">
  1905. <xsl:call-template name="字:缩进类型"/>
  1906. </xsl:for-each>
  1907. </xsl:element>
  1908. </xsl:if>
  1909. <xsl:element name="字:行距">
  1910. <xsl:attribute name="uof:locID">t0057</xsl:attribute>
  1911. <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
  1912. <xsl:choose>
  1913. <xsl:when test="contains(style:paragraph-properties/@fo:line-height,$ooUnit)">
  1914. <xsl:attribute name="字:类型">fixed</xsl:attribute>
  1915. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,$ooUnit)"/></xsl:attribute>
  1916. </xsl:when>
  1917. <xsl:when test="contains(style:paragraph-properties/@fo:line-height,'%')">
  1918. <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
  1919. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,'%') div 100"/></xsl:attribute>
  1920. </xsl:when>
  1921. <xsl:when test="style:paragraph-properties/@style:line-height-at-least">
  1922. <xsl:attribute name="字:类型">at-least</xsl:attribute>
  1923. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-height-at-least,$ooUnit)"/></xsl:attribute>
  1924. </xsl:when>
  1925. <xsl:when test="style:paragraph-properties/@style:line-spacing">
  1926. <xsl:attribute name="字:类型">line-space</xsl:attribute>
  1927. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-spacing,$ooUnit)"/></xsl:attribute>
  1928. </xsl:when>
  1929. <xsl:otherwise>
  1930. <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
  1931. <xsl:attribute name="字:值">1.0</xsl:attribute>
  1932. </xsl:otherwise>
  1933. </xsl:choose>
  1934. </xsl:element>
  1935. <xsl:if test="style:paragraph-properties/@fo:widows">
  1936. <xsl:element name="字:孤行控制">
  1937. <xsl:attribute name="uof:locID">t0060</xsl:attribute>
  1938. <xsl:value-of select="style:paragraph-properties/@fo:widows"/>
  1939. </xsl:element>
  1940. </xsl:if>
  1941. <xsl:if test="style:paragraph-properties/@fo:orphans">
  1942. <xsl:element name="字:寡行控制">
  1943. <xsl:attribute name="uof:locID">t0061</xsl:attribute>
  1944. <xsl:value-of select="style:paragraph-properties/@fo:orphans"/>
  1945. </xsl:element>
  1946. </xsl:if>
  1947. <xsl:element name="字:段中不分页">
  1948. <xsl:attribute name="uof:locID">t0062</xsl:attribute>
  1949. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1950. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:keep-together='always'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1951. </xsl:element>
  1952. <xsl:if test="style:paragraph-properties/@fo:keep-with-next">
  1953. <xsl:element name="字:与下段同页">
  1954. <xsl:attribute name="uof:locID">t0063</xsl:attribute>
  1955. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1956. <xsl:attribute name="字:值">true</xsl:attribute>
  1957. </xsl:element>
  1958. </xsl:if>
  1959. <xsl:if test="style:paragraph-properties/@fo:break-before">
  1960. <xsl:element name="字:段前分页">
  1961. <xsl:attribute name="uof:locID">t0064</xsl:attribute>
  1962. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1963. <xsl:attribute name="字:值">true</xsl:attribute>
  1964. </xsl:element>
  1965. </xsl:if>
  1966. <xsl:if test="style:paragraph-properties/@style:snap-to-layout-grid">
  1967. <xsl:element name="字:对齐网格">
  1968. <xsl:attribute name="uof:locID">t0069</xsl:attribute>
  1969. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1970. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:snap-to-layout-grid='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1971. </xsl:element>
  1972. </xsl:if>
  1973. <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
  1974. <xsl:element name="字:首字下沉">
  1975. <xsl:attribute name="uof:locID">t0070</xsl:attribute>
  1976. <xsl:attribute name="uof:attrList">类型 字体引用 字符数 行数 间距</xsl:attribute>
  1977. <xsl:attribute name="字:类型">dropped</xsl:attribute>
  1978. <xsl:if test="style:paragraph-properties/style:drop-cap/@style:style-name">
  1979. <xsl:attribute name="字:字体引用"><xsl:value-of select="translate(style:paragraph-properties/style:drop-cap/@style:style-name,' ','_')"/></xsl:attribute>
  1980. </xsl:if>
  1981. <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="style:paragraph-properties/style:drop-cap/@style:distance"><xsl:value-of select="substring-before(style:paragraph-properties/style:drop-cap/@style:distance,$ooUnit)"/></xsl:when><xsl:otherwise>0.00</xsl:otherwise></xsl:choose></xsl:attribute>
  1982. <xsl:if test="style:paragraph-properties/style:drop-cap/@style:length">
  1983. <xsl:attribute name="字:字符数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:length"/></xsl:attribute>
  1984. </xsl:if>
  1985. <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
  1986. <xsl:attribute name="字:行数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:lines"/></xsl:attribute>
  1987. </xsl:if>
  1988. </xsl:element>
  1989. </xsl:if>
  1990. <xsl:element name="字:取消断字">
  1991. <xsl:attribute name="uof:locID">t0071</xsl:attribute>
  1992. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1993. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:hyphenate"><xsl:value-of select="style:paragraph-properties/@fo:hyphenate"/></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  1994. </xsl:element>
  1995. <xsl:element name="字:取消行号">
  1996. <xsl:attribute name="uof:locID">t0072</xsl:attribute>
  1997. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  1998. <xsl:variable name="aa">
  1999. <xsl:value-of select="style:paragraph-properties/@text:number-lines"/>
  2000. </xsl:variable>
  2001. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$aa='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  2002. </xsl:element>
  2003. <xsl:element name="字:允许单词断字">
  2004. <xsl:attribute name="字:值">true</xsl:attribute>
  2005. <xsl:attribute name="uof:locID">t0073</xsl:attribute>
  2006. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2007. </xsl:element>
  2008. <xsl:if test="style:paragraph-properties/@style:punctuation-wrap">
  2009. <xsl:element name="字:行首尾标点控制">
  2010. <xsl:attribute name="uof:locID">t0074</xsl:attribute>
  2011. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2012. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:punctuation-wrap='hanging'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2013. </xsl:element>
  2014. </xsl:if>
  2015. <xsl:element name="字:是否行首标点压缩">
  2016. <xsl:attribute name="uof:locID">t0075</xsl:attribute>
  2017. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2018. <xsl:attribute name="字:值">false</xsl:attribute>
  2019. </xsl:element>
  2020. <xsl:if test="style:paragraph-properties/@style:line-break ">
  2021. <xsl:element name="字:中文习惯首尾字符">
  2022. <xsl:attribute name="uof:locID">t0076</xsl:attribute>
  2023. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2024. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:line-break='strict'">true</xsl:when><xsl:when test="style:paragraph-properties/@style:line-break='normal'">false</xsl:when></xsl:choose></xsl:attribute>
  2025. </xsl:element>
  2026. </xsl:if>
  2027. <xsl:if test="style:paragraph-properties/@style:text-autospace">
  2028. <xsl:element name="字:自动调整中英文字符间距">
  2029. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2030. <xsl:attribute name="uof:locID">t0077</xsl:attribute>
  2031. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2032. </xsl:element>
  2033. </xsl:if>
  2034. <xsl:if test="style:paragraph-properties/@style:text-autospace">
  2035. <xsl:element name="字:自动调整中文与数字间距">
  2036. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true </xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2037. <xsl:attribute name="uof:locID">t0078</xsl:attribute>
  2038. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2039. </xsl:element>
  2040. </xsl:if>
  2041. <xsl:element name="字:有网格自动调整右缩进">
  2042. <xsl:attribute name="字:值">false</xsl:attribute>
  2043. <xsl:attribute name="uof:locID">t0195</xsl:attribute>
  2044. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2045. </xsl:element>
  2046. <xsl:if test="style:paragraph-properties/@fo:border or style:paragraph-properties/@fo:border-top or style:paragraph-properties/@fo:border-bottom or style:paragraph-properties/@fo:border-left or style:paragraph-properties/@fo:border-right or style:paragraph-properties/@style:shadow[.!='none']">
  2047. <xsl:element name="字:边框">
  2048. <xsl:attribute name="uof:locID">t0065</xsl:attribute>
  2049. <xsl:for-each select="style:paragraph-properties">
  2050. <xsl:call-template name="uof:边框"/>
  2051. </xsl:for-each>
  2052. </xsl:element>
  2053. </xsl:if>
  2054. <xsl:if test="style:paragraph-properties/@fo:background-color">
  2055. <xsl:element name="字:填充">
  2056. <xsl:attribute name="uof:locID">t0066</xsl:attribute>
  2057. <xsl:for-each select="style:paragraph-properties">
  2058. <xsl:call-template name="图:填充"/>
  2059. </xsl:for-each>
  2060. </xsl:element>
  2061. </xsl:if>
  2062. <xsl:if test="style:paragraph-properties/@fo:margin-top or style:paragraph-properties/@fo:margin-bottom">
  2063. <字:段间距 uof:locID="t0058">
  2064. <xsl:if test="style:paragraph-properties/@fo:margin-top">
  2065. <字:段前距 uof:locID="t0196">
  2066. <字:绝对值 uof:locID="t0199" uof:attrList="值">
  2067. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
  2068. </字:绝对值>
  2069. </字:段前距>
  2070. </xsl:if>
  2071. <xsl:if test="style:paragraph-properties/@fo:margin-bottom">
  2072. <字:段后距 uof:locID="t0197">
  2073. <字:绝对值 uof:locID="t0202" uof:attrList="值">
  2074. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
  2075. </字:绝对值>
  2076. </字:段后距>
  2077. </xsl:if>
  2078. </字:段间距>
  2079. </xsl:if>
  2080. <xsl:if test="style:paragraph-properties/style:tab-stops">
  2081. <xsl:element name="字:制表位设置">
  2082. <xsl:attribute name="uof:locID">t0067</xsl:attribute>
  2083. <xsl:for-each select="style:paragraph-properties/style:tab-stops/style:tab-stop">
  2084. <xsl:element name="字:制表位">
  2085. <xsl:attribute name="uof:locID">t0068</xsl:attribute>
  2086. <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
  2087. <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(@style:position,$ooUnit)"/></xsl:attribute>
  2088. <xsl:variable name="aa">
  2089. <xsl:value-of select="@style:type"/>
  2090. </xsl:variable>
  2091. <xsl:variable name="zbflx">
  2092. <xsl:choose>
  2093. <xsl:when test="$aa='right'">right</xsl:when>
  2094. <xsl:when test="$aa='center'">center</xsl:when>
  2095. <xsl:when test="$aa='char'and @style:char!=''">decimal</xsl:when>
  2096. <xsl:otherwise>left</xsl:otherwise>
  2097. </xsl:choose>
  2098. </xsl:variable>
  2099. <xsl:attribute name="字:类型"><xsl:value-of select="$zbflx"/></xsl:attribute>
  2100. <xsl:attribute name="字:制表位字符"><xsl:value-of select="@style:leader-text"/></xsl:attribute>
  2101. <xsl:if test="@style:leader-style">
  2102. <xsl:attribute name="字:前导符"><xsl:value-of select="@style:leader-style"/></xsl:attribute>
  2103. </xsl:if>
  2104. </xsl:element>
  2105. </xsl:for-each>
  2106. </xsl:element>
  2107. </xsl:if>
  2108. </xsl:template>
  2109. <xsl:template match="text:s">
  2110. <xsl:param name="bText"/>
  2111. <xsl:choose>
  2112. <xsl:when test="$bText='0'">
  2113. <xsl:variable name="count">
  2114. <xsl:choose>
  2115. <xsl:when test="not(@text:c)">1</xsl:when>
  2116. <xsl:otherwise>
  2117. <xsl:value-of select="@text:c"/>
  2118. </xsl:otherwise>
  2119. </xsl:choose>
  2120. </xsl:variable>
  2121. <字:句 uof:locID="t0085">
  2122. <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
  2123. </字:句>
  2124. </xsl:when>
  2125. <xsl:otherwise>
  2126. <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
  2127. </xsl:otherwise>
  2128. </xsl:choose>
  2129. </xsl:template>
  2130. <xsl:template name="textp" match="text:p">
  2131. <xsl:variable name="parentstyle">
  2132. <xsl:value-of select="@text:style-name"/>
  2133. </xsl:variable>
  2134. <xsl:for-each select="node( )">
  2135. <xsl:choose>
  2136. <xsl:when test="self::node()[name(.)='text:span']">
  2137. <xsl:call-template name="textspan"/>
  2138. </xsl:when>
  2139. <xsl:when test="self::node()[name(.)='text:sequence']">
  2140. <xsl:apply-templates select="."/>
  2141. </xsl:when>
  2142. <xsl:when test="self::node()/draw:text-box/text:p/text:sequence">
  2143. <xsl:for-each select="draw:text-box/text:p/node()">
  2144. <xsl:choose>
  2145. <xsl:when test="self::node()[name(.)='text:sequence']">
  2146. <xsl:apply-templates select="."/>
  2147. </xsl:when>
  2148. <xsl:when test="not(self::node()[substring-before(name(.),':')='draw'])">
  2149. <xsl:call-template name="字:句">
  2150. <xsl:with-param name="parentstyle" select="$parentstyle"/>
  2151. </xsl:call-template>
  2152. </xsl:when>
  2153. </xsl:choose>
  2154. </xsl:for-each>
  2155. </xsl:when>
  2156. <xsl:when test="self::node()[name(.)='text:date']">
  2157. <xsl:apply-templates select="."/>
  2158. </xsl:when>
  2159. <xsl:when test="self::node()[name(.)='text:time']">
  2160. <xsl:apply-templates select="."/>
  2161. </xsl:when>
  2162. <xsl:when test="self::node()[name(.)='text:s']">
  2163. <xsl:apply-templates select=".">
  2164. <xsl:with-param name="bText" select="0"/>
  2165. </xsl:apply-templates>
  2166. </xsl:when>
  2167. <xsl:when test="self::node()[name(.)='text:file-name']">
  2168. <xsl:apply-templates select="."/>
  2169. </xsl:when>
  2170. <xsl:when test="self::node()[name(.)='text:chapter']">
  2171. <xsl:apply-templates select="."/>
  2172. </xsl:when>
  2173. <xsl:when test="self::node()[name(.)='text:editing-duration']">
  2174. <xsl:apply-templates select="."/>
  2175. </xsl:when>
  2176. <xsl:when test="self::node()[name(.)='text:creation-time']">
  2177. <xsl:apply-templates select="."/>
  2178. </xsl:when>
  2179. <xsl:when test="self::node()[name(.)='text:creation-date']">
  2180. <xsl:apply-templates select="."/>
  2181. </xsl:when>
  2182. <xsl:when test="self::node()[name(.)='text:character-count']">
  2183. <xsl:apply-templates select="."/>
  2184. </xsl:when>
  2185. <xsl:when test="self::node()[name(.)='text:page-count']">
  2186. <xsl:apply-templates select="."/>
  2187. </xsl:when>
  2188. <xsl:when test="self::node()[name(.)='text:page-number']">
  2189. <xsl:apply-templates select="."/>
  2190. </xsl:when>
  2191. <xsl:when test="substring-before(name(.),':')='draw' and not(name(.)='draw:a')">
  2192. <字:句 uof:locID="t0085">
  2193. <xsl:call-template name="字:锚点"/>
  2194. </字:句>
  2195. </xsl:when>
  2196. <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='footnote'">
  2197. <字:句 uof:locID="t0085">
  2198. <xsl:call-template name="jiaozhu"/>
  2199. </字:句>
  2200. </xsl:when>
  2201. <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='endnote'">
  2202. <字:句 uof:locID="t0085">
  2203. <xsl:call-template name="weizhu"/>
  2204. </字:句>
  2205. </xsl:when>
  2206. <xsl:when test="name(.)='text:alphabetical-index-mark-start'">
  2207. <xsl:element name="字:句">
  2208. <xsl:element name="字:区域开始">
  2209. <xsl:attribute name="uof:locId">t0121</xsl:attribute>
  2210. <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
  2211. <xsl:attribute name="字:类型">user-data</xsl:attribute>
  2212. <xsl:attribute name="字:名称"><xsl:value-of select="@text:string-value-phonetic"/></xsl:attribute>
  2213. <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
  2214. </xsl:element>
  2215. </xsl:element>
  2216. </xsl:when>
  2217. <xsl:when test="name(.)='text:alphabetical-index-mark-end'">
  2218. <xsl:element name="字:句">
  2219. <xsl:element name="字:区域结束" uof:locID="t0122" uof:attrList="标识符引用">
  2220. <xsl:attribute name="字:标识符引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2221. </xsl:element>
  2222. </xsl:element>
  2223. </xsl:when>
  2224. <xsl:when test="name(.)='text:bookmark' ">
  2225. <字:句 uof:locID="t0085">
  2226. <xsl:element name="字:句属性">
  2227. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  2228. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2229. </xsl:element>
  2230. <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型" 字:名称="{@text:name}" 字:类型="bookmark" 字:标识符="{generate-id()}"/>
  2231. <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用" 字:标识符引用="{generate-id()}"/>
  2232. </字:句>
  2233. </xsl:when>
  2234. <xsl:when test="name(.)='text:a'">
  2235. <字:句 uof:locID="t0085">
  2236. <xsl:element name="字:句属性">
  2237. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  2238. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2239. </xsl:element>
  2240. <xsl:element name="字:区域开始">
  2241. <xsl:attribute name="字:标识符">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
  2242. <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
  2243. <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
  2244. <xsl:attribute name="uof:locID">t0121</xsl:attribute>
  2245. <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
  2246. </xsl:element>
  2247. <xsl:element name="字:文本串">
  2248. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  2249. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  2250. <xsl:value-of select="."/>
  2251. </xsl:element>
  2252. <xsl:element name="字:区域结束">
  2253. <xsl:attribute name="字:标识符引用">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
  2254. <xsl:attribute name="uof:locID">t0122</xsl:attribute>
  2255. <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
  2256. </xsl:element>
  2257. </字:句>
  2258. </xsl:when>
  2259. <xsl:when test="name(.)='office:annotation'">
  2260. <字:句 uof:locID="t0085">
  2261. <xsl:element name="字:句属性">
  2262. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  2263. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2264. </xsl:element>
  2265. <xsl:element name="字:区域开始">
  2266. <xsl:attribute name="字:标识符">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
  2267. <xsl:attribute name="字:名称">Comment</xsl:attribute>
  2268. <xsl:attribute name="字:类型">annotation</xsl:attribute>
  2269. <xsl:attribute name="uof:locID">t0121</xsl:attribute>
  2270. <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
  2271. </xsl:element>
  2272. <xsl:element name="字:区域结束">
  2273. <xsl:attribute name="字:标识符引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
  2274. <xsl:attribute name="uof:locID">t0122</xsl:attribute>
  2275. <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
  2276. </xsl:element>
  2277. </字:句>
  2278. </xsl:when>
  2279. <xsl:when test="self::node()[name(.)='text:change-start'] or self::node()[name(.)='text:change'] or self::node()[name(.)='text:change-end']">
  2280. <xsl:call-template name="xiuding"/>
  2281. </xsl:when>
  2282. <xsl:otherwise>
  2283. <xsl:call-template name="字:句">
  2284. <xsl:with-param name="parentstyle" select="$parentstyle"/>
  2285. </xsl:call-template>
  2286. </xsl:otherwise>
  2287. </xsl:choose>
  2288. </xsl:for-each>
  2289. </xsl:template>
  2290. <xsl:template name="xiuding">
  2291. <xsl:choose>
  2292. <xsl:when test="self::node()[name(.)='text:change-start']or self::node()[name(.)='text:change']">
  2293. <xsl:variable name="changeID">
  2294. <xsl:value-of select="@text:change-id"/>
  2295. </xsl:variable>
  2296. <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
  2297. <xsl:if test="$changeID=@text:id">
  2298. <xsl:choose>
  2299. <xsl:when test="text:insertion">
  2300. <xsl:element name="字:修订开始">
  2301. <xsl:attribute name="uof:locID">t0206</xsl:attribute>
  2302. <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
  2303. <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
  2304. <xsl:attribute name="字:类型">insert</xsl:attribute>
  2305. <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2306. </xsl:element>
  2307. </xsl:when>
  2308. <xsl:when test="text:format-change">
  2309. <xsl:element name="字:修订开始">
  2310. <xsl:attribute name="uof:locID">t0206</xsl:attribute>
  2311. <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
  2312. <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
  2313. <xsl:attribute name="字:类型">format</xsl:attribute>
  2314. <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2315. </xsl:element>
  2316. </xsl:when>
  2317. <xsl:when test="text:deletion">
  2318. <xsl:element name="字:修订开始">
  2319. <xsl:attribute name="uof:locID">t0206</xsl:attribute>
  2320. <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
  2321. <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
  2322. <xsl:attribute name="字:类型">delete</xsl:attribute>
  2323. <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2324. </xsl:element>
  2325. </xsl:when>
  2326. </xsl:choose>
  2327. </xsl:if>
  2328. </xsl:for-each>
  2329. </xsl:when>
  2330. <xsl:when test="self::node()[name(.)='text:change-end']">
  2331. <xsl:variable name="changeendID">
  2332. <xsl:value-of select="@text:change-id"/>
  2333. </xsl:variable>
  2334. <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
  2335. <xsl:if test="$changeendID=@text:id">
  2336. <xsl:choose>
  2337. <xsl:when test="text:insertion">
  2338. <xsl:element name="字:修订结束">
  2339. <xsl:attribute name="uof:locID">t0207</xsl:attribute>
  2340. <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
  2341. <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2342. </xsl:element>
  2343. </xsl:when>
  2344. <xsl:when test="text:deletion">
  2345. <xsl:element name="字:修订结束">
  2346. <xsl:attribute name="uof:locID">t0207</xsl:attribute>
  2347. <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
  2348. <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2349. </xsl:element>
  2350. </xsl:when>
  2351. <xsl:when test="text:format-change">
  2352. <xsl:element name="字:修订结束">
  2353. <xsl:attribute name="uof:locID">t0207</xsl:attribute>
  2354. <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
  2355. <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
  2356. </xsl:element>
  2357. </xsl:when>
  2358. </xsl:choose>
  2359. </xsl:if>
  2360. </xsl:for-each>
  2361. </xsl:when>
  2362. </xsl:choose>
  2363. </xsl:template>
  2364. <xsl:template name="字:句">
  2365. <xsl:param name="parentstyle"/>
  2366. <xsl:if test="not(name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data' or name(.)='text:page-number' or name(.)='text:page-count' or name(.)='text:initial-creator' or name(.)='text:author-name' or name(.)='text:author-initials' or name(.)='text:creation-time' or name(.)='text:creation-date' or name(.)='text:title' or name(.)='text:subject' or name(.)='text:file-name' or name(.)='text:editing-duration' or name(.)='text:character-count' or name(.)='text:chapter')">
  2367. <字:句 uof:locID="t0085">
  2368. <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
  2369. <xsl:choose>
  2370. <xsl:when test="@text:style-name">
  2371. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  2372. </xsl:when>
  2373. <xsl:when test="parent::text:h/@text:outline-level">
  2374. <xsl:attribute name="字:式样引用"><xsl:value-of select="concat('Heading_20_',parent::text:h/@text:outline-level)"/></xsl:attribute>
  2375. </xsl:when>
  2376. <xsl:when test="parent::node()/@text:style-name">
  2377. <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
  2378. </xsl:when>
  2379. </xsl:choose>
  2380. </字:句属性>
  2381. <xsl:if test="ancestor::text:note-body">
  2382. <字:引文符号>
  2383. <xsl:value-of select="ancestor::text:note/text:note-citation"/>
  2384. </字:引文符号>
  2385. </xsl:if>
  2386. <xsl:choose>
  2387. <xsl:when test="(preceding-sibling::text:bookmark-start) and (following-sibling::text:bookmark-end)">
  2388. <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
  2389. <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark-start/@text:name"/></xsl:attribute>
  2390. <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
  2391. <xsl:attribute name="字:类型">bookmark</xsl:attribute>
  2392. </字:区域开始>
  2393. <xsl:element name="字:文本串">
  2394. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  2395. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  2396. <xsl:value-of select="string(.)"/>
  2397. </xsl:element>
  2398. <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
  2399. <xsl:attribute name="字:标识符引用"><xsl:value-of select="following-sibling::text:bookmark-end/@text:name"/></xsl:attribute>
  2400. </字:区域结束>
  2401. </xsl:when>
  2402. <xsl:when test="name(.)='draw:a'">
  2403. <xsl:variable name="link-name">
  2404. <xsl:value-of select="substring-after(@xlink:href,'#')"/>
  2405. </xsl:variable>
  2406. <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
  2407. <xsl:attribute name="字:标识符"><xsl:value-of select="$link-name"/></xsl:attribute>
  2408. <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
  2409. <xsl:attribute name="字:类型">bookmark</xsl:attribute>
  2410. </字:区域开始>
  2411. <xsl:call-template name="字:锚点"/>
  2412. <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
  2413. <xsl:attribute name="字:标识符引用"><xsl:value-of select="$link-name"/></xsl:attribute>
  2414. </字:区域结束>
  2415. </xsl:when>
  2416. <xsl:when test="self::node( )[name(.)='text:tab']">
  2417. <xsl:element name="字:制表符">
  2418. <xsl:attribute name="uof:locID">t0123</xsl:attribute>
  2419. </xsl:element>
  2420. </xsl:when>
  2421. <xsl:when test="self::node( )[name(.)='text:line-break']">
  2422. <xsl:element name="字:换行符">
  2423. <xsl:attribute name="uof:locID">t0124</xsl:attribute>
  2424. </xsl:element>
  2425. </xsl:when>
  2426. <xsl:when test="name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data'">
  2427. </xsl:when>
  2428. <xsl:otherwise>
  2429. <xsl:element name="字:文本串">
  2430. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  2431. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  2432. <xsl:value-of select="string(.)"/>
  2433. </xsl:element>
  2434. </xsl:otherwise>
  2435. </xsl:choose>
  2436. </字:句>
  2437. </xsl:if>
  2438. </xsl:template>
  2439. <xsl:template match="draw:text-box">
  2440. <xsl:apply-templates/>
  2441. </xsl:template>
  2442. <xsl:template name="text">
  2443. <xsl:element name="字:句属性">
  2444. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  2445. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2446. <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
  2447. </xsl:element>
  2448. <xsl:element name="字:文本串">
  2449. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  2450. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  2451. <xsl:value-of select="string(.)"/>
  2452. </xsl:element>
  2453. </xsl:template>
  2454. <xsl:template name="textspan">
  2455. <字:句 uof:locID="t0085">
  2456. <xsl:choose>
  2457. <xsl:when test="./text:note/@text:note-class='footnote'">
  2458. <xsl:for-each select="text:note">
  2459. <xsl:call-template name="jiaozhu"/>
  2460. </xsl:for-each>
  2461. </xsl:when>
  2462. <xsl:when test="./text:note/@text:note-class='endnote'">
  2463. <xsl:for-each select="text:note">
  2464. <xsl:call-template name="weizhu"/>
  2465. </xsl:for-each>
  2466. </xsl:when>
  2467. <xsl:otherwise>
  2468. <xsl:element name="字:句属性">
  2469. <xsl:attribute name="uof:locID">t0086</xsl:attribute>
  2470. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2471. <xsl:variable name="textstyle">
  2472. <xsl:value-of select="@text:style-name"/>
  2473. </xsl:variable>
  2474. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  2475. <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
  2476. <xsl:if test="@style:name=$textstyle and not(@style:parent-style-name='Standard')">
  2477. <xsl:if test="@style:parent-style-name=/office:document/office:styles/style:style/@style:name">
  2478. <xsl:call-template name="SentenceXD">
  2479. <xsl:with-param name="Sentencestyle" select="@style:parent-style-name"/>
  2480. </xsl:call-template>
  2481. </xsl:if>
  2482. </xsl:if>
  2483. </xsl:for-each>
  2484. <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
  2485. <xsl:if test="@style:name=$textstyle">
  2486. <xsl:call-template name="SentenceXD">
  2487. <xsl:with-param name="Sentencestyle" select="@style:name"/>
  2488. </xsl:call-template>
  2489. </xsl:if>
  2490. </xsl:for-each>
  2491. </xsl:element>
  2492. <xsl:element name="字:文本串">
  2493. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  2494. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  2495. <xsl:value-of select="string(.)"/>
  2496. </xsl:element>
  2497. </xsl:otherwise>
  2498. </xsl:choose>
  2499. </字:句>
  2500. </xsl:template>
  2501. <xsl:template name="SentenceXD">
  2502. <xsl:param name="Sentencestyle"/>
  2503. </xsl:template>
  2504. <xsl:template name="字:锚点">
  2505. <xsl:if test="not(name(.)='draw:glue-point')">
  2506. <xsl:variable name="name">
  2507. <xsl:value-of select="name(.)"/>
  2508. </xsl:variable>
  2509. <xsl:choose>
  2510. <xsl:when test="name='draw:a'">
  2511. <xsl:for-each select="child::node( )">
  2512. <xsl:call-template name="字:锚点"/>
  2513. </xsl:for-each>
  2514. </xsl:when>
  2515. <xsl:otherwise>
  2516. <xsl:if test="$name = 'draw:g'">
  2517. <xsl:for-each select="child::*">
  2518. <xsl:call-template name="字:锚点"/>
  2519. </xsl:for-each>
  2520. </xsl:if>
  2521. <字:锚点 uof:locID="t0110" uof:attrList="标识符 类型">
  2522. <xsl:choose>
  2523. <xsl:when test="@text:anchor-type='as-char'">
  2524. <xsl:attribute name="字:类型">inline</xsl:attribute>
  2525. </xsl:when>
  2526. <xsl:otherwise>
  2527. <xsl:attribute name="字:类型">normal</xsl:attribute>
  2528. </xsl:otherwise>
  2529. </xsl:choose>
  2530. <字:锚点属性 uof:locID="t0111">
  2531. <字:宽度 uof:locID="t0112">
  2532. <xsl:choose>
  2533. <xsl:when test="@svg:width">
  2534. <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
  2535. </xsl:when>
  2536. <xsl:when test="@svg:x1">
  2537. <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
  2538. </xsl:when>
  2539. </xsl:choose>
  2540. </字:宽度>
  2541. <字:高度 uof:locID="t0113">
  2542. <xsl:choose>
  2543. <xsl:when test="@svg:height">
  2544. <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
  2545. </xsl:when>
  2546. <xsl:when test="@svg:x1">
  2547. <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
  2548. </xsl:when>
  2549. <xsl:when test="child::draw:text-box/@fo:min-height">
  2550. <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
  2551. </xsl:when>
  2552. </xsl:choose>
  2553. </字:高度>
  2554. <xsl:if test="not(@text:anchor-type='as-char')">
  2555. <字:位置 uof:locID="t0114">
  2556. <字:水平 uof:locID="t0176" uof:attrList="相对于">
  2557. <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
  2558. <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:horizontal-rel='page'">page</xsl:when><xsl:when test="@style:horizontal-rel='paragraph'">margin</xsl:when><xsl:when test="@style:horizontal-rel='page-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='char'">char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  2559. </xsl:for-each>
  2560. <xsl:choose>
  2561. <xsl:when test="@svg:x or @svg:x1">
  2562. <字:绝对 uof:locID="t0177" uof:attrList="值">
  2563. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
  2564. </字:绝对>
  2565. </xsl:when>
  2566. <xsl:otherwise>
  2567. <字:相对 uof:locID="t0178" uof:attrList="参考点 值">
  2568. <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
  2569. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:horizontal-pos='left'">left</xsl:when><xsl:when test="@style:horizontal-pos='right'">right</xsl:when><xsl:when test="@style:horizontal-pos='center'">center</xsl:when></xsl:choose></xsl:attribute>
  2570. </xsl:for-each>
  2571. </字:相对>
  2572. </xsl:otherwise>
  2573. </xsl:choose>
  2574. </字:水平>
  2575. <字:垂直 uof:locID="t0179" uof:attrList="相对于">
  2576. <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
  2577. <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:vertical-rel='page'">page</xsl:when><xsl:when test="@style:vertical-rel='paragraph'">paragraph</xsl:when><xsl:when test="@style:vertical-rel='page-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='line'">line</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
  2578. </xsl:for-each>
  2579. <xsl:choose>
  2580. <xsl:when test="@svg:y or @svg:y1">
  2581. <字:绝对 uof:locID="t0180" uof:attrList="值">
  2582. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
  2583. </字:绝对>
  2584. </xsl:when>
  2585. <xsl:otherwise>
  2586. <字:相对 uof:locID="t0181" uof:attrList="参考点 值">
  2587. <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
  2588. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:vertical-pos='bottom'">bottom</xsl:when><xsl:when test="@style:vertical-pos='top'">top</xsl:when><xsl:when test="@style:vertical-pos='middle'">center</xsl:when><xsl:when test="@style:vertical-pos='below'">inside</xsl:when></xsl:choose></xsl:attribute>
  2589. </xsl:for-each>
  2590. </字:相对>
  2591. </xsl:otherwise>
  2592. </xsl:choose>
  2593. </字:垂直>
  2594. </字:位置>
  2595. </xsl:if>
  2596. <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
  2597. <字:绕排 uof:locID="t0115" uof:attrList="绕排方式 环绕文字 绕排顶点">
  2598. <xsl:variable name="wrap_type1">
  2599. <xsl:value-of select="@style:wrap"/>
  2600. </xsl:variable>
  2601. <xsl:variable name="wrap_type2">
  2602. <xsl:value-of select="@style:run-through"/>
  2603. </xsl:variable>
  2604. <xsl:variable name="a">
  2605. <xsl:value-of select="@style:number-wrapped-paragraphs"/>
  2606. </xsl:variable>
  2607. <xsl:if test="$wrap_type1">
  2608. <xsl:attribute name="字:绕排方式"><xsl:choose><xsl:when test="$wrap_type1='run-through' and $wrap_type2='background' ">behindtext</xsl:when><xsl:when test="$wrap_type1='run-through' and $a='1'">infrontoftext</xsl:when><xsl:when test="$wrap_type1='run-through'">through</xsl:when><xsl:when test="$wrap_type1='dynamic' ">top-bottom</xsl:when><xsl:when test="$wrap_type1='parallel' ">square</xsl:when><xsl:when test="$wrap_type1='left' or $wrap_type1='right'">tight</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  2609. </xsl:if>
  2610. <xsl:if test="$wrap_type1='left' or $wrap_type1='right'">
  2611. <xsl:attribute name="字:环绕文字"><xsl:choose><xsl:when test="$wrap_type1='left'">left</xsl:when><xsl:when test="$wrap_type1='right'">right</xsl:when></xsl:choose></xsl:attribute>
  2612. </xsl:if>
  2613. </字:绕排>
  2614. <字:边距 uof:locID="t0116" uof:attrList="上 左 右 下">
  2615. <xsl:choose>
  2616. <xsl:when test="@fo:margin-top">
  2617. <xsl:attribute name="字:上"><xsl:value-of select="substring-before(@fo:margin-top,$uofUnit)"/></xsl:attribute>
  2618. <xsl:attribute name="字:下"><xsl:value-of select="substring-before(@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
  2619. </xsl:when>
  2620. <xsl:otherwise>
  2621. <xsl:attribute name="字:上">0.0</xsl:attribute>
  2622. <xsl:attribute name="字:下">0.0</xsl:attribute>
  2623. </xsl:otherwise>
  2624. </xsl:choose>
  2625. <xsl:choose>
  2626. <xsl:when test="@fo:margin-right">
  2627. <xsl:attribute name="字:右"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
  2628. <xsl:attribute name="字:左"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
  2629. </xsl:when>
  2630. <xsl:otherwise>
  2631. <xsl:attribute name="字:右">0.0</xsl:attribute>
  2632. <xsl:attribute name="字:左">0.0</xsl:attribute>
  2633. </xsl:otherwise>
  2634. </xsl:choose>
  2635. </字:边距>
  2636. <字:锁定 uof:attrList="值" uof:locID="t0117">
  2637. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@draw:move-protect='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  2638. </字:锁定>
  2639. <字:保护 uof:locID="t0118" uof:attrList="值">
  2640. <xsl:choose>
  2641. <xsl:when test="$name='draw:image' or $name='draw:text-box'">
  2642. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'content size position' or @style:protect = 'content' or @style:protect = 'content size' or @style:protect = 'size position' or @style:protect = 'size' or @style:protect = 'position' or @style:protect = 'content position' and @draw:size-protect= 'true'and @draw:move-protect= 'true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2643. </xsl:when>
  2644. <xsl:otherwise>
  2645. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'position size'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  2646. </xsl:otherwise>
  2647. </xsl:choose>
  2648. </字:保护>
  2649. </xsl:for-each>
  2650. <字:允许重叠 uof:locID="t0119" uof:attrList="值" 字:值="true"/>
  2651. </字:锚点属性>
  2652. <字:图形 uof:locID="t0120" uof:attrList="图形引用">
  2653. <xsl:variable name="refpicname">
  2654. <xsl:if test="@draw:style-name">
  2655. <xsl:value-of select="@draw:style-name"/>
  2656. </xsl:if>
  2657. </xsl:variable>
  2658. <xsl:variable name="picnumber">
  2659. <xsl:if test="@draw:style-name">
  2660. <xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/>
  2661. </xsl:if>
  2662. </xsl:variable>
  2663. <xsl:attribute name="字:图形引用"><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:attribute>
  2664. </字:图形>
  2665. </字:锚点>
  2666. </xsl:otherwise>
  2667. </xsl:choose>
  2668. </xsl:if>
  2669. </xsl:template>
  2670. <xsl:template name="liekuan">
  2671. <xsl:param name="count"/>
  2672. <xsl:param name="width"/>
  2673. <xsl:if test="$count &gt; 0">
  2674. <字:列宽 uof:locID="t0132">
  2675. <xsl:value-of select="$width"/>
  2676. </字:列宽>
  2677. <xsl:call-template name="liekuan">
  2678. <xsl:with-param name="count" select="$count -1"/>
  2679. <xsl:with-param name="width" select="$width"/>
  2680. </xsl:call-template>
  2681. </xsl:if>
  2682. </xsl:template>
  2683. <xsl:template name="exec_table" match="table:table">
  2684. <xsl:param name="tabletype"/>
  2685. <字:文字表 uof:locID="t0128" uof:attrList="类型">
  2686. <xsl:choose>
  2687. <xsl:when test="@table:is-sub-table='true'">
  2688. <xsl:attribute name="字:类型">sub-table</xsl:attribute>
  2689. <xsl:element name="字:文字表属性">
  2690. <xsl:attribute name="uof:locID">t0129</xsl:attribute>
  2691. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2692. <xsl:element name="字:列宽集">
  2693. <xsl:attribute name="uof:locID">t0131</xsl:attribute>
  2694. <xsl:for-each select="table:table-column">
  2695. <xsl:variable name="tableColName" select="@table:style-name"/>
  2696. <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
  2697. <xsl:choose>
  2698. <xsl:when test="@table:number-columns-repeated">
  2699. <xsl:call-template name="liekuan">
  2700. <xsl:with-param name="count" select="@table:number-columns-repeated"/>
  2701. <xsl:with-param name="width" select="$colWidth"/>
  2702. </xsl:call-template>
  2703. </xsl:when>
  2704. <xsl:otherwise>
  2705. <字:列宽 uof:locID="t0132">
  2706. <xsl:value-of select="$colWidth"/>
  2707. </字:列宽>
  2708. </xsl:otherwise>
  2709. </xsl:choose>
  2710. </xsl:for-each>
  2711. </xsl:element>
  2712. </xsl:element>
  2713. </xsl:when>
  2714. <xsl:otherwise>
  2715. <xsl:attribute name="字:类型">table</xsl:attribute>
  2716. <xsl:element name="字:文字表属性">
  2717. <xsl:attribute name="uof:locID">t0129</xsl:attribute>
  2718. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  2719. <xsl:attribute name="字:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
  2720. <xsl:variable name="tableName" select="@table:style-name"/>
  2721. <xsl:element name="字:列宽集">
  2722. <xsl:attribute name="uof:locID">t0131</xsl:attribute>
  2723. <xsl:for-each select="table:table-column">
  2724. <xsl:variable name="tableColName" select="@table:style-name"/>
  2725. <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
  2726. <xsl:choose>
  2727. <xsl:when test="@table:number-columns-repeated">
  2728. <xsl:call-template name="liekuan">
  2729. <xsl:with-param name="count" select="@table:number-columns-repeated"/>
  2730. <xsl:with-param name="width" select="$colWidth"/>
  2731. </xsl:call-template>
  2732. </xsl:when>
  2733. <xsl:otherwise>
  2734. <字:列宽 uof:locID="t0132">
  2735. <xsl:value-of select="$colWidth"/>
  2736. </字:列宽>
  2737. </xsl:otherwise>
  2738. </xsl:choose>
  2739. </xsl:for-each>
  2740. </xsl:element>
  2741. <xsl:for-each select="key('set_styleStyle',$tableName)">
  2742. <xsl:element name="字:宽度">
  2743. <xsl:attribute name="uof:locID">t0130</xsl:attribute>
  2744. <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
  2745. <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
  2746. <xsl:if test="style:table-properties/@style:rel-width">
  2747. <xsl:attribute name="字:相对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:rel-width,'%') div 100"/></xsl:attribute>
  2748. </xsl:if>
  2749. </xsl:element>
  2750. <xsl:element name="字:对齐">
  2751. <xsl:attribute name="uof:locID">t0133</xsl:attribute>
  2752. <xsl:choose>
  2753. <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
  2754. <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
  2755. <xsl:otherwise>left</xsl:otherwise>
  2756. </xsl:choose>
  2757. </xsl:element>
  2758. <xsl:if test="style:table-properties/@fo:margin-left">
  2759. <xsl:element name="字:左缩进">
  2760. <xsl:attribute name="uof:locID">t0134</xsl:attribute>
  2761. <xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/>
  2762. </xsl:element>
  2763. </xsl:if>
  2764. <xsl:element name="字:绕排">
  2765. <xsl:attribute name="uof:locID">t0135</xsl:attribute>
  2766. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2767. <xsl:attribute name="字:值">around</xsl:attribute>
  2768. </xsl:element>
  2769. <xsl:element name="字:边框">
  2770. <xsl:attribute name="uof:locID">t0137</xsl:attribute>
  2771. <xsl:for-each select="style:table-properties">
  2772. <xsl:call-template name="uof:边框"/>
  2773. </xsl:for-each>
  2774. </xsl:element>
  2775. <xsl:if test="style:table-properties/style:background-image/office:binary-data or style:table-properties/@fo:background-color or style:page-layout-properties/@fo:background-color">
  2776. <字:填充 uof:locID="t0138">
  2777. <xsl:for-each select="style:table-properties">
  2778. <xsl:call-template name="图:填充">
  2779. <xsl:with-param name="style-name" select="$tableName"/>
  2780. </xsl:call-template>
  2781. </xsl:for-each>
  2782. </字:填充>
  2783. </xsl:if>
  2784. <xsl:element name="字:绕排边距">
  2785. <xsl:attribute name="uof:locID">t0139</xsl:attribute>
  2786. <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
  2787. <xsl:if test="style:table-properties/@fo:margin-top">
  2788. <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
  2789. </xsl:if>
  2790. <xsl:if test="style:table-properties/@fo:margin-left">
  2791. <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
  2792. </xsl:if>
  2793. <xsl:if test="style:table-properties/@fo:margin-right">
  2794. <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
  2795. </xsl:if>
  2796. <xsl:if test="style:table-properties/@fo:margin-bottom">
  2797. <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
  2798. </xsl:if>
  2799. </xsl:element>
  2800. <xsl:element name="字:自动调整大小">
  2801. <xsl:attribute name="字:值">true</xsl:attribute>
  2802. <xsl:attribute name="uof:locID">t0140</xsl:attribute>
  2803. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2804. </xsl:element>
  2805. <xsl:element name="字:默认单元格边距">
  2806. <xsl:attribute name="uof:locID">t0141</xsl:attribute>
  2807. <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
  2808. <xsl:attribute name="字:上">0.10</xsl:attribute>
  2809. <xsl:attribute name="字:左">0.10</xsl:attribute>
  2810. <xsl:attribute name="字:右">0.10</xsl:attribute>
  2811. <xsl:attribute name="字:下">0.10</xsl:attribute>
  2812. </xsl:element>
  2813. <xsl:element name="字:默认单元格间距">
  2814. <xsl:attribute name="uof:locID">t0142</xsl:attribute>
  2815. <xsl:value-of select="'0.00'"/>
  2816. </xsl:element>
  2817. </xsl:for-each>
  2818. </xsl:element>
  2819. </xsl:otherwise>
  2820. </xsl:choose>
  2821. <xsl:apply-templates select="table:table-header-rows/table:table-row"/>
  2822. <xsl:apply-templates select="table:table-row"/>
  2823. </字:文字表>
  2824. </xsl:template>
  2825. <xsl:key name="set_colWidth" match="//office:automatic-styles/style:style[@style:family='table-column']" use="@style:name"/>
  2826. <xsl:key name="set_styleStyle" match="//office:automatic-styles/style:style" use="@style:name"/>
  2827. <xsl:template match="table:table-row">
  2828. <xsl:element name="字:行">
  2829. <xsl:attribute name="uof:locID">t0143</xsl:attribute>
  2830. <xsl:variable name="rowStyleName" select="@table:style-name|table:table-row/@table:style-name"/>
  2831. <xsl:element name="字:表行属性">
  2832. <xsl:attribute name="uof:locID">t0144</xsl:attribute>
  2833. <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:row-height or @style:min-row-height]">
  2834. <xsl:element name="字:高度">
  2835. <xsl:if test="@style:row-height">
  2836. <xsl:attribute name="字:固定值"><xsl:value-of select="substring-before(@style:row-height,$ooUnit)"/></xsl:attribute>
  2837. </xsl:if>
  2838. <xsl:if test="@style:min-row-height">
  2839. <xsl:attribute name="字:最小值"><xsl:value-of select="substring-before(@style:min-row-height,$ooUnit)"/></xsl:attribute>
  2840. </xsl:if>
  2841. <xsl:attribute name="uof:locID">t0145</xsl:attribute>
  2842. <xsl:attribute name="uof:attrList">固定值 最小值</xsl:attribute>
  2843. </xsl:element>
  2844. </xsl:for-each>
  2845. <xsl:if test="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
  2846. <xsl:element name="字:跨页">
  2847. <xsl:attribute name="uof:locID">t0146</xsl:attribute>
  2848. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2849. <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
  2850. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:keep-together='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  2851. </xsl:for-each>
  2852. </xsl:element>
  2853. </xsl:if>
  2854. <xsl:if test="name(..)='table:table-header-rows'">
  2855. <xsl:element name="字:表头行">
  2856. <xsl:attribute name="uof:locID">t0147</xsl:attribute>
  2857. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2858. <xsl:attribute name="字:值">true</xsl:attribute>
  2859. </xsl:element>
  2860. </xsl:if>
  2861. </xsl:element>
  2862. <xsl:for-each select="node()">
  2863. <xsl:choose>
  2864. <xsl:when test="name()='table:table-cell'">
  2865. <xsl:element name="字:单元格">
  2866. <xsl:attribute name="uof:locID">t0148</xsl:attribute>
  2867. <xsl:call-template name="execTableCellAttribute"/>
  2868. <xsl:for-each select="node( )">
  2869. <xsl:choose>
  2870. <xsl:when test="name()='text:p'">
  2871. <xsl:call-template name="execParagraph">
  2872. <xsl:with-param name="currlistlvl" select="number('0')"/>
  2873. <xsl:with-param name="liststylename" select="string('00000')"/>
  2874. </xsl:call-template>
  2875. </xsl:when>
  2876. <xsl:when test="name()='table:table' or name()='table:sub-table' or self::node()/@table:is-sub-table='true'">
  2877. <xsl:call-template name="exec_table">
  2878. <xsl:with-param name="tabletype" select="name()"/>
  2879. </xsl:call-template>
  2880. </xsl:when>
  2881. <xsl:otherwise/>
  2882. </xsl:choose>
  2883. </xsl:for-each>
  2884. </xsl:element>
  2885. </xsl:when>
  2886. <xsl:otherwise/>
  2887. </xsl:choose>
  2888. </xsl:for-each>
  2889. </xsl:element>
  2890. </xsl:template>
  2891. <xsl:template name="execTableCellAttribute">
  2892. <xsl:element name="字:单元格属性">
  2893. <xsl:attribute name="uof:locID">t0149</xsl:attribute>
  2894. <xsl:variable name="StyleName" select="@table:style-name"/>
  2895. <xsl:element name="字:宽度">
  2896. <xsl:attribute name="uof:locID">t0150</xsl:attribute>
  2897. <xsl:attribute name="uof:attrList">绝对值 相对值</xsl:attribute>
  2898. <xsl:variable name="sn">
  2899. <xsl:number from="/office:document/office:body/office:text" level="single" count="table:table-cell" format="1"/>
  2900. </xsl:variable>
  2901. <xsl:variable name="sn1">
  2902. <xsl:choose>
  2903. <xsl:when test="../../table:table-column[number($sn)]/@table:style-name">
  2904. <xsl:value-of select="$sn"/>
  2905. </xsl:when>
  2906. <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
  2907. <xsl:value-of select="$sn"/>
  2908. </xsl:when>
  2909. <xsl:otherwise>
  2910. <xsl:value-of select="'1'"/>
  2911. </xsl:otherwise>
  2912. </xsl:choose>
  2913. </xsl:variable>
  2914. <xsl:variable name="KuanDu">
  2915. <xsl:choose>
  2916. <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
  2917. <xsl:value-of select="../../../table:table-column[number($sn1)]/@table:style-name"/>
  2918. </xsl:when>
  2919. <xsl:otherwise>
  2920. <xsl:value-of select="../../table:table-column[number($sn1)]/@table:style-name"/>
  2921. </xsl:otherwise>
  2922. </xsl:choose>
  2923. </xsl:variable>
  2924. <xsl:attribute name="字:绝对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:column-width,$ooUnit)"/></xsl:attribute>
  2925. <xsl:if test="key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width">
  2926. <xsl:attribute name="字:相对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width,'*')"/></xsl:attribute>
  2927. </xsl:if>
  2928. </xsl:element>
  2929. <xsl:if test="@table:number-columns-spanned">
  2930. <xsl:element name="字:跨列">
  2931. <xsl:attribute name="uof:locID">t0156</xsl:attribute>
  2932. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2933. <xsl:attribute name="字:值"><xsl:value-of select="@table:number-columns-spanned"/></xsl:attribute>
  2934. </xsl:element>
  2935. </xsl:if>
  2936. <xsl:for-each select="key('set_styleStyle',$StyleName)">
  2937. <xsl:element name="字:单元格边距">
  2938. <xsl:attribute name="uof:locID">t0151</xsl:attribute>
  2939. <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
  2940. <xsl:choose>
  2941. <xsl:when test="style:table-cell-properties/@fo:padding">
  2942. <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
  2943. <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
  2944. <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
  2945. <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
  2946. </xsl:when>
  2947. <xsl:otherwise>
  2948. <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
  2949. <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
  2950. <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
  2951. <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
  2952. </xsl:otherwise>
  2953. </xsl:choose>
  2954. </xsl:element>
  2955. <xsl:if test="style:table-cell-properties/@fo:border or style:table-cell-properties/@fo:border-top or style:table-cell-properties/@fo:border-bottom or style:table-cell-properties/@fo:border-left or style:table-cell-properties/@fo:border-right or style:table-cell-properties/@style:shadow">
  2956. <xsl:element name="字:边框">
  2957. <xsl:attribute name="uof:locID">t0152</xsl:attribute>
  2958. <xsl:for-each select="style:table-cell-properties">
  2959. <xsl:call-template name="uof:边框"/>
  2960. </xsl:for-each>
  2961. </xsl:element>
  2962. </xsl:if>
  2963. <xsl:if test="style:table-cell-properties/style:background-image/office:binary-data or style:table-cell-properties/@fo:background-color">
  2964. <字:填充 uof:locID="t0153">
  2965. <xsl:for-each select="style:table-cell-properties">
  2966. <xsl:call-template name="图:填充"/>
  2967. </xsl:for-each>
  2968. </字:填充>
  2969. </xsl:if>
  2970. <字:垂直对齐方式 uof:locID="t0154">
  2971. <xsl:choose>
  2972. <xsl:when test="style:table-cell-properties/@style:vertical-align='middle'">center</xsl:when>
  2973. <xsl:when test="style:table-cell-properties/@style:vertical-align='bottom'">bottom</xsl:when>
  2974. <xsl:otherwise>top</xsl:otherwise>
  2975. </xsl:choose>
  2976. </字:垂直对齐方式>
  2977. <xsl:element name="字:自动换行">
  2978. <xsl:attribute name="字:值">true</xsl:attribute>
  2979. <xsl:attribute name="uof:locID">t0157</xsl:attribute>
  2980. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2981. </xsl:element>
  2982. <xsl:element name="字:适应文字">
  2983. <xsl:attribute name="字:值">true</xsl:attribute>
  2984. <xsl:attribute name="uof:locID">t0158</xsl:attribute>
  2985. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  2986. </xsl:element>
  2987. </xsl:for-each>
  2988. </xsl:element>
  2989. </xsl:template>
  2990. <xsl:key name="bpath" match="//office:document/office:body/office:text/text:p/text:span" use="@text:style-name"/>
  2991. <xsl:template name="字:句属性">
  2992. <xsl:element name="字:字体">
  2993. <xsl:attribute name="uof:locID">t0088</xsl:attribute>
  2994. <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
  2995. <xsl:if test="contains(@style:parent-style-name,'Header') or contains(@style:parent-style-name,'Foot') or contains(@style:parent-style-name,'Endnote')">
  2996. <xsl:attribute name="字:字号">9</xsl:attribute>
  2997. </xsl:if>
  2998. <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size-complex">
  2999. <xsl:choose>
  3000. <xsl:when test="contains(style:text-properties/@fo:font-size,'%') or contains(style:text-properties/@style:font-size-asian,'%')">
  3001. <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'%')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
  3002. </xsl:when>
  3003. <xsl:otherwise>
  3004. <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-complex"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
  3005. </xsl:otherwise>
  3006. </xsl:choose>
  3007. </xsl:if>
  3008. <xsl:if test="style:text-properties/@style:font-name">
  3009. <xsl:variable name="xiwen" select="style:text-properties/@style:font-name"/>
  3010. <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($xiwen,' ','_')"/></xsl:attribute>
  3011. </xsl:if>
  3012. <xsl:if test="style:text-properties/@style:font-name-asian">
  3013. <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-name-asian"/></xsl:attribute>
  3014. </xsl:if>
  3015. <xsl:if test="style:text-properties/@fo:color">
  3016. <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
  3017. </xsl:if>
  3018. </xsl:element>
  3019. <xsl:if test="style:text-properties/@fo:background-color and not(style:text-properties/@style:text-background-color='transparent')">
  3020. <xsl:element name="字:填充">
  3021. <xsl:attribute name="uof:locID">t0093</xsl:attribute>
  3022. <xsl:element name="图:图案">
  3023. <xsl:attribute name="uof:locID">g0036</xsl:attribute>
  3024. <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
  3025. <xsl:if test="style:text-properties/@fo:background-color">
  3026. <xsl:attribute name="图:前景色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3027. </xsl:if>
  3028. </xsl:element>
  3029. </xsl:element>
  3030. </xsl:if>
  3031. <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
  3032. <xsl:element name="字:粗体">
  3033. <xsl:attribute name="uof:locID">t0089</xsl:attribute>
  3034. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3035. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3036. </xsl:element>
  3037. </xsl:if>
  3038. <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
  3039. <xsl:element name="字:斜体">
  3040. <xsl:attribute name="uof:locID">t0090</xsl:attribute>
  3041. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3042. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3043. </xsl:element>
  3044. </xsl:if>
  3045. <xsl:if test="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color">
  3046. <xsl:element name="字:突出显示">
  3047. <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent' or style:text-properties/@style:text-background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3048. <xsl:attribute name="uof:locID">t0091</xsl:attribute>
  3049. <xsl:attribute name="uof:attrList">颜色</xsl:attribute>
  3050. </xsl:element>
  3051. </xsl:if>
  3052. <xsl:if test="style:text-properties/@style:text-line-through-style">
  3053. <xsl:element name="字:删除线">
  3054. <xsl:attribute name="uof:locID">t0094</xsl:attribute>
  3055. <xsl:attribute name="uof:attrList">类型</xsl:attribute>
  3056. <xsl:attribute name="字:类型"><xsl:call-template name="uof:删除线类型"><xsl:with-param name="lineType" select="style:text-properties/@style:text-line-through-style"/></xsl:call-template></xsl:attribute>
  3057. </xsl:element>
  3058. </xsl:if>
  3059. <xsl:if test="style:text-properties/@style:text-underline-style">
  3060. <xsl:element name="字:下划线">
  3061. <xsl:attribute name="uof:locID">t0095</xsl:attribute>
  3062. <xsl:attribute name="uof:attrList">类型 颜色 字下划线</xsl:attribute>
  3063. <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
  3064. <xsl:if test="style:text-properties/@style:text-underline-color">
  3065. <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3066. </xsl:if>
  3067. </xsl:element>
  3068. </xsl:if>
  3069. <xsl:if test="style:text-properties/@fo:text-shadow">
  3070. <xsl:element name="字:阴影">
  3071. <xsl:attribute name="uof:locID">t0100</xsl:attribute>
  3072. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3073. <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
  3074. </xsl:element>
  3075. </xsl:if>
  3076. <xsl:if test="style:text-properties/@style:text-emphasize">
  3077. <xsl:element name="字:着重号">
  3078. <xsl:attribute name="uof:locID">t0096</xsl:attribute>
  3079. <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
  3080. <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="style:text-properties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
  3081. <xsl:if test="style:text-properties/@fo:color">
  3082. <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
  3083. </xsl:if>
  3084. </xsl:element>
  3085. </xsl:if>
  3086. <xsl:if test="style:text-properties/@text:display">
  3087. <xsl:element name="字:隐藏文字">
  3088. <xsl:attribute name="uof:locID">t0097</xsl:attribute>
  3089. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3090. <xsl:attribute name="字:值">true</xsl:attribute>
  3091. </xsl:element>
  3092. </xsl:if>
  3093. <xsl:if test="style:text-properties/@style:text-outline">
  3094. <xsl:element name="字:空心">
  3095. <xsl:attribute name="uof:locID">t0098</xsl:attribute>
  3096. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3097. <xsl:attribute name="字:值"><xsl:value-of select="style:text-properties/@style:text-outline"/></xsl:attribute>
  3098. </xsl:element>
  3099. </xsl:if>
  3100. <xsl:if test="style:text-properties/@style:font-relief">
  3101. <xsl:element name="字:浮雕">
  3102. <xsl:attribute name="uof:locID">t0099</xsl:attribute>
  3103. <xsl:attribute name="uof:attrList">类型</xsl:attribute>
  3104. <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3105. </xsl:element>
  3106. </xsl:if>
  3107. <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
  3108. <xsl:element name="字:醒目字体">
  3109. <xsl:attribute name="uof:locID">t0101</xsl:attribute>
  3110. <xsl:attribute name="uof:attrList">类型</xsl:attribute>
  3111. <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3112. </xsl:element>
  3113. </xsl:if>
  3114. <xsl:if test="style:text-properties/@style:text-position">
  3115. <xsl:element name="字:位置">
  3116. <xsl:attribute name="uof:locID">t0102</xsl:attribute>
  3117. <xsl:variable name="aa">
  3118. <xsl:value-of select="style:text-properties/@style:text-position"/>
  3119. </xsl:variable>
  3120. <xsl:choose>
  3121. <xsl:when test="contains($aa,'sub')">
  3122. <xsl:value-of select="substring-before($aa,' ')"/>
  3123. </xsl:when>
  3124. <xsl:when test="contains($aa,'super')">
  3125. <xsl:value-of select="substring-before($aa,' ')"/>
  3126. </xsl:when>
  3127. <xsl:otherwise>
  3128. <xsl:value-of select="translate($aa,'%','')"/>
  3129. </xsl:otherwise>
  3130. </xsl:choose>
  3131. </xsl:element>
  3132. </xsl:if>
  3133. <xsl:if test="style:text-properties/@style:text-scale">
  3134. <xsl:element name="字:缩放">
  3135. <xsl:attribute name="uof:locID">t0103</xsl:attribute>
  3136. <xsl:variable name="scale" select="style:text-properties/@style:text-scale"/>
  3137. <xsl:choose>
  3138. <xsl:when test="contains($scale,'%')">
  3139. <xsl:value-of select="substring-before($scale,'%')"/>
  3140. </xsl:when>
  3141. <xsl:otherwise>
  3142. <xsl:value-of select="style:text-properties/@style:text-scale"/>
  3143. </xsl:otherwise>
  3144. </xsl:choose>
  3145. </xsl:element>
  3146. </xsl:if>
  3147. <xsl:if test="style:text-properties/@fo:letter-spacing">
  3148. <xsl:element name="字:字符间距">
  3149. <xsl:attribute name="uof:locID">t0104</xsl:attribute>
  3150. <xsl:value-of select="substring-before(style:text-properties/@fo:letter-spacing,$uofUnit)"/>
  3151. </xsl:element>
  3152. </xsl:if>
  3153. <xsl:if test="style:text-properties/@style:letter-kerning">
  3154. <xsl:element name="字:调整字间距">
  3155. <xsl:variable name="tt" select="style:text-properties/@style:letter-kerning"/>
  3156. <xsl:attribute name="uof:locID">t0105</xsl:attribute>
  3157. <xsl:choose>
  3158. <xsl:when test="$tt='true'">1</xsl:when>
  3159. <xsl:otherwise>0</xsl:otherwise>
  3160. </xsl:choose>
  3161. </xsl:element>
  3162. </xsl:if>
  3163. <xsl:element name="字:字符对齐网格">
  3164. <xsl:attribute name="字:值">false</xsl:attribute>
  3165. <xsl:attribute name="uof:locID">t0106</xsl:attribute>
  3166. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3167. </xsl:element>
  3168. </xsl:template>
  3169. <xsl:template name="uof:线型类型">
  3170. <xsl:variable name="spath" select="style:text-properties/@style:text-underline-style"/>
  3171. <xsl:variable name="wpath" select="style:text-properties/@style:text-underline-width"/>
  3172. <xsl:variable name="tpath" select="style:text-properties/@style:text-underline-type"/>
  3173. <xsl:choose>
  3174. <xsl:when test="$spath='solid' and not($tpath='double' ) and $wpath='auto' ">single</xsl:when>
  3175. <xsl:when test="$spath='solid' and $tpath='double' and $wpath='auto' ">double</xsl:when>
  3176. <xsl:when test="$spath='solid' and not($tpath='double' )and $wpath='bold' ">thick</xsl:when>
  3177. <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='auto' ">dotted</xsl:when>
  3178. <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='bold' ">dotted-heavy</xsl:when>
  3179. <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='auto' ">dash</xsl:when>
  3180. <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='bold' ">dashed-heavy</xsl:when>
  3181. <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='auto' ">dash-long</xsl:when>
  3182. <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='bold' ">dash-long-heavy</xsl:when>
  3183. <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dash</xsl:when>
  3184. <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-heavy</xsl:when>
  3185. <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dot-dash</xsl:when>
  3186. <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-dot-heavy</xsl:when>
  3187. <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='auto' ">wave</xsl:when>
  3188. <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='bold' ">wavy-heavy</xsl:when>
  3189. <xsl:when test="$spath='wave' and $tpath='double' and $wpath='auto' ">wavy-double</xsl:when>
  3190. <xsl:otherwise>none</xsl:otherwise>
  3191. </xsl:choose>
  3192. </xsl:template>
  3193. <xsl:template name="uof:删除线类型">
  3194. <xsl:param name="lineType"/>
  3195. <xsl:variable name="tw" select="style:text-properties/@style:text-line-through-width"/>
  3196. <xsl:variable name="tt" select="style:text-properties/@style:text-line-through-text"/>
  3197. <xsl:variable name="ttp" select="style:text-properties/@style:text-line-through-type"/>
  3198. <xsl:choose>
  3199. <xsl:when test="$lineType='solid'and $ttp='double'">double</xsl:when>
  3200. <xsl:when test="$lineType='solid'and $tw='bold'">bold</xsl:when>
  3201. <xsl:when test="$lineType='solid'and $tt='X'">xl</xsl:when>
  3202. <xsl:when test="$lineType='solid'and $tt='/'">/l</xsl:when>
  3203. <xsl:otherwise>
  3204. <xsl:if test="not($lineType='none') ">single</xsl:if>
  3205. </xsl:otherwise>
  3206. </xsl:choose>
  3207. </xsl:template>
  3208. <xsl:template name="uof:着重号类型">
  3209. <xsl:param name="te"/>
  3210. <xsl:choose>
  3211. <xsl:when test="$te='disc above' ">disc above</xsl:when>
  3212. <xsl:when test="$te='circle above' ">circle above</xsl:when>
  3213. <xsl:when test="$te='dot above' ">dot above</xsl:when>
  3214. <xsl:when test="$te='accent above' ">accent above</xsl:when>
  3215. <xsl:when test="$te='dot below' ">dot</xsl:when>
  3216. <xsl:when test="$te='circle below' ">circle below</xsl:when>
  3217. <xsl:when test="$te='disc below' ">disc below</xsl:when>
  3218. <xsl:when test="$te='accent below' ">accent below</xsl:when>
  3219. <xsl:otherwise>none</xsl:otherwise>
  3220. </xsl:choose>
  3221. </xsl:template>
  3222. <xsl:template name="uof:边框">
  3223. <xsl:choose>
  3224. <xsl:when test="@fo:border">
  3225. <xsl:call-template name="uof:左边框">
  3226. <xsl:with-param name="border" select="@fo:border"/>
  3227. </xsl:call-template>
  3228. <xsl:call-template name="uof:上边框">
  3229. <xsl:with-param name="border" select="@fo:border"/>
  3230. </xsl:call-template>
  3231. <xsl:call-template name="uof:右边框">
  3232. <xsl:with-param name="border" select="@fo:border"/>
  3233. </xsl:call-template>
  3234. <xsl:call-template name="uof:下边框">
  3235. <xsl:with-param name="border" select="@fo:border"/>
  3236. </xsl:call-template>
  3237. </xsl:when>
  3238. <xsl:otherwise>
  3239. <xsl:if test="@fo:border-left or contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
  3240. <xsl:call-template name="uof:左边框">
  3241. <xsl:with-param name="border" select="@fo:border-left"/>
  3242. </xsl:call-template>
  3243. </xsl:if>
  3244. <xsl:if test="@fo:border-top or contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
  3245. <xsl:call-template name="uof:上边框">
  3246. <xsl:with-param name="border" select="@fo:border-top"/>
  3247. </xsl:call-template>
  3248. </xsl:if>
  3249. <xsl:if test="@fo:border-right or substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
  3250. <xsl:call-template name="uof:右边框">
  3251. <xsl:with-param name="border" select="@fo:border-right"/>
  3252. </xsl:call-template>
  3253. </xsl:if>
  3254. <xsl:if test="@fo:border-bottom or substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
  3255. <xsl:call-template name="uof:下边框">
  3256. <xsl:with-param name="border" select="@fo:border-bottom"/>
  3257. </xsl:call-template>
  3258. </xsl:if>
  3259. </xsl:otherwise>
  3260. </xsl:choose>
  3261. </xsl:template>
  3262. <xsl:template name="uof:左边框">
  3263. <xsl:param name="border"/>
  3264. <xsl:element name="uof:左">
  3265. <xsl:attribute name="uof:locID">u0057</xsl:attribute>
  3266. <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
  3267. <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3268. <xsl:if test="$border!='none'">
  3269. <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
  3270. <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
  3271. <xsl:if test="@fo:padding or @fo:padding-left">
  3272. <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-left"><xsl:value-of select="substring-before(@fo:padding-left,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3273. </xsl:if>
  3274. </xsl:if>
  3275. <xsl:if test="contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
  3276. <xsl:attribute name="uof:阴影">true</xsl:attribute>
  3277. </xsl:if>
  3278. </xsl:element>
  3279. </xsl:template>
  3280. <xsl:template name="uof:上边框">
  3281. <xsl:param name="border"/>
  3282. <xsl:element name="uof:上">
  3283. <xsl:attribute name="uof:locID">u0058</xsl:attribute>
  3284. <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
  3285. <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3286. <xsl:if test="$border!='none'">
  3287. <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
  3288. <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
  3289. <xsl:if test="@fo:padding or @fo:padding-top">
  3290. <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-top"><xsl:value-of select="substring-before(@fo:padding-top,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3291. </xsl:if>
  3292. </xsl:if>
  3293. <xsl:if test="contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
  3294. <xsl:attribute name="uof:阴影">true</xsl:attribute>
  3295. </xsl:if>
  3296. </xsl:element>
  3297. </xsl:template>
  3298. <xsl:template name="uof:右边框">
  3299. <xsl:param name="border"/>
  3300. <xsl:element name="uof:右">
  3301. <xsl:attribute name="uof:locID">u0059</xsl:attribute>
  3302. <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
  3303. <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3304. <xsl:if test="$border!='none'">
  3305. <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
  3306. <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
  3307. <xsl:if test="@fo:padding or @fo:padding-right">
  3308. <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-right"><xsl:value-of select="substring-before(@fo:padding-right,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3309. </xsl:if>
  3310. </xsl:if>
  3311. <xsl:if test="substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
  3312. <xsl:attribute name="uof:阴影">true</xsl:attribute>
  3313. </xsl:if>
  3314. </xsl:element>
  3315. </xsl:template>
  3316. <xsl:template name="uof:下边框">
  3317. <xsl:param name="border"/>
  3318. <xsl:element name="uof:下">
  3319. <xsl:attribute name="uof:locID">u0060</xsl:attribute>
  3320. <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
  3321. <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  3322. <xsl:if test="$border!='none'">
  3323. <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
  3324. <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
  3325. <xsl:if test="@fo:padding or @fo:padding-bottom">
  3326. <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-bottom"><xsl:value-of select="substring-before(@fo:padding-bottom,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3327. </xsl:if>
  3328. </xsl:if>
  3329. <xsl:if test="substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
  3330. <xsl:attribute name="uof:阴影">true</xsl:attribute>
  3331. </xsl:if>
  3332. </xsl:element>
  3333. </xsl:template>
  3334. <xsl:key name="geshi" match="//office:document/office:automatic-styles/number:date-style | //office:document/office:automatic-styles/number:time-style" use="@style:name"/>
  3335. <xsl:template name="inline-text">
  3336. <xsl:param name="pStyleName"/>
  3337. <xsl:param name="bText"/>
  3338. <xsl:apply-templates select="text()|textspan|jiaozhu|weizhu|office:annotation|text:sequence|text:date|text:time|text:page-number|text:page-count|text:subject|text:title|text:initial-creator|text:author-name|text:author-initials|text:file-name|text:change-start|text:change-end|text:change">
  3339. <xsl:with-param name="pStyleName" select="$pStyleName"/>
  3340. <xsl:with-param name="bText" select="$bText"/>
  3341. </xsl:apply-templates>
  3342. </xsl:template>
  3343. <xsl:template match="text:sequence">
  3344. <xsl:param name="tStyle"/>
  3345. <xsl:if test="@text:name='Illustration' or @text:name='Text' or @text:name='Drawing' or @text:name='Table'">
  3346. <xsl:element name="字:域开始">
  3347. <xsl:attribute name="字:类型"><xsl:value-of select="'seq'"/></xsl:attribute>
  3348. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3349. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3350. </xsl:element>
  3351. <xsl:element name="字:域代码">
  3352. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3353. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3354. <字:句 uof:locID="t0085">
  3355. <xsl:if test="$tStyle!=''">
  3356. <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
  3357. </xsl:if>
  3358. <xsl:variable name="fmt">
  3359. <xsl:call-template name="oo数字格式域开关">
  3360. <xsl:with-param name="oo_format" select="@style:num-format"/>
  3361. </xsl:call-template>
  3362. </xsl:variable>
  3363. <字:文本串>
  3364. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3365. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3366. <xsl:value-of select="concat('SEQ ',@text:name,' \* ',$fmt,' \f ',@text:formula)"/>
  3367. </字:文本串>
  3368. </字:句>
  3369. </字:段落>
  3370. </xsl:element>
  3371. <字:句 uof:locID="t0085">
  3372. <字:文本串>
  3373. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3374. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3375. <xsl:value-of select="string(.)"/>
  3376. </字:文本串>
  3377. </字:句>
  3378. <xsl:element name="字:域结束">
  3379. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3380. </xsl:element>
  3381. </xsl:if>
  3382. </xsl:template>
  3383. <xsl:template match="text:time">
  3384. <xsl:element name="字:域开始">
  3385. <xsl:attribute name="字:类型"><xsl:value-of select="'time'"/></xsl:attribute>
  3386. <xsl:choose>
  3387. <xsl:when test="text:fixed='1'">
  3388. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3389. </xsl:when>
  3390. <xsl:otherwise>
  3391. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3392. </xsl:otherwise>
  3393. </xsl:choose>
  3394. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3395. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3396. </xsl:element>
  3397. <xsl:element name="字:域代码">
  3398. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3399. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3400. <字:句 uof:locID="t0085">
  3401. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3402. <xsl:variable name="timefmt">
  3403. <xsl:variable name="aa" select="@style:data-style-name"/>
  3404. <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
  3405. <xsl:choose>
  3406. <xsl:when test="@number:style='long' ">
  3407. <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
  3408. <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
  3409. <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
  3410. </xsl:when>
  3411. <xsl:otherwise>
  3412. <xsl:if test="self::node( )[name(.)='number:text']">
  3413. <xsl:value-of select="."/>
  3414. </xsl:if>
  3415. <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
  3416. <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
  3417. <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
  3418. <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
  3419. </xsl:otherwise>
  3420. </xsl:choose>
  3421. </xsl:for-each>
  3422. </xsl:variable>
  3423. <xsl:variable name="quote">"</xsl:variable>
  3424. <字:文本串>
  3425. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3426. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3427. <xsl:value-of select="concat('TIME \@ ',$quote,$timefmt,$quote)"/>
  3428. </字:文本串>
  3429. </字:句>
  3430. </字:段落>
  3431. </xsl:element>
  3432. <字:句 uof:locID="t0085">
  3433. <字:文本串>
  3434. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3435. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3436. <xsl:value-of select="string(.)"/>
  3437. </字:文本串>
  3438. </字:句>
  3439. <xsl:element name="字:域结束">
  3440. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3441. </xsl:element>
  3442. </xsl:template>
  3443. <xsl:template match="text:date">
  3444. <xsl:element name="字:域开始">
  3445. <xsl:attribute name="字:类型"><xsl:value-of select="'date'"/></xsl:attribute>
  3446. <xsl:choose>
  3447. <xsl:when test="text:fixed='1'">
  3448. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3449. </xsl:when>
  3450. <xsl:otherwise>
  3451. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3452. </xsl:otherwise>
  3453. </xsl:choose>
  3454. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3455. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3456. </xsl:element>
  3457. <xsl:element name="字:域代码">
  3458. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3459. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3460. <字:句 uof:locID="t0085">
  3461. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3462. <xsl:variable name="datefmt">
  3463. <xsl:variable name="bb" select="@style:data-style-name"/>
  3464. <xsl:for-each select="key('geshi',$bb)/number:year | key('geshi',$bb)/number:month | key('geshi',$bb)/number:day | key('geshi',$bb)/number:hours | key('geshi',$bb)/number:minutes | key('geshi',$bb)/number:seconds | key('geshi',$bb)/number:quarter | key('geshi',$bb)/number:day-of-week | key('geshi',$bb)/number:week-of-year | key('geshi',$bb)/number:text | key('geshi',$bb)/number:am-pm">
  3465. <xsl:choose>
  3466. <xsl:when test="@number:style='long' ">
  3467. <xsl:if test="self::node( )[name(.)='number:year']">yyyy</xsl:if>
  3468. <xsl:if test="self::node( )[name(.)='number:month']">MM</xsl:if>
  3469. <xsl:if test="self::node( )[name(.)='number:day']">dd</xsl:if>
  3470. <xsl:if test="self::node( )[name(.)='number:hours']">hh</xsl:if>
  3471. <xsl:if test="self::node( )[name(.)='number:minutes']">mm</xsl:if>
  3472. <xsl:if test="self::node( )[name(.)='number:seconds']">ss</xsl:if>
  3473. <xsl:if test="self::node( )[name(.)='number:quarter']">第QQ季度</xsl:if>
  3474. <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
  3475. <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
  3476. </xsl:when>
  3477. <xsl:otherwise>
  3478. <xsl:if test="self::node( )[name(.)='number:text']">
  3479. <xsl:value-of select="."/>
  3480. </xsl:if>
  3481. <xsl:if test="self::node( )[name(.)='number:year']">yy</xsl:if>
  3482. <xsl:if test="self::node( )[name(.)='number:month']">M</xsl:if>
  3483. <xsl:if test="self::node( )[name(.)='number:day']">d</xsl:if>
  3484. <xsl:if test="self::node( )[name(.)='number:hours']">h</xsl:if>
  3485. <xsl:if test="self::node( )[name(.)='number:minutes']">m</xsl:if>
  3486. <xsl:if test="self::node( )[name(.)='number:seconds']">s</xsl:if>
  3487. <xsl:if test="self::node( )[name(.)='number:quarter']">Q季</xsl:if>
  3488. <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
  3489. <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
  3490. <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
  3491. </xsl:otherwise>
  3492. </xsl:choose>
  3493. </xsl:for-each>
  3494. </xsl:variable>
  3495. <xsl:variable name="quote">"</xsl:variable>
  3496. <字:文本串>
  3497. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3498. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3499. <xsl:value-of select="concat('CREATEDATE \@ ',$quote,$datefmt,$quote)"/>
  3500. </字:文本串>
  3501. </字:句>
  3502. </字:段落>
  3503. </xsl:element>
  3504. <字:句 uof:locID="t0085">
  3505. <字:文本串>
  3506. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3507. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3508. <xsl:value-of select="string(.)"/>
  3509. </字:文本串>
  3510. </字:句>
  3511. <xsl:element name="字:域结束">
  3512. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3513. </xsl:element>
  3514. </xsl:template>
  3515. <xsl:template name="oo数字格式域开关">
  3516. <xsl:param name="oo_format"/>
  3517. <xsl:choose>
  3518. <xsl:when test="$oo_format='1'">Arabic</xsl:when>
  3519. <xsl:when test="$oo_format='I'">ROMAN</xsl:when>
  3520. <xsl:when test="$oo_format='i'">roman</xsl:when>
  3521. <xsl:when test="$oo_format='A'">ALPHABETIC</xsl:when>
  3522. <xsl:when test="$oo_format='a'">alphabetic</xsl:when>
  3523. <xsl:when test="$oo_format='1, 2, 3, ...'">GB1</xsl:when>
  3524. <xsl:when test="$oo_format='①, ②, ③, ...'">GB3</xsl:when>
  3525. <xsl:when test="$oo_format='一, 二, 三, ...'">CHINESENUM3</xsl:when>
  3526. <xsl:when test="$oo_format='壹, 贰, 叁, ...'">CHINESENUM2</xsl:when>
  3527. <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ZODIAC1</xsl:when>
  3528. <xsl:when test="$oo_format='子, 丑, 寅, ...'">ZODIAC2</xsl:when>
  3529. <xsl:otherwise>Arabic</xsl:otherwise>
  3530. </xsl:choose>
  3531. </xsl:template>
  3532. <xsl:template match="text:page-number">
  3533. <xsl:element name="字:域开始">
  3534. <xsl:attribute name="字:类型"><xsl:value-of select="'page'"/></xsl:attribute>
  3535. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3536. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3537. <xsl:choose>
  3538. <xsl:when test="text:fixed='1'">
  3539. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3540. </xsl:when>
  3541. <xsl:otherwise>
  3542. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3543. </xsl:otherwise>
  3544. </xsl:choose>
  3545. </xsl:element>
  3546. <xsl:element name="字:域代码">
  3547. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3548. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3549. <字:句 uof:locID="t0085">
  3550. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3551. <xsl:variable name="fmt">
  3552. <xsl:call-template name="oo数字格式域开关">
  3553. <xsl:with-param name="oo_format" select="@style:num-format"/>
  3554. </xsl:call-template>
  3555. </xsl:variable>
  3556. <字:文本串>
  3557. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3558. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3559. <xsl:choose>
  3560. <xsl:when test="@style:num-format">
  3561. <xsl:value-of select="concat('PAGE \* ',$fmt)"/>
  3562. </xsl:when>
  3563. <xsl:otherwise>PAGE</xsl:otherwise>
  3564. </xsl:choose>
  3565. </字:文本串>
  3566. </字:句>
  3567. </字:段落>
  3568. </xsl:element>
  3569. <字:句 uof:locID="t0085">
  3570. <字:文本串>
  3571. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3572. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3573. <xsl:value-of select="string(.)"/>
  3574. </字:文本串>
  3575. </字:句>
  3576. <xsl:element name="字:域结束">
  3577. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3578. </xsl:element>
  3579. </xsl:template>
  3580. <xsl:template match="text:page-count">
  3581. <xsl:element name="字:域开始">
  3582. <xsl:attribute name="字:类型"><xsl:value-of select="'numpages'"/></xsl:attribute>
  3583. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3584. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3585. <xsl:choose>
  3586. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3587. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3588. </xsl:when>
  3589. <xsl:otherwise>
  3590. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3591. </xsl:otherwise>
  3592. </xsl:choose>
  3593. </xsl:element>
  3594. <xsl:element name="字:域代码">
  3595. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3596. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3597. <字:句 uof:locID="t0085">
  3598. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3599. <xsl:variable name="fmt">
  3600. <xsl:call-template name="oo数字格式域开关">
  3601. <xsl:with-param name="oo_format" select="@style:num-format"/>
  3602. </xsl:call-template>
  3603. </xsl:variable>
  3604. <字:文本串>
  3605. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3606. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3607. <xsl:choose>
  3608. <xsl:when test="@style:num-format">
  3609. <xsl:value-of select="concat('NumPages \* ',$fmt,' \* Upper')"/>
  3610. </xsl:when>
  3611. <xsl:otherwise>NumPages</xsl:otherwise>
  3612. </xsl:choose>
  3613. </字:文本串>
  3614. </字:句>
  3615. </字:段落>
  3616. </xsl:element>
  3617. <字:句 uof:locID="t0085">
  3618. <字:文本串>
  3619. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3620. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3621. <xsl:value-of select="string(.)"/>
  3622. </字:文本串>
  3623. </字:句>
  3624. <xsl:element name="字:域结束">
  3625. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3626. </xsl:element>
  3627. </xsl:template>
  3628. <xsl:template match="text:initial-creator">
  3629. <xsl:element name="字:域开始">
  3630. <xsl:attribute name="字:类型"><xsl:value-of select="'author'"/></xsl:attribute>
  3631. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3632. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3633. <xsl:choose>
  3634. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3635. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3636. </xsl:when>
  3637. <xsl:otherwise>
  3638. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3639. </xsl:otherwise>
  3640. </xsl:choose>
  3641. </xsl:element>
  3642. <xsl:element name="字:域代码">
  3643. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3644. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3645. <字:句 uof:locID="t0085">
  3646. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3647. <字:文本串>
  3648. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3649. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3650. <!--xsl:value-of select="concat('AUTHOR \* ','Caps',' \* MERGEFORMAT')"/-->
  3651. <xsl:value-of select="'AUTHOR'"/>
  3652. </字:文本串>
  3653. </字:句>
  3654. </字:段落>
  3655. </xsl:element>
  3656. <字:句 uof:locID="t0085">
  3657. <字:文本串>
  3658. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3659. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3660. <xsl:value-of select="string(.)"/>
  3661. </字:文本串>
  3662. </字:句>
  3663. <xsl:element name="字:域结束">
  3664. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3665. </xsl:element>
  3666. </xsl:template>
  3667. <xsl:template match="text:author-name">
  3668. <xsl:param name="tStyle"/>
  3669. <xsl:element name="字:域开始">
  3670. <xsl:attribute name="字:类型"><xsl:value-of select="'username'"/></xsl:attribute>
  3671. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3672. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3673. <xsl:choose>
  3674. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3675. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3676. </xsl:when>
  3677. <xsl:otherwise>
  3678. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3679. </xsl:otherwise>
  3680. </xsl:choose>
  3681. </xsl:element>
  3682. <xsl:element name="字:域代码">
  3683. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3684. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3685. <字:句 uof:locID="t0085">
  3686. <xsl:if test="$tStyle!=''">
  3687. <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
  3688. </xsl:if>
  3689. <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
  3690. </字:句>
  3691. </字:段落>
  3692. </xsl:element>
  3693. <字:句 uof:locID="t0085">
  3694. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3695. <xsl:value-of select="."/>
  3696. </字:文本串>
  3697. </字:句>
  3698. <xsl:element name="字:域结束">
  3699. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3700. </xsl:element>
  3701. </xsl:template>
  3702. <xsl:template match="text:author-initials">
  3703. <xsl:param name="tStyle"/>
  3704. <xsl:element name="字:域开始">
  3705. <xsl:attribute name="字:类型"><xsl:value-of select="'userinitials'"/></xsl:attribute>
  3706. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3707. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3708. <xsl:choose>
  3709. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3710. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3711. </xsl:when>
  3712. <xsl:otherwise>
  3713. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3714. </xsl:otherwise>
  3715. </xsl:choose>
  3716. </xsl:element>
  3717. <xsl:element name="字:域代码">
  3718. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3719. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3720. <字:句 uof:locID="t0085">
  3721. <xsl:if test="$tStyle!=''">
  3722. <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
  3723. </xsl:if>
  3724. <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
  3725. </字:句>
  3726. </字:段落>
  3727. </xsl:element>
  3728. <字:句 uof:locID="t0085">
  3729. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3730. <xsl:value-of select="."/>
  3731. </字:文本串>
  3732. </字:句>
  3733. <xsl:element name="字:域结束">
  3734. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3735. </xsl:element>
  3736. </xsl:template>
  3737. <xsl:template match="text:title">
  3738. <xsl:element name="字:域开始">
  3739. <xsl:attribute name="字:类型"><xsl:value-of select="'title'"/></xsl:attribute>
  3740. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3741. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3742. <xsl:choose>
  3743. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3744. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3745. </xsl:when>
  3746. <xsl:otherwise>
  3747. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3748. </xsl:otherwise>
  3749. </xsl:choose>
  3750. </xsl:element>
  3751. <xsl:element name="字:域代码">
  3752. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3753. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3754. <字:句 uof:locID="t0085">
  3755. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3756. <xsl:variable name="titlename" select="/office:document/office:meta/dc:title"/>
  3757. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3758. <xsl:value-of select="concat('TITLE',' \* Upper')"/>
  3759. </字:文本串>
  3760. </字:句>
  3761. </字:段落>
  3762. </xsl:element>
  3763. <字:句 uof:locID="t0085">
  3764. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3765. <xsl:value-of select="."/>
  3766. </字:文本串>
  3767. </字:句>
  3768. <xsl:element name="字:域结束">
  3769. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3770. </xsl:element>
  3771. </xsl:template>
  3772. <xsl:template match="text:subject">
  3773. <xsl:element name="字:域开始">
  3774. <xsl:attribute name="字:类型"><xsl:value-of select="'subject'"/></xsl:attribute>
  3775. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3776. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3777. <xsl:choose>
  3778. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3779. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3780. </xsl:when>
  3781. <xsl:otherwise>
  3782. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3783. </xsl:otherwise>
  3784. </xsl:choose>
  3785. </xsl:element>
  3786. <xsl:element name="字:域代码">
  3787. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3788. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3789. <字:句 uof:locID="t0085">
  3790. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3791. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3792. <xsl:value-of select="concat('SUBJECT \* ','Caps',' \* MERGEFORMAT')"/>
  3793. </字:文本串>
  3794. </字:句>
  3795. </字:段落>
  3796. </xsl:element>
  3797. <字:句 uof:locID="t0085">
  3798. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3799. <xsl:value-of select="."/>
  3800. </字:文本串>
  3801. </字:句>
  3802. <xsl:element name="字:域结束">
  3803. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3804. </xsl:element>
  3805. </xsl:template>
  3806. <xsl:template match="text:file-name">
  3807. <xsl:element name="字:域开始">
  3808. <xsl:attribute name="字:类型"><xsl:value-of select="'filename'"/></xsl:attribute>
  3809. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3810. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3811. <xsl:choose>
  3812. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3813. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3814. </xsl:when>
  3815. <xsl:otherwise>
  3816. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3817. </xsl:otherwise>
  3818. </xsl:choose>
  3819. </xsl:element>
  3820. <xsl:element name="字:域代码">
  3821. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3822. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3823. <字:句 uof:locID="t0085">
  3824. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3825. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3826. <!--xsl:value-of select="concat('FILENAME \* ','Caps',' \* MERGEFORMAT')"/-->
  3827. <xsl:value-of select="concat('FILENAME',' \p')"/>
  3828. </字:文本串>
  3829. </字:句>
  3830. </字:段落>
  3831. </xsl:element>
  3832. <字:句 uof:locID="t0085">
  3833. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  3834. <xsl:value-of select="."/>
  3835. </字:文本串>
  3836. </字:句>
  3837. <xsl:element name="字:域结束">
  3838. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3839. </xsl:element>
  3840. </xsl:template>
  3841. <xsl:template match="text:editing-duration">
  3842. <xsl:element name="字:域开始">
  3843. <xsl:attribute name="字:类型"><xsl:value-of select="'edittime'"/></xsl:attribute>
  3844. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3845. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3846. <xsl:choose>
  3847. <xsl:when test="text:fixed='1'or text:fixed='true'">
  3848. <xsl:attribute name="字:锁定">true</xsl:attribute>
  3849. </xsl:when>
  3850. <xsl:otherwise>
  3851. <xsl:attribute name="字:锁定">false</xsl:attribute>
  3852. </xsl:otherwise>
  3853. </xsl:choose>
  3854. </xsl:element>
  3855. <xsl:element name="字:域代码">
  3856. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3857. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3858. <字:句 uof:locID="t0085">
  3859. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  3860. <xsl:variable name="timefmt">
  3861. <xsl:variable name="aa" select="@style:data-style-name"/>
  3862. <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
  3863. <xsl:choose>
  3864. <xsl:when test="@number:style='long' ">
  3865. <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
  3866. <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
  3867. <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
  3868. </xsl:when>
  3869. <xsl:otherwise>
  3870. <xsl:if test="self::node( )[name(.)='number:text']">
  3871. <xsl:value-of select="."/>
  3872. </xsl:if>
  3873. <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
  3874. <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
  3875. <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
  3876. <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
  3877. </xsl:otherwise>
  3878. </xsl:choose>
  3879. </xsl:for-each>
  3880. </xsl:variable>
  3881. <xsl:variable name="quote">"</xsl:variable>
  3882. <字:文本串>
  3883. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3884. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3885. <xsl:value-of select="concat('EDITTIME \@ ',$quote,$timefmt,$quote,' \* MERGEFORMAT ')"/>
  3886. </字:文本串>
  3887. </字:句>
  3888. </字:段落>
  3889. </xsl:element>
  3890. <字:句 uof:locID="t0085">
  3891. <字:文本串>
  3892. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3893. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3894. <xsl:value-of select="."/>
  3895. </字:文本串>
  3896. </字:句>
  3897. <xsl:element name="字:域结束">
  3898. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  3899. </xsl:element>
  3900. </xsl:template>
  3901. <xsl:key name="path" match="//office:document/office:automatic-styles/style:style" use="@style:name"/>
  3902. <xsl:template name="text:table-of-content">
  3903. <xsl:element name="字:段落">
  3904. <xsl:attribute name="uof:locID">t0051</xsl:attribute>
  3905. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3906. <xsl:element name="字:段落属性">
  3907. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  3908. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  3909. <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
  3910. <xsl:element name="字:制表位设置">
  3911. <xsl:attribute name="uof:locID">t0067</xsl:attribute>
  3912. <xsl:element name="字:制表位">
  3913. <xsl:attribute name="uof:locID">t0068</xsl:attribute>
  3914. <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
  3915. <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
  3916. <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
  3917. <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
  3918. <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
  3919. <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
  3920. <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
  3921. </xsl:if>
  3922. </xsl:element>
  3923. </xsl:element>
  3924. <xsl:element name="字:是否行首标点压缩">
  3925. <xsl:attribute name="uof:locID">t0075</xsl:attribute>
  3926. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3927. <xsl:attribute name="字:值">true</xsl:attribute>
  3928. </xsl:element>
  3929. <xsl:element name="字:中文习惯首尾字符">
  3930. <xsl:attribute name="字:值">true</xsl:attribute>
  3931. <xsl:attribute name="uof:locID">t0076</xsl:attribute>
  3932. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3933. </xsl:element>
  3934. </xsl:element>
  3935. <xsl:element name="字:域开始">
  3936. <xsl:attribute name="字:类型"><xsl:value-of select="'REF'"/></xsl:attribute>
  3937. <xsl:if test="@text:protected">
  3938. <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
  3939. </xsl:if>
  3940. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  3941. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  3942. </xsl:element>
  3943. <xsl:element name="字:域代码">
  3944. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  3945. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  3946. <字:句 uof:locID="t0085">
  3947. <字:文本串>
  3948. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3949. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3950. <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
  3951. </字:文本串>
  3952. </字:句>
  3953. </字:段落>
  3954. <xsl:for-each select="text:index-body/text:index-title/text:p">
  3955. <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
  3956. <xsl:element name="字:段落属性">
  3957. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  3958. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  3959. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  3960. </xsl:element>
  3961. <xsl:element name="字:句">
  3962. <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
  3963. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  3964. </字:句属性>
  3965. <xsl:element name="字:文本串">
  3966. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  3967. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  3968. <xsl:value-of select="self::node()"/>
  3969. </xsl:element>
  3970. </xsl:element>
  3971. </xsl:element>
  3972. </xsl:for-each>
  3973. <xsl:for-each select="text:index-body/text:p">
  3974. <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
  3975. <xsl:element name="字:段落属性">
  3976. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  3977. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  3978. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  3979. <xsl:element name="字:制表位设置">
  3980. <xsl:attribute name="uof:locID">t0067</xsl:attribute>
  3981. <xsl:element name="字:制表位">
  3982. <xsl:attribute name="uof:locID">t0068</xsl:attribute>
  3983. <xsl:attribute name="uof:attrList">位置 类型 前导符</xsl:attribute>
  3984. <xsl:variable name="aa" select="@text:style-name"/>
  3985. <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
  3986. <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
  3987. <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
  3988. <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
  3989. <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
  3990. </xsl:if>
  3991. </xsl:element>
  3992. </xsl:element>
  3993. <xsl:element name="字:是否行首标点压缩">
  3994. <xsl:attribute name="uof:locID">t0075</xsl:attribute>
  3995. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  3996. <xsl:attribute name="字:值">true</xsl:attribute>
  3997. </xsl:element>
  3998. <xsl:element name="字:中文习惯首尾字符">
  3999. <xsl:attribute name="字:值">true</xsl:attribute>
  4000. <xsl:attribute name="uof:locID">t0076</xsl:attribute>
  4001. <xsl:attribute name="uof:attrList">值</xsl:attribute>
  4002. </xsl:element>
  4003. </xsl:element>
  4004. <xsl:if test="self::node()/text:a">
  4005. <字:句 uof:locID="t0085">
  4006. <xsl:variable name="num">
  4007. <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/>
  4008. </xsl:variable>
  4009. <xsl:element name="字:区域开始">
  4010. <xsl:attribute name="字:标识符"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
  4011. <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
  4012. <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
  4013. <xsl:attribute name="uof:locID">t0121</xsl:attribute>
  4014. <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
  4015. </xsl:element>
  4016. <xsl:for-each select="text:a/node()">
  4017. <xsl:choose>
  4018. <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
  4019. <xsl:element name="字:制表符" uof:locID="t0123"/>
  4020. </xsl:when>
  4021. <xsl:otherwise>
  4022. <xsl:element name="字:文本串">
  4023. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  4024. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4025. <xsl:value-of select="."/>
  4026. </xsl:element>
  4027. </xsl:otherwise>
  4028. </xsl:choose>
  4029. </xsl:for-each>
  4030. <xsl:element name="字:区域结束">
  4031. <xsl:attribute name="字:标识符引用"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
  4032. <xsl:attribute name="uof:locID">t0122</xsl:attribute>
  4033. <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
  4034. </xsl:element>
  4035. <xsl:variable name="stt">
  4036. <xsl:value-of select="./text:a"/>
  4037. </xsl:variable>
  4038. <xsl:variable name="end">
  4039. <xsl:value-of select="."/>
  4040. </xsl:variable>
  4041. <xsl:variable name="bijiao">
  4042. <xsl:value-of select="substring-after($end,$stt)"/>
  4043. </xsl:variable>
  4044. <xsl:if test="not($bijiao='')">
  4045. <xsl:element name="字:文本串">
  4046. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  4047. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4048. <xsl:value-of select="$bijiao"/>
  4049. </xsl:element>
  4050. </xsl:if>
  4051. </字:句>
  4052. </xsl:if>
  4053. </xsl:element>
  4054. </xsl:for-each>
  4055. </xsl:element>
  4056. <xsl:element name="字:域结束">
  4057. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  4058. </xsl:element>
  4059. </xsl:element>
  4060. </xsl:template>
  4061. <xsl:template name="text:alphabetical-index">
  4062. <xsl:element name="字:段落">
  4063. <xsl:attribute name="uof:locID">t0051</xsl:attribute>
  4064. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4065. <xsl:element name="字:段落属性">
  4066. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  4067. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  4068. <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
  4069. <xsl:element name="字:制表位设置">
  4070. <xsl:attribute name="uof:locID">t0067</xsl:attribute>
  4071. <xsl:element name="字:制表位">
  4072. <xsl:attribute name="uof:locID">t0068</xsl:attribute>
  4073. <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
  4074. <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
  4075. <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
  4076. <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
  4077. <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
  4078. <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
  4079. <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
  4080. </xsl:if>
  4081. </xsl:element>
  4082. </xsl:element>
  4083. </xsl:element>
  4084. <xsl:element name="字:域开始">
  4085. <xsl:attribute name="字:类型"><xsl:value-of select="'INDEX'"/></xsl:attribute>
  4086. <xsl:if test="@text:protected">
  4087. <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
  4088. </xsl:if>
  4089. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  4090. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  4091. </xsl:element>
  4092. <xsl:element name="字:域代码">
  4093. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  4094. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  4095. <字:句 uof:locID="t0085">
  4096. <字:文本串>
  4097. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  4098. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4099. <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
  4100. </字:文本串>
  4101. </字:句>
  4102. </字:段落>
  4103. <xsl:for-each select="text:index-body/text:index-title/text:p">
  4104. <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
  4105. <xsl:element name="字:段落属性">
  4106. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  4107. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  4108. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  4109. </xsl:element>
  4110. <xsl:element name="字:句">
  4111. <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
  4112. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  4113. </字:句属性>
  4114. <xsl:element name="字:文本串">
  4115. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4116. <xsl:value-of select="self::node()"/>
  4117. </xsl:element>
  4118. </xsl:element>
  4119. </xsl:element>
  4120. </xsl:for-each>
  4121. <xsl:for-each select="text:index-body/text:p">
  4122. <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
  4123. <xsl:element name="字:段落属性">
  4124. <xsl:attribute name="uof:locID">t0052</xsl:attribute>
  4125. <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
  4126. <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
  4127. <xsl:element name="字:制表位设置">
  4128. <xsl:attribute name="uof:locID">t0067</xsl:attribute>
  4129. <xsl:element name="字:制表位">
  4130. <xsl:attribute name="uof:locID">t0068</xsl:attribute>
  4131. <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
  4132. <xsl:variable name="aa" select="@text:style-name"/>
  4133. <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
  4134. <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
  4135. <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
  4136. <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
  4137. <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
  4138. </xsl:if>
  4139. </xsl:element>
  4140. </xsl:element>
  4141. </xsl:element>
  4142. <xsl:for-each select="node()">
  4143. <字:句 uof:locID="t0085">
  4144. <xsl:choose>
  4145. <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
  4146. <xsl:element name="字:制表符" uof:locID="t0123"/>
  4147. </xsl:when>
  4148. <xsl:otherwise>
  4149. <xsl:element name="字:文本串">
  4150. <xsl:attribute name="uof:locID">t0109</xsl:attribute>
  4151. <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
  4152. <xsl:value-of select="."/>
  4153. </xsl:element>
  4154. </xsl:otherwise>
  4155. </xsl:choose>
  4156. </字:句>
  4157. </xsl:for-each>
  4158. </xsl:element>
  4159. </xsl:for-each>
  4160. </xsl:element>
  4161. <xsl:element name="字:域结束">
  4162. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  4163. </xsl:element>
  4164. </xsl:element>
  4165. </xsl:template>
  4166. <xsl:template name="oo数字格式">
  4167. <xsl:param name="oo_format"/>
  4168. <xsl:choose>
  4169. <xsl:when test="$oo_format='1'">decimal</xsl:when>
  4170. <xsl:when test="$oo_format='I'">upper-roman</xsl:when>
  4171. <xsl:when test="$oo_format='i'">lower-roman</xsl:when>
  4172. <xsl:when test="$oo_format='A'">upper-letter</xsl:when>
  4173. <xsl:when test="$oo_format='a'">lower-letter</xsl:when>
  4174. <xsl:when test="$oo_format='1, 2, 3, ...'">decimal-full-width</xsl:when>
  4175. <xsl:when test="$oo_format='①, ②, ③, ...'">decimal-enclosed-circle</xsl:when>
  4176. <xsl:when test="$oo_format='一, 二, 三, ...'">chinese-counting</xsl:when>
  4177. <xsl:when test="$oo_format='壹, 贰, 叁, ...'">chinese-legal-simplified</xsl:when>
  4178. <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ideograph-traditional</xsl:when>
  4179. <xsl:when test="$oo_format='子, 丑, 寅, ...'">ideograph-zodiac</xsl:when>
  4180. <xsl:otherwise>decimal</xsl:otherwise>
  4181. </xsl:choose>
  4182. </xsl:template>
  4183. <xsl:template name="图:填充">
  4184. <xsl:param name="style-name"/>
  4185. <xsl:choose>
  4186. <xsl:when test="style:background-image/office:binary-data">
  4187. <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
  4188. <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:background-image/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:background-image/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:background-image/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:background-image/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
  4189. <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
  4190. <xsl:attribute name="图:类型">png</xsl:attribute>
  4191. <xsl:attribute name="图:名称">background-image</xsl:attribute>
  4192. </图:图片>
  4193. </xsl:when>
  4194. <xsl:when test="@fo:background-color">
  4195. <图:颜色 uof:locID="g0034">
  4196. <xsl:choose>
  4197. <xsl:when test="@fo:background-color='transparent' ">auto</xsl:when>
  4198. <xsl:otherwise>
  4199. <xsl:value-of select="@fo:background-color"/>
  4200. </xsl:otherwise>
  4201. </xsl:choose>
  4202. </图:颜色>
  4203. </xsl:when>
  4204. <xsl:when test="@draw:fill='gradient'">
  4205. </xsl:when>
  4206. <xsl:when test="@draw:fill='hatch'">
  4207. </xsl:when>
  4208. <xsl:otherwise/>
  4209. </xsl:choose>
  4210. </xsl:template>
  4211. <xsl:template name="字:缩进类型">
  4212. <xsl:if test="@text:space-before or @fo:margin-left">
  4213. <字:左 uof:locID="t0182">
  4214. <字:绝对 uof:locID="t0185" uof:attrList="值">
  4215. <xsl:if test="@text:space-before">
  4216. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:space-before,$uofUnit)"/></xsl:attribute>
  4217. </xsl:if>
  4218. <xsl:if test="@fo:margin-left">
  4219. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
  4220. </xsl:if>
  4221. </字:绝对>
  4222. </字:左>
  4223. </xsl:if>
  4224. <xsl:if test="@text:min-label-width or @fo:margin-right">
  4225. <字:右 uof:locID="t0183">
  4226. <字:绝对 uof:locID="t0187" uof:attrList="值">
  4227. <xsl:if test="@text:min-label-width">
  4228. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-width,$uofUnit)"/></xsl:attribute>
  4229. </xsl:if>
  4230. <xsl:if test="@fo:margin-right">
  4231. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
  4232. </xsl:if>
  4233. </字:绝对>
  4234. </字:右>
  4235. </xsl:if>
  4236. <xsl:if test="@text:min-label-distance or @fo:text-indent">
  4237. <字:首行 uof:locID="t0184">
  4238. <字:绝对 uof:locID="t0189" uof:attrList="值">
  4239. <xsl:if test="@text:min-label-distance">
  4240. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-distance,$uofUnit)"/></xsl:attribute>
  4241. </xsl:if>
  4242. <xsl:if test="@fo:text-indent">
  4243. <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:text-indent,$uofUnit)"/></xsl:attribute>
  4244. </xsl:if>
  4245. </字:绝对>
  4246. </字:首行>
  4247. </xsl:if>
  4248. </xsl:template>
  4249. <xsl:template name="graphsize">
  4250. <xsl:param name="width"/>
  4251. <xsl:param name="Unitofsize"/>
  4252. <xsl:if test="$Unitofsize='pt'">
  4253. <xsl:choose>
  4254. <xsl:when test="(not($width&gt;1.42) and 0&lt;$width)">1</xsl:when>
  4255. <xsl:when test="(not($width&gt;2.84) and 1.42&lt;$width)">2</xsl:when>
  4256. <xsl:when test="(not($width&gt;4.26) and 2.84&lt;$width)">3</xsl:when>
  4257. <xsl:when test="(not($width&gt;5.68) and 4.26&lt;$width)">4</xsl:when>
  4258. <xsl:when test="(not($width&gt;7.10) and 5.68&lt;$width)">5</xsl:when>
  4259. <xsl:when test="(not($width&gt;8.52) and 7.10&lt;$width)">6</xsl:when>
  4260. <xsl:when test="(not($width&gt;9.94) and 8.52&lt;$width)">7</xsl:when>
  4261. <xsl:when test="(not($width&gt;11.36) and 9.94&lt;$width)">8</xsl:when>
  4262. <xsl:otherwise>9</xsl:otherwise>
  4263. </xsl:choose>
  4264. </xsl:if>
  4265. <xsl:if test="$uofUnit='in'">
  4266. <xsl:choose>
  4267. <xsl:when test="(not($width&gt;0.02) and 0&lt;$width)">1</xsl:when>
  4268. <xsl:when test="(not($width&gt;0.04) and 0.02&lt;$width)">2</xsl:when>
  4269. <xsl:when test="(not($width&gt;0.06) and 0.04&lt;$width)">3</xsl:when>
  4270. <xsl:when test="(not($width&gt;0.08) and 0.06&lt;$width)">4</xsl:when>
  4271. <xsl:when test="(not($width&gt;0.10) and 0.08&lt;$width)">5</xsl:when>
  4272. <xsl:when test="(not($width&gt;0.12) and 0.10&lt;$width)">6</xsl:when>
  4273. <xsl:when test="(not($width&gt;0.14) and 0.12&lt;$width)">7</xsl:when>
  4274. <xsl:when test="(not($width&gt;0.16) and 0.14&lt;$width)">8</xsl:when>
  4275. <xsl:otherwise>9</xsl:otherwise>
  4276. </xsl:choose>
  4277. </xsl:if>
  4278. <xsl:if test="$uofUnit='mm'">
  4279. <xsl:choose>
  4280. <xsl:when test="(not($width&gt;0.5) and 0&lt;$width) or $width=0.5">1</xsl:when>
  4281. <xsl:when test="(not($width&gt;1.0) and 0.5&lt;$width) or $width=1.0">2</xsl:when>
  4282. <xsl:when test="(not($width&gt;1.5) and 0.10&lt;$width) or $width=1.5">3</xsl:when>
  4283. <xsl:when test="(not($width&gt;2.0) and 1.5&lt;$width) or $width=2.0">4</xsl:when>
  4284. <xsl:when test="(not($width&gt;2.5) and 2.0&lt;$width) or $width=2.5">5</xsl:when>
  4285. <xsl:when test="(not($width&gt;3.0) and 2.5&lt;$width) or $width=3.0">6</xsl:when>
  4286. <xsl:when test="(not($width&gt;3.5) and 3.0&lt;$width) or $width=3.5">7</xsl:when>
  4287. <xsl:when test="(not($width&gt;4.0) and 3.5&lt;$width) or $width=4.0">8</xsl:when>
  4288. <xsl:otherwise>9</xsl:otherwise>
  4289. </xsl:choose>
  4290. </xsl:if>
  4291. <xsl:if test="$uofUnit='cm'">
  4292. <xsl:choose>
  4293. <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
  4294. <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
  4295. <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
  4296. <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
  4297. <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
  4298. <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
  4299. <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
  4300. <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
  4301. <xsl:otherwise>9</xsl:otherwise>
  4302. </xsl:choose>
  4303. </xsl:if>
  4304. </xsl:template>
  4305. <xsl:template match="text:character-count">
  4306. <xsl:element name="字:域开始">
  4307. <xsl:attribute name="字:类型"><xsl:value-of select="'numchars'"/></xsl:attribute>
  4308. <xsl:attribute name="uof:locID">t0079</xsl:attribute>
  4309. <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
  4310. <xsl:choose>
  4311. <xsl:when test="text:fixed='1'or text:fixed='true'">
  4312. <xsl:attribute name="字:锁定">true</xsl:attribute>
  4313. </xsl:when>
  4314. <xsl:otherwise>
  4315. <xsl:attribute name="字:锁定">false</xsl:attribute>
  4316. </xsl:otherwise>
  4317. </xsl:choose>
  4318. </xsl:element>
  4319. <xsl:element name="字:域代码">
  4320. <xsl:attribute name="uof:locID">t0080</xsl:attribute>
  4321. <字:段落 uof:locID="t0051" uof:attrList="标识符">
  4322. <字:句 uof:locID="t0085">
  4323. <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
  4324. <xsl:variable name="quote" select="'&quot;'"/>
  4325. <xsl:variable name="fmt">
  4326. <xsl:call-template name="oo数字格式域开关">
  4327. <xsl:with-param name="oo_format" select="@style:num-format"/>
  4328. </xsl:call-template>
  4329. </xsl:variable>
  4330. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  4331. <xsl:value-of select="concat('NUMCHARS \* ',$fmt,' \# ',$quote,0,$quote)"/>
  4332. </字:文本串>
  4333. </字:句>
  4334. </字:段落>
  4335. </xsl:element>
  4336. <字:句 uof:locID="t0085">
  4337. <字:文本串 uof:locID="t0109" uof:attrList="标识符">
  4338. <xsl:value-of select="."/>
  4339. </字:文本串>
  4340. </字:句>
  4341. <xsl:element name="字:域结束">
  4342. <xsl:attribute name="uof:locID">t0081</xsl:attribute>
  4343. </xsl:element>
  4344. </xsl:template>
  4345. <!-- measure_conversion.xsl Begin-->
  4346. <!--xsl:param name="dpi" select="111"/>
  4347. <xsl:param name="centimeter-in-mm" select="10"/>
  4348. <xsl:param name="inch-in-mm" select="25.4"/>
  4349. <xsl:param name="didot-point-in-mm" select="0.376065"/>
  4350. <xsl:param name="pica-in-mm" select="4.2333333"/>
  4351. <xsl:param name="point-in-mm" select="0.3527778"/>
  4352. <xsl:param name="twip-in-mm" select="0.017636684"/>
  4353. <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/-->
  4354. <!-- ***** MEASUREMENT CONVERSIONS *****
  4355. PARAM 'value'
  4356. The measure to be converted.
  4357. The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
  4358. directly added to the number.
  4359. PARAM 'rounding-factor'
  4360. Is used for the rounding of decimal places.
  4361. The parameter number is the product of 1 and some '10', where
  4362. every zero represents a decimal place.
  4363. For example, providing as parameter:
  4364. <xsl:param name="rounding-factor" select="10000" />
  4365. Gives by default four decimal places.
  4366. To round two decimal places, basically the following is done:
  4367. <xsl:value-of select="round(100 * value) div 100"/>
  4368. RETURN The converted number, by default rounded to four decimal places.
  4369. In case the input measure could not be matched the same value is
  4370. returned and a warning message is written out.
  4371. MEASURE LIST:
  4372. * 1 millimeter (mm), the basic measure
  4373. * 1 centimeter (cm) = 10 mm
  4374. * 1 inch (in) = 25.4 mm
  4375. While the English have already seen the light (read: the metric system), the US
  4376. remains loyal to this medieval system.
  4377. * 1 point (pt) = 0.35277777.. mm
  4378. Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
  4379. There are exactly 72 PostScript points in 1 inch.
  4380. * 1 twip = twentieth of a (PostScript) point
  4381. A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
  4382. * 1 didot point (dpt) = 0.376065 mm
  4383. Didot point after the French typographer Firmin Didot (1764-1836).
  4384. More details under
  4385. http://www.unc.edu/~rowlett/units/dictP.html:
  4386. "A unit of length used by typographers and printers. When printing was done
  4387. from hand-set metal type, one point represented the smallest element of type
  4388. that could be handled, roughly 1/64 inch. Eventually, the point was standardized
  4389. in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
  4390. about 0.35 mm (351.46 micrometers). In continental Europe, typographers
  4391. traditionally used a slightly larger point of 0.014 83 inch (about
  4392. 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
  4393. after the French typographer Firmin Didot (1764-1836). In the U.S.,
  4394. Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
  4395. or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
  4396. of 0.351 459 8035 mm. The German standards agency DIN has proposed that
  4397. all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
  4398. * 1 pica = 4.233333 mm
  4399. 1/6 inch or 12 points
  4400. * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
  4401. Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
  4402. -->
  4403. <!-- changing measure to mm -->
  4404. <!--xsl:template name="convert2cm">
  4405. <xsl:param name="value"/>
  4406. <xsl:param name="rounding-factor" select="10000"/>
  4407. <xsl:choose>
  4408. <xsl:when test="contains($value, 'mm')">
  4409. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
  4410. </xsl:when>
  4411. <xsl:when test="contains($value, $uofUnit)">
  4412. <xsl:value-of select="substring-before($value, $uofUnit)"/>
  4413. </xsl:when>
  4414. <xsl:when test="contains($value, 'in')">
  4415. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
  4416. </xsl:when>
  4417. <xsl:when test="contains($value, 'pt')">
  4418. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
  4419. </xsl:when>
  4420. <xsl:when test="contains($value, 'dpt')">
  4421. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  4422. </xsl:when>
  4423. <xsl:when test="contains($value, 'pica')">
  4424. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
  4425. </xsl:when>
  4426. <xsl:when test="contains($value, 'twip')">
  4427. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
  4428. </xsl:when>
  4429. <xsl:when test="contains($value, 'px')">
  4430. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  4431. </xsl:when>
  4432. <xsl:otherwise>
  4433. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
  4434. <xsl:value-of select="$value"/>
  4435. </xsl:otherwise>
  4436. </xsl:choose>
  4437. </xsl:template-->
  4438. </xsl:stylesheet>