uof2odf_spreadsheet.xsl 580 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. * This file is part of the LibreOffice project.
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  8. *
  9. * This file incorporates work covered by the following license notice:
  10. *
  11. * Licensed to the Apache Software Foundation (ASF) under one or more
  12. * contributor license agreements. See the NOTICE file distributed
  13. * with this work for additional information regarding copyright
  14. * ownership. The ASF licenses this file to you under the Apache
  15. * License, Version 2.0 (the "License"); you may not use this file
  16. * except in compliance with the License. You may obtain a copy of
  17. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  18. -->
  19. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
  20. <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
  21. <xsl:template match="uof:UOF">
  22. <!--chengxz0804 OK-->
  23. <!--office:document xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" 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" office:version="1.0" office:class="spreadsheet"-->
  24. <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
  25. <xsl:apply-templates select="uof:元数据"/>
  26. <office:settings>
  27. <xsl:call-template name="工作表属性"/>
  28. </office:settings>
  29. <xsl:apply-templates select="uof:式样集"/>
  30. <!--xsl:apply-templates select="表:公用处理规则"/-->
  31. <xsl:apply-templates select="uof:电子表格"/>
  32. </office:document>
  33. </xsl:template>
  34. <!--Redoffice comment lil from chenjh SC0013 06.02.15-->
  35. <!--增加内容-->
  36. <xsl:variable name="uofUnit">
  37. <xsl:variable name="uu">
  38. <xsl:value-of select="/uof:UOF/uof:电子表格/表:公用处理规则/表:度量单位"/>
  39. </xsl:variable>
  40. <xsl:choose>
  41. <xsl:when test="$uu='cm'">cm</xsl:when>
  42. <xsl:when test="$uu='mm'">mm</xsl:when>
  43. <xsl:when test="$uu='pt'">pt</xsl:when>
  44. <xsl:when test="$uu='inch'">inch</xsl:when>
  45. <xsl:otherwise>cm</xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:variable>
  48. <xsl:variable name="other-to-cm-conversion-factor">
  49. <xsl:choose>
  50. <xsl:when test="$uofUnit='cm'">1</xsl:when>
  51. <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
  52. <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
  53. <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
  54. <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
  55. <xsl:otherwise>0.03527</xsl:otherwise>
  56. </xsl:choose>
  57. </xsl:variable>
  58. <!--Redoffice comment liliang end 06.02.15-->
  59. <xsl:template name="set-calculation">
  60. <xsl:element name="table:calculation-settings">
  61. <xsl:if test="表:公用处理规则/表:度量单位">
  62. <xsl:variable name="uofUnit">
  63. <xsl:variable name="uu">
  64. <xsl:value-of select="表:公用处理规则/表:度量单位"/>
  65. </xsl:variable>
  66. <xsl:choose>
  67. <xsl:when test="$uu='cm'">cm</xsl:when>
  68. <xsl:when test="$uu='mm'">mm</xsl:when>
  69. <xsl:when test="$uu='pt'">pt</xsl:when>
  70. <xsl:when test="$uu='inch'">inch</xsl:when>
  71. <xsl:otherwise>cm</xsl:otherwise>
  72. </xsl:choose>
  73. </xsl:variable>
  74. <xsl:variable name="other-to-cm-conversion-factor">
  75. <xsl:choose>
  76. <xsl:when test="$uofUnit='cm'">1</xsl:when>
  77. <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
  78. <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
  79. <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
  80. <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
  81. <xsl:otherwise>1</xsl:otherwise>
  82. </xsl:choose>
  83. </xsl:variable>
  84. </xsl:if>
  85. <xsl:if test="表:公用处理规则/表:精确度以显示值为准">
  86. <xsl:attribute name="table:precision-as-shown">true</xsl:attribute>
  87. </xsl:if>
  88. <xsl:if test="表:公用处理规则/表:日期系统-1904/@表:值='true'">
  89. <table:null-date table:date-value="1904-01-01"/>
  90. </xsl:if>
  91. <xsl:if test="表:公用处理规则/表:计算设置">
  92. <xsl:element name="table:iteration">
  93. <xsl:attribute name="table:status">enable</xsl:attribute>
  94. <xsl:attribute name="table:steps"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:迭代次数"/></xsl:attribute>
  95. <xsl:attribute name="table:maximum-difference"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:偏差值"/></xsl:attribute>
  96. </xsl:element>
  97. </xsl:if>
  98. </xsl:element>
  99. </xsl:template>
  100. <xsl:template match="uof:字体集">
  101. <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
  102. <style:font-face style:name="StarSymbol" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
  103. </xsl:if>
  104. <xsl:for-each select="uof:字体声明">
  105. <xsl:element name="style:font-face">
  106. <xsl:attribute name="style:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
  107. <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:字体族"/></xsl:attribute>
  108. <xsl:if test="@uof:字符集 = '02'">
  109. <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
  110. </xsl:if>
  111. <xsl:if test="@uof:字体族">
  112. <xsl:choose>
  113. <xsl:when test="@uof:字体族 = 'Swiss'">
  114. <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
  115. </xsl:when>
  116. <xsl:when test="@uof:字体族 ='Modern'">
  117. <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
  118. </xsl:when>
  119. <xsl:when test="@uof:字体族='Roman'">
  120. <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
  121. </xsl:when>
  122. <xsl:when test="@uof:字体族 ='Script'">
  123. <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
  124. </xsl:when>
  125. <xsl:when test="@uof:字体族 ='Decorative'">
  126. <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
  127. </xsl:when>
  128. <xsl:when test="@uof:字体族 ='System'">
  129. <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
  130. </xsl:when>
  131. <xsl:otherwise>
  132. <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
  133. </xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:if>
  136. <xsl:attribute name="style:font-pitch">12</xsl:attribute>
  137. </xsl:element>
  138. </xsl:for-each>
  139. <xsl:apply-templates select="uof:字体声明"/>
  140. </xsl:template>
  141. <xsl:template match="uof:电子表格">
  142. <office:body>
  143. <office:spreadsheet>
  144. <xsl:call-template name="trackchange"/>
  145. <xsl:call-template name="set-calculation"/>
  146. <xsl:if test="表:公用处理规则/表:数据有效性集">
  147. <xsl:element name="table:content-validations">
  148. <xsl:call-template name="create-content-validations">
  149. <xsl:with-param name="validation-set" select="表:公用处理规则/表:数据有效性集/表:数据有效性"/>
  150. </xsl:call-template>
  151. </xsl:element>
  152. </xsl:if>
  153. <xsl:apply-templates select="表:主体/表:工作表"/>
  154. <!--MSexcel 中的names暂时没有对应的-->
  155. <xsl:element name="table:database-ranges">
  156. <xsl:for-each select="表:主体/表:工作表">
  157. <xsl:if test="./表:筛选">
  158. <xsl:variable name="filter" select="./表:筛选"/>
  159. <xsl:variable name="column-and-row" select="substring-before(substring-after($filter/表:范围/text(),'.'),':')"/>
  160. <xsl:variable name="dd" select="number(substring($column-and-row,2,1))"/>
  161. <xsl:variable name="zone-left-column-string">
  162. <xsl:choose>
  163. <xsl:when test="contains($dd,'NaN') ">
  164. <xsl:value-of select="substring($column-and-row,1,2)"/>
  165. </xsl:when>
  166. <xsl:otherwise>
  167. <xsl:value-of select="substring($column-and-row,1,1)"/>
  168. </xsl:otherwise>
  169. </xsl:choose>
  170. </xsl:variable>
  171. <xsl:variable name="zone-left-column-num">
  172. <xsl:call-template name="translate-column-char-to-number">
  173. <xsl:with-param name="string" select="$zone-left-column-string"/>
  174. </xsl:call-template>
  175. </xsl:variable>
  176. <xsl:element name="table:database-range">
  177. <xsl:attribute name="table:name"><xsl:value-of select="uof:电子表格/表:主体/表:工作表/@表:名称"/></xsl:attribute>
  178. <xsl:attribute name="table:target-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:范围/text(),'$','')"/></xsl:call-template></xsl:attribute>
  179. <xsl:if test="$filter/@表:类型='auto'">
  180. <xsl:attribute name="table:display-filter-buttons">true</xsl:attribute>
  181. </xsl:if>
  182. <xsl:choose>
  183. <xsl:when test="$filter/表:条件区域">
  184. <xsl:element name="table:filter">
  185. <xsl:attribute name="table:condition-source-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:条件区域/text(),'$','')"/></xsl:call-template></xsl:attribute>
  186. </xsl:element>
  187. </xsl:when>
  188. <xsl:otherwise>
  189. <xsl:element name="table:filter">
  190. <xsl:element name="table:filter-and">
  191. <xsl:call-template name="auto-filter-condition">
  192. <xsl:with-param name="condition-set" select="$filter/表:条件"/>
  193. <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
  194. </xsl:call-template>
  195. </xsl:element>
  196. </xsl:element>
  197. </xsl:otherwise>
  198. </xsl:choose>
  199. </xsl:element>
  200. </xsl:if>
  201. </xsl:for-each>
  202. </xsl:element>
  203. </office:spreadsheet>
  204. </office:body>
  205. </xsl:template>
  206. <xsl:template name="trackchange">
  207. <xsl:for-each select="表:主体/表:工作表/表:工作表内容//字:修订开始">
  208. <xsl:variable name="num">
  209. <xsl:number level="any" from="表:主体/表:工作表/表:工作表内容//*" count="字:修订开始"/>
  210. </xsl:variable>
  211. <table:tracked-changes>
  212. <table:cell-content-change>
  213. <xsl:attribute name="table:id"><xsl:value-of select="concat('ct',$num)"/></xsl:attribute>
  214. <table:cell-address>
  215. <xsl:attribute name="table:column"><xsl:value-of select="substring-after(@字:标识符,'-')"/></xsl:attribute>
  216. <xsl:attribute name="table:row"><xsl:value-of select="substring-before(@字:标识符,'-')"/></xsl:attribute>
  217. <xsl:attribute name="table:table">0</xsl:attribute>
  218. </table:cell-address>
  219. <office:change-info>
  220. <dc:creator>
  221. <xsl:choose>
  222. <xsl:when test="starts-with(@字:修订信息引用,'+')"/>
  223. <xsl:otherwise>
  224. <xsl:value-of select="substring-before(@字:修订信息引用,'+')"/>
  225. </xsl:otherwise>
  226. </xsl:choose>
  227. </dc:creator>
  228. <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:作者"/-->
  229. <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:创建日期"/-->
  230. <dc:date>
  231. <xsl:value-of select="substring-before(substring-after(@字:修订信息引用,'+'),'%')"/>
  232. </dc:date>
  233. </office:change-info>
  234. <table:previous>
  235. <table:change-track-table-cell>
  236. <text:p>
  237. <xsl:value-of select="substring-after(@字:修订信息引用,'%')"/>
  238. </text:p>
  239. </table:change-track-table-cell>
  240. </table:previous>
  241. </table:cell-content-change>
  242. </table:tracked-changes>
  243. </xsl:for-each>
  244. </xsl:template>
  245. <xsl:template match="uof:式样集">
  246. <xsl:element name="office:font-face-decls">
  247. <style:font-face style:name="宋体" svg:font-family="宋体" style:font-family-generic="swiss"/>
  248. <xsl:apply-templates select="uof:字体集"/>
  249. </xsl:element>
  250. <xsl:call-template name="单元格式样"/>
  251. </xsl:template>
  252. <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/uof:锚点 | /uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/uof:锚点" name="rel_graphic_name" use="@uof:图形引用"/>
  253. <xsl:template match="图:图形">
  254. <xsl:variable name="random-name">
  255. <xsl:value-of select="generate-id()"/>
  256. </xsl:variable>
  257. <xsl:variable name="draw-name">
  258. <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
  259. </xsl:variable>
  260. <xsl:call-template name="graphic-fill">
  261. <xsl:with-param name="draw-name" select="$draw-name"/>
  262. <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
  263. </xsl:call-template>
  264. <xsl:choose>
  265. <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
  266. <xsl:element name="style:style">
  267. <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  268. <xsl:attribute name="style:family">graphic</xsl:attribute>
  269. <xsl:element name="style:graphic-properties">
  270. <xsl:call-template name="process-graphics">
  271. <xsl:with-param name="draw-name" select="$draw-name"/>
  272. </xsl:call-template>
  273. </xsl:element>
  274. <xsl:element name="style:paragraph-properties">
  275. <xsl:if test="图:文本内容/@图:文字排列方向">
  276. <xsl:choose>
  277. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  278. <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
  279. </xsl:when>
  280. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  281. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  282. </xsl:when>
  283. </xsl:choose>
  284. </xsl:if>
  285. </xsl:element>
  286. </xsl:element>
  287. </xsl:when>
  288. <xsl:otherwise>
  289. <xsl:element name="style:style">
  290. <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  291. <xsl:attribute name="style:family">graphic</xsl:attribute>
  292. <xsl:element name="style:graphic-properties">
  293. <xsl:if test="@图:其他对象">
  294. <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
  295. <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
  296. <xsl:attribute name="draw:luminance">0%</xsl:attribute>
  297. <xsl:attribute name="draw:contrast">0%</xsl:attribute>
  298. <xsl:attribute name="draw:gamma">100%</xsl:attribute>
  299. <xsl:attribute name="draw:red">0%</xsl:attribute>
  300. <xsl:attribute name="draw:green">0%</xsl:attribute>
  301. <xsl:attribute name="draw:blue">0%</xsl:attribute>
  302. <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
  303. <xsl:attribute name="style:mirror">none</xsl:attribute>
  304. </xsl:if>
  305. <xsl:call-template name="process-graphics"/>
  306. </xsl:element>
  307. <xsl:element name="style:paragraph-properties">
  308. <xsl:if test="图:文本内容/@图:文字排列方向">
  309. <xsl:choose>
  310. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  311. <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
  312. </xsl:when>
  313. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  314. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  315. </xsl:when>
  316. </xsl:choose>
  317. </xsl:if>
  318. </xsl:element>
  319. </xsl:element>
  320. </xsl:otherwise>
  321. </xsl:choose>
  322. </xsl:template>
  323. <xsl:template name="process-graphics">
  324. <xsl:param name="draw-name"/>
  325. <xsl:if test="not(key('rel_graphic_name',@图:标识符)/@uof:随动方式='movesize')">
  326. <xsl:attribute name="style:protect"><xsl:choose><xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:随动方式='move'">size</xsl:when><xsl:otherwise>position size</xsl:otherwise></xsl:choose></xsl:attribute>
  327. </xsl:if>
  328. <xsl:choose>
  329. <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
  330. <xsl:attribute name="draw:fill">none</xsl:attribute>
  331. </xsl:when>
  332. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
  333. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  334. <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:attribute>
  335. <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
  336. <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
  337. </xsl:if>
  338. </xsl:when>
  339. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
  340. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  341. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
  342. </xsl:when>
  343. <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
  344. <xsl:attribute name="draw:fill">solid</xsl:attribute>
  345. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
  346. </xsl:when>
  347. <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
  348. <xsl:attribute name="draw:fill">gradient</xsl:attribute>
  349. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
  350. <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
  351. </xsl:when>
  352. </xsl:choose>
  353. <xsl:if test="图:预定义图形/图:属性/图:线颜色">
  354. <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
  355. </xsl:if>
  356. <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
  357. <xsl:variable name="type" select="图:预定义图形/图:属性/图:线型"/>
  358. <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$type='none'">none</xsl:when><xsl:when test="$type='single'">solid</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
  359. <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
  360. </xsl:if>
  361. <xsl:if test="图:预定义图形/图:属性/图:线粗细">
  362. <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
  363. </xsl:if>
  364. <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
  365. <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  366. <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
  367. <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  368. </xsl:if>
  369. </xsl:if>
  370. <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
  371. <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  372. <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
  373. <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
  374. </xsl:if>
  375. </xsl:if>
  376. <xsl:if test="图:预定义图形/图:属性/图:透明度">
  377. <xsl:attribute name="draw:opacity"><xsl:value-of select="concat(图:预定义图形/图:属性/图:透明度,'%')"/></xsl:attribute>
  378. </xsl:if>
  379. <xsl:if test="图:文本内容">
  380. <xsl:if test="图:文本内容/@图:上边距">
  381. <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
  382. <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
  383. <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
  384. <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
  385. </xsl:if>
  386. <xsl:if test="图:文本内容/@图:文字排列方向">
  387. <xsl:choose>
  388. <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
  389. <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
  390. </xsl:when>
  391. <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
  392. <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
  393. </xsl:when>
  394. <xsl:when test="图:文本内容/@图:文字排列方向='hori-r2l'">
  395. <xsl:attribute name="draw:textarea-horizontal-align">right</xsl:attribute>
  396. </xsl:when>
  397. <xsl:when test="图:文本内容/@图:文字排列方向='hori-12r'">
  398. <xsl:attribute name="draw:textarea-horizontal-align">left</xsl:attribute>
  399. </xsl:when>
  400. </xsl:choose>
  401. </xsl:if>
  402. <xsl:if test="图:文本内容/@图:水平对齐">
  403. <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
  404. </xsl:if>
  405. <xsl:if test="图:文本内容/@图:垂直对齐">
  406. <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
  407. </xsl:if>
  408. <xsl:if test="图:文本内容/@图:自动换行">
  409. <xsl:attribute name="fo:wrap-option">no-wrap</xsl:attribute>
  410. </xsl:if>
  411. <xsl:attribute name="draw:auto-grow-width"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  412. <xsl:attribute name="draw:auto-grow-height"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  413. </xsl:if>
  414. </xsl:template>
  415. <xsl:template name="bina_graphic">
  416. <xsl:param name="refGraphic"/>
  417. <xsl:element name="office:binary-data">
  418. <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
  419. <xsl:value-of select="uof:数据"/>
  420. </xsl:for-each>
  421. </xsl:element>
  422. <text:p/>
  423. </xsl:template>
  424. <xsl:template name="graphic-fill">
  425. <xsl:param name="draw-name"/>
  426. <xsl:param name="gradient-name"/>
  427. <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
  428. <xsl:element name="draw:gradient">
  429. <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
  430. <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
  431. <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
  432. <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
  433. <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
  434. <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
  435. <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
  436. <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
  437. <xsl:if test="$gradient-name/@图:种子X位置">
  438. <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
  439. </xsl:if>
  440. <xsl:if test="$gradient-name/@图:种子Y位置">
  441. <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
  442. </xsl:if>
  443. </xsl:element>
  444. </xsl:if>
  445. <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
  446. <xsl:element name="draw:marker">
  447. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  448. <xsl:choose>
  449. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
  450. <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
  451. <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
  452. </xsl:when>
  453. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
  454. <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
  455. <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
  456. </xsl:when>
  457. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
  458. <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
  459. <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
  460. </xsl:when>
  461. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
  462. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  463. <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
  464. </xsl:when>
  465. <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
  466. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  467. <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
  468. </xsl:when>
  469. </xsl:choose>
  470. </xsl:element>
  471. </xsl:if>
  472. <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
  473. <xsl:element name="draw:marker">
  474. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
  475. <xsl:choose>
  476. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
  477. <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
  478. <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
  479. </xsl:when>
  480. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
  481. <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
  482. <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
  483. </xsl:when>
  484. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
  485. <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
  486. <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
  487. </xsl:when>
  488. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
  489. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  490. <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
  491. </xsl:when>
  492. <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
  493. <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
  494. <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
  495. </xsl:when>
  496. </xsl:choose>
  497. </xsl:element>
  498. </xsl:if>
  499. <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
  500. <xsl:element name="draw:fill-image">
  501. <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
  502. <xsl:call-template name="bina_graphic">
  503. <xsl:with-param name="refGraphic">
  504. <xsl:choose>
  505. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
  506. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
  507. </xsl:when>
  508. <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
  509. <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
  510. </xsl:when>
  511. </xsl:choose>
  512. </xsl:with-param>
  513. </xsl:call-template>
  514. </xsl:element>
  515. </xsl:if>
  516. <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
  517. <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
  518. <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
  519. <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
  520. <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
  521. <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
  522. <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
  523. <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
  524. <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
  525. <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
  526. <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
  527. <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
  528. <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
  529. <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
  530. </xsl:if>
  531. </xsl:template>
  532. <xsl:template name="单元格式样">
  533. <xsl:variable name="uofSheet" select="/uof:UOF/uof:电子表格"/>
  534. <xsl:variable name="uofSheet1" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
  535. <xsl:variable name="uofSheetCom" select="$uofSheet/表:公用处理规则"/>
  536. <xsl:variable name="first-style" select="/uof:UOF/uof:式样集/uof:单元格式样"/>
  537. <xsl:variable name="quyu" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化/表:区域"/>
  538. <xsl:variable name="condition-format-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化"/>
  539. <xsl:variable name="aa">
  540. <xsl:for-each select="$first-style">
  541. <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
  542. <xsl:value-of select="@表:名称"/>
  543. </xsl:if>
  544. </xsl:for-each>
  545. </xsl:variable>
  546. <xsl:variable name="bb">
  547. <xsl:for-each select="$first-style">
  548. <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
  549. <xsl:value-of select="@表:标识符"/>
  550. </xsl:if>
  551. </xsl:for-each>
  552. </xsl:variable>
  553. <office:styles>
  554. <!-- if ConditionalFormatting exists,it should generate some styles for style:style -->
  555. <!--xsl:if test="$uofSheetCom/表:条件格式化集">
  556. <xsl:call-template name="CondFormat_office_style"/>
  557. </xsl:if-->
  558. <!--ro000179 chenjh-->
  559. <xsl:for-each select="$first-style[@表:类型='custom' or @表:类型='default']">
  560. <xsl:call-template name="单元格具体式样"/>
  561. <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
  562. <xsl:apply-templates select="表:字体格式[字:上下标]"/>
  563. </xsl:for-each>
  564. </office:styles>
  565. <office:automatic-styles>
  566. <xsl:for-each select="$first-style[@表:类型='auto']">
  567. <xsl:variable name="apply-style-name" select="@表:名称"/>
  568. <xsl:variable name="style-name" select="@表:标识符"/>
  569. <xsl:choose>
  570. <xsl:when test="$style-name!=$apply-style-name and $apply-style-name!='Normal'">
  571. <xsl:for-each select="$condition-format-set/表:条件">
  572. <style:style>
  573. <xsl:attribute name="style:name"><xsl:value-of select="//uof:单元格式样[@表:名称=current()/表:格式/@表:式样引用 and @表:类型='auto']/@表:标识符"/></xsl:attribute>
  574. <xsl:attribute name="style:family">table-cell</xsl:attribute>
  575. <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
  576. <xsl:for-each select="parent::表:条件格式化/表:条件">
  577. <xsl:variable name="condition-text">
  578. <xsl:choose>
  579. <xsl:when test="@表:类型='cell value'">
  580. <xsl:choose>
  581. <xsl:when test="表:操作码/text()='between' ">
  582. <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
  583. </xsl:when>
  584. <xsl:when test=" 表:操作码/text()='not between'">
  585. <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
  586. </xsl:when>
  587. <xsl:when test="表:操作码/text()='equal to'">
  588. <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
  589. </xsl:when>
  590. <xsl:when test="表:操作码/text()='not equal to'">
  591. <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
  592. </xsl:when>
  593. <xsl:when test="表:操作码/text()='greater than'">
  594. <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
  595. </xsl:when>
  596. <xsl:when test="表:操作码/text()='less than'">
  597. <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
  598. </xsl:when>
  599. <xsl:when test="表:操作码/text()='greater than or equal to'">
  600. <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
  601. </xsl:when>
  602. <xsl:when test="表:操作码/text()='less than or equal to'">
  603. <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
  604. </xsl:when>
  605. </xsl:choose>
  606. </xsl:when>
  607. <xsl:when test="@表:类型='formula'">
  608. <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
  609. </xsl:when>
  610. </xsl:choose>
  611. </xsl:variable>
  612. <xsl:element name="style:map">
  613. <xsl:variable name="address">
  614. <xsl:value-of select="preceding-sibling::表:区域"/>
  615. </xsl:variable>
  616. <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
  617. <xsl:attribute name="style:apply-style-name"><xsl:value-of select="表:格式/@表:式样引用"/></xsl:attribute>
  618. <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($address,':')"/></xsl:attribute>
  619. </xsl:element>
  620. </xsl:for-each>
  621. </style:style>
  622. </xsl:for-each>
  623. </xsl:when>
  624. <xsl:otherwise>
  625. <xsl:for-each select="uof:单元格式样 ">
  626. <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
  627. <xsl:call-template name="单元格具体式样"/>
  628. </xsl:if>
  629. </xsl:for-each>
  630. </xsl:otherwise>
  631. </xsl:choose>
  632. </xsl:for-each>
  633. <!--Redoffie comment liliang SC0008 06.02.14-->
  634. <!--1新增内容-->
  635. <xsl:if test="uof:单元格式样">
  636. <xsl:for-each select="uof:单元格式样">
  637. <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
  638. <xsl:call-template name="单元格具体式样"/>
  639. </xsl:if>
  640. </xsl:for-each>
  641. </xsl:if>
  642. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif'">
  643. <style:style style:name="Graphics" style:family="graphics">
  644. <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
  645. </style:style>
  646. </xsl:if>
  647. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
  648. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
  649. <!--Redoffice comment end 06.02.14-->
  650. <xsl:apply-templates select="$uofSheet1/表:工作表内容"/>
  651. <xsl:if test="uof:单元格式样">
  652. <xsl:for-each select="uof:单元格式样[@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')]">
  653. <xsl:call-template name="单元格具体式样"/>
  654. <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
  655. <xsl:apply-templates select="表:字体格式[字:上下标]"/>
  656. </xsl:for-each>
  657. </xsl:if>
  658. <!-- if ConditionalFormatting exists,transforing the styles -->
  659. <!--xsl:if test="$uofSheetCom/表:条件格式化集">
  660. <xsl:call-template name="CondFormat_automatic_style"/>
  661. </xsl:if-->
  662. <xsl:if test="$uofSheetCom/表:条件格式化集/表:条件格式化">
  663. <xsl:variable name="style-name" select="$first-style/@表:标识符"/>
  664. <xsl:variable name="left-top">
  665. <xsl:call-template name="search-left-top-in-tables">
  666. <xsl:with-param name="cellstylename" select="$style-name"/>
  667. <xsl:with-param name="tableslist" select="$uofSheet1/表:工作表内容"/>
  668. <xsl:with-param name="return" select="''"/>
  669. </xsl:call-template>
  670. </xsl:variable>
  671. <xsl:variable name="after-translated-left-top">
  672. <xsl:call-template name="translate-left-top">
  673. <xsl:with-param name="left-top" select="$left-top"/>
  674. </xsl:call-template>
  675. </xsl:variable>
  676. <xsl:if test="$after-translated-left-top!=''">
  677. <xsl:call-template name="create-the-condition-format-map">
  678. <xsl:with-param name="condition-format-set" select="$uofSheetCom/表:条件格式化集//表:条件格式化"/>
  679. <xsl:with-param name="current-left-top" select="$after-translated-left-top"/>
  680. </xsl:call-template>
  681. </xsl:if>
  682. </xsl:if>
  683. <xsl:apply-templates select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列/表:单元格/*[descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40']]"/>
  684. <!--xsl:apply-templates select="$uofSheet1/表:工作表属性/表:页面设置/表:页眉页脚/字:段落" /-->
  685. <xsl:call-template name="create-page-master">
  686. <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
  687. </xsl:call-template>
  688. <xsl:for-each select="uof:句式样">
  689. <style:style>
  690. <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
  691. <xsl:attribute name="style:family">text</xsl:attribute>
  692. <style:text-properties>
  693. <xsl:apply-templates select="./*"/>
  694. </style:text-properties>
  695. </style:style>
  696. </xsl:for-each>
  697. </office:automatic-styles>
  698. <office:master-styles>
  699. <xsl:call-template name="create-master-styles">
  700. <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
  701. </xsl:call-template>
  702. </office:master-styles>
  703. </xsl:template>
  704. <xsl:template match="表:数据有效性">
  705. <xsl:variable name="range-name-temp">
  706. <xsl:value-of select="substring-before(表:区域,'!')"/>
  707. </xsl:variable>
  708. <xsl:variable name="range-name">
  709. <xsl:value-of select="substring($range-name-temp,2,string-length($range-name-temp)-2)"/>
  710. </xsl:variable>
  711. <xsl:variable name="first-range">
  712. <xsl:choose>
  713. <xsl:when test="contains(表:区域, ',')">
  714. <xsl:value-of select="translate(substring-after(substring-before(表:区域, ','),'!'),'$','')"/>
  715. </xsl:when>
  716. <xsl:otherwise>
  717. <xsl:value-of select="translate(substring-after(表:区域,'!'),'$','')"/>
  718. </xsl:otherwise>
  719. </xsl:choose>
  720. </xsl:variable>
  721. <xsl:variable name="value-first">
  722. <xsl:value-of select="translate(表:第一操作数,'=','')"/>
  723. </xsl:variable>
  724. <xsl:variable name="value-second">
  725. <xsl:value-of select="translate(表:第二操作数,'=','')"/>
  726. </xsl:variable>
  727. <xsl:element name="table:content-validation">
  728. <xsl:attribute name="table:name"><xsl:value-of select="concat('val', position())"/></xsl:attribute>
  729. <!--数据有效性:第一操作数、第二操作数-->
  730. <!-- don't support two type of qualifier: List, Custom -->
  731. <xsl:attribute name="table:condition"><xsl:variable name="qualifier-content"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:choose><xsl:when test="(number($value-second))"><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not equal to'"><xsl:value-of select="concat('!=', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'equal to'"><xsl:variable name="range1"><xsl:value-of select="substring-after(substring-before($value-first,':'),'(')"/></xsl:variable><xsl:variable name="range2"><xsl:value-of select="substring-before(substring-after($value-first,':'),')')"/></xsl:variable><xsl:value-of select="concat('=SUM([',$range-name,'.',$range1,':',$range-name,'.',$range2,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than'"><xsl:value-of select="concat('&lt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than'"><xsl:value-of select="concat('&gt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than or equal to'"><xsl:value-of select="concat('&gt;=[',$range-name, '.',$value-first,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than or equal to'"><xsl:value-of select="concat('&lt;=[',$range-name,'.', $value-first,']')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('([',$range-name,'.',substring-before($value-first,':'),':',$range-name,'.',substring-after($value-first,':'),'])')"/></xsl:otherwise></xsl:choose></xsl:variable><!--操作码、校验类型--><xsl:variable name="qualifier-value"><xsl:choose><xsl:when test="表:校验类型 = 'whole number'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'decimal'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'list'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-in-list() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-in-list',$qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'date'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-date() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-date() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'time'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-time() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-time() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'text length'"><xsl:choose><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([', $range-name,'.',$value-first, '],', $value-second, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([',$range-name,'.', $value-first, '],[',$range-name,'.', $value-second, '])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$value-second and $value-first"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],',$value-second,')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,'])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'custom'"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:value-of select="concat('and cell-content-is-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:value-of select="concat('oooc:and cell-content-is-not-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-custom() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="表:校验类型"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="$qualifier-value"/></xsl:attribute>
  732. <!--忽略空格-->
  733. <xsl:attribute name="table:allow-empty-cell"><xsl:choose><xsl:when test="表:忽略空格"><xsl:value-of select="'false'"/></xsl:when><xsl:otherwise><xsl:value-of select="'true'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  734. <xsl:attribute name="table:base-cell-address"><xsl:variable name="range"><xsl:value-of select="$first-range"/><!--xsl:call-template name="translate-expression">
  735. <xsl:with-param name="cell-row-pos" select="0" />
  736. <xsl:with-param name="cell-column-pos" select="0" />
  737. <xsl:with-param name="expression" select="$first-range" />
  738. <xsl:with-param name="return-value" select="''" />
  739. </xsl:call-template--></xsl:variable><xsl:call-template name="encode-as-cell-address"><xsl:with-param name="string" select="concat($range-name, '.', $range)"/></xsl:call-template></xsl:attribute>
  740. <!--输入提示-->
  741. <xsl:element name="table:help-message">
  742. <xsl:attribute name="table:title"><xsl:value-of select="表:输入提示/@表:标题"/></xsl:attribute>
  743. <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:输入提示/@表:显示"><xsl:value-of select="表:输入提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  744. <xsl:element name="text:p">
  745. <xsl:value-of select="表:输入提示/@表:内容"/>
  746. </xsl:element>
  747. </xsl:element>
  748. <!--错误提示-->
  749. <xsl:element name="table:error-message">
  750. <xsl:attribute name="table:message-type"><xsl:choose><xsl:when test="表:错误提示/@表:类型= 'information'"><xsl:value-of select="'information'"/></xsl:when><xsl:when test="表:错误提示/@表:类型= 'warning'"><xsl:value-of select="'warning'"/></xsl:when><xsl:otherwise><xsl:value-of select="'stop'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  751. <xsl:attribute name="table:title"><xsl:value-of select="表:错误提示/@表:标题"/></xsl:attribute>
  752. <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:错误提示/@表:显示"><xsl:value-of select="表:错误提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  753. <xsl:element name="text:p">
  754. <xsl:value-of select="表:错误提示/@表:内容"/>
  755. </xsl:element>
  756. </xsl:element>
  757. </xsl:element>
  758. </xsl:template>
  759. <xsl:template name="CondFormat_office_style">
  760. <xsl:for-each select="../../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
  761. <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
  762. <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
  763. <xsl:for-each select="表:条件">
  764. <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
  765. <xsl:element name="style:style">
  766. <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:call-template></xsl:attribute>
  767. <xsl:attribute name="style:family">table-cell</xsl:attribute>
  768. <xsl:element name="style:properties">
  769. <xsl:choose>
  770. <xsl:when test="表:格式/@表:式样引用">
  771. <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
  772. <xsl:call-template name="recursion-condformat-style-table-cell">
  773. <xsl:with-param name="style-value-t">
  774. <xsl:choose>
  775. <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
  776. <xsl:value-of select="concat($stylevalue,';')"/>
  777. </xsl:when>
  778. <xsl:otherwise>
  779. <xsl:value-of select="$stylevalue"/>
  780. </xsl:otherwise>
  781. </xsl:choose>
  782. </xsl:with-param>
  783. </xsl:call-template>
  784. </xsl:when>
  785. </xsl:choose>
  786. </xsl:element>
  787. <!--xsl:element name="style:text-properties"-->
  788. <!--chengxz0618-->
  789. <xsl:element name="style:properties">
  790. <xsl:choose>
  791. <xsl:when test="表:格式/@表:式样引用">
  792. <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
  793. <xsl:call-template name="recursion-condformat-style-text">
  794. <xsl:with-param name="style-value-t">
  795. <xsl:choose>
  796. <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
  797. <xsl:value-of select="concat($stylevalue,';')"/>
  798. </xsl:when>
  799. <xsl:otherwise>
  800. <xsl:value-of select="$stylevalue"/>
  801. </xsl:otherwise>
  802. </xsl:choose>
  803. </xsl:with-param>
  804. </xsl:call-template>
  805. </xsl:when>
  806. <xsl:otherwise>
  807. <xsl:attribute name="fo:font-style"><xsl:value-of select="'italic'"/></xsl:attribute>
  808. <xsl:attribute name="style:text-underline-type"><xsl:value-of select="'single'"/></xsl:attribute>
  809. <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'font-color'"/></xsl:attribute>
  810. <xsl:attribute name="fo:font-weight"><xsl:value-of select="'bold'"/></xsl:attribute>
  811. </xsl:otherwise>
  812. </xsl:choose>
  813. </xsl:element>
  814. </xsl:element>
  815. </xsl:for-each>
  816. </xsl:for-each>
  817. </xsl:template>
  818. <xsl:template name="cell-pattern-color">
  819. <xsl:param name="pattern"/>
  820. <xsl:param name="color-value"/>
  821. <xsl:param name="pattern-color-value"/>
  822. <xsl:variable name="rev-pattern" select="1 - $pattern"/>
  823. <xsl:variable name="color-R-value">
  824. <xsl:call-template name="hex2decimal">
  825. <xsl:with-param name="hex-number" select="substring($color-value,2,2)"/>
  826. <xsl:with-param name="index" select="1"/>
  827. <xsl:with-param name="str-length" select="2"/>
  828. <xsl:with-param name="last-value" select="0"/>
  829. </xsl:call-template>
  830. </xsl:variable>
  831. <xsl:variable name="color-G-value">
  832. <xsl:call-template name="hex2decimal">
  833. <xsl:with-param name="hex-number" select="substring($color-value,4,2)"/>
  834. <xsl:with-param name="index" select="1"/>
  835. <xsl:with-param name="str-length" select="2"/>
  836. <xsl:with-param name="last-value" select="0"/>
  837. </xsl:call-template>
  838. </xsl:variable>
  839. <xsl:variable name="color-B-value">
  840. <xsl:call-template name="hex2decimal">
  841. <xsl:with-param name="hex-number" select="substring($color-value,6,2)"/>
  842. <xsl:with-param name="index" select="1"/>
  843. <xsl:with-param name="str-length" select="2"/>
  844. <xsl:with-param name="last-value" select="0"/>
  845. </xsl:call-template>
  846. </xsl:variable>
  847. <xsl:variable name="pattern-R-value">
  848. <xsl:call-template name="hex2decimal">
  849. <xsl:with-param name="hex-number" select="substring($pattern-color-value,2,2)"/>
  850. <xsl:with-param name="index" select="1"/>
  851. <xsl:with-param name="str-length" select="2"/>
  852. <xsl:with-param name="last-value" select="0"/>
  853. </xsl:call-template>
  854. </xsl:variable>
  855. <xsl:variable name="pattern-G-value">
  856. <xsl:call-template name="hex2decimal">
  857. <xsl:with-param name="hex-number" select="substring($pattern-color-value,4,2)"/>
  858. <xsl:with-param name="index" select="1"/>
  859. <xsl:with-param name="str-length" select="2"/>
  860. <xsl:with-param name="last-value" select="0"/>
  861. </xsl:call-template>
  862. </xsl:variable>
  863. <xsl:variable name="pattern-B-value">
  864. <xsl:call-template name="hex2decimal">
  865. <xsl:with-param name="hex-number" select="substring($pattern-color-value,6,2)"/>
  866. <xsl:with-param name="index" select="1"/>
  867. <xsl:with-param name="str-length" select="2"/>
  868. <xsl:with-param name="last-value" select="0"/>
  869. </xsl:call-template>
  870. </xsl:variable>
  871. <xsl:variable name="R-value">
  872. <xsl:variable name="combined-R-value">
  873. <xsl:call-template name="decimal2hex">
  874. <xsl:with-param name="dec-number" select="floor($color-R-value * $rev-pattern + $pattern-R-value * $pattern)"/>
  875. <xsl:with-param name="last-value" select="'H'"/>
  876. </xsl:call-template>
  877. </xsl:variable>
  878. <xsl:choose>
  879. <xsl:when test="string-length($combined-R-value) = 1">
  880. <xsl:value-of select="concat('0',$combined-R-value)"/>
  881. </xsl:when>
  882. <xsl:otherwise>
  883. <xsl:value-of select="$combined-R-value"/>
  884. </xsl:otherwise>
  885. </xsl:choose>
  886. </xsl:variable>
  887. <xsl:variable name="G-value">
  888. <xsl:variable name="combined-G-value">
  889. <xsl:call-template name="decimal2hex">
  890. <xsl:with-param name="dec-number" select="floor($color-G-value * $rev-pattern + $pattern-G-value * $pattern)"/>
  891. <xsl:with-param name="last-value" select="'H'"/>
  892. </xsl:call-template>
  893. </xsl:variable>
  894. <xsl:choose>
  895. <xsl:when test="string-length($combined-G-value) = 1">
  896. <xsl:value-of select="concat('0',$combined-G-value)"/>
  897. </xsl:when>
  898. <xsl:otherwise>
  899. <xsl:value-of select="$combined-G-value"/>
  900. </xsl:otherwise>
  901. </xsl:choose>
  902. </xsl:variable>
  903. <xsl:variable name="B-value">
  904. <xsl:variable name="combined-B-value">
  905. <xsl:call-template name="decimal2hex">
  906. <xsl:with-param name="dec-number" select="floor($color-B-value * $rev-pattern + $pattern-B-value * $pattern)"/>
  907. <xsl:with-param name="last-value" select="'H'"/>
  908. </xsl:call-template>
  909. </xsl:variable>
  910. <xsl:choose>
  911. <xsl:when test="string-length($combined-B-value) = 1">
  912. <xsl:value-of select="concat('0',$combined-B-value)"/>
  913. </xsl:when>
  914. <xsl:otherwise>
  915. <xsl:value-of select="$combined-B-value"/>
  916. </xsl:otherwise>
  917. </xsl:choose>
  918. </xsl:variable>
  919. <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
  920. </xsl:template>
  921. <xsl:template name="hex2decimal">
  922. <xsl:param name="hex-number"/>
  923. <xsl:param name="index"/>
  924. <xsl:param name="str-length"/>
  925. <xsl:param name="last-value"/>
  926. <xsl:variable name="dec-char">
  927. <xsl:call-template name="hexNumber2dec">
  928. <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
  929. </xsl:call-template>
  930. </xsl:variable>
  931. <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
  932. <xsl:if test="$index &lt; $str-length">
  933. <xsl:call-template name="hex2decimal">
  934. <xsl:with-param name="hex-number" select="$hex-number"/>
  935. <xsl:with-param name="index" select="$index + 1"/>
  936. <xsl:with-param name="str-length" select="$str-length"/>
  937. <xsl:with-param name="last-value" select="$current-value"/>
  938. </xsl:call-template>
  939. </xsl:if>
  940. <xsl:if test="$index = $str-length">
  941. <xsl:value-of select="$current-value"/>
  942. </xsl:if>
  943. </xsl:template>
  944. <xsl:template name="hexNumber2dec">
  945. <xsl:param name="hex-value"/>
  946. <xsl:choose>
  947. <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
  948. <xsl:value-of select="10"/>
  949. </xsl:when>
  950. <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
  951. <xsl:value-of select="11"/>
  952. </xsl:when>
  953. <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
  954. <xsl:value-of select="12"/>
  955. </xsl:when>
  956. <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
  957. <xsl:value-of select="13"/>
  958. </xsl:when>
  959. <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
  960. <xsl:value-of select="14"/>
  961. </xsl:when>
  962. <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
  963. <xsl:value-of select="15"/>
  964. </xsl:when>
  965. <xsl:otherwise>
  966. <xsl:value-of select="$hex-value"/>
  967. </xsl:otherwise>
  968. </xsl:choose>
  969. </xsl:template>
  970. <xsl:template name="decimal2hex">
  971. <xsl:param name="dec-number"/>
  972. <xsl:param name="last-value"/>
  973. <xsl:variable name="current-value">
  974. <xsl:call-template name="decNumber2hex">
  975. <xsl:with-param name="dec-value">
  976. <xsl:if test="$dec-number &gt; 15">
  977. <xsl:value-of select="floor($dec-number div 16)"/>
  978. </xsl:if>
  979. <xsl:if test="$dec-number &lt; 16">
  980. <xsl:value-of select="$dec-number"/>
  981. </xsl:if>
  982. </xsl:with-param>
  983. </xsl:call-template>
  984. </xsl:variable>
  985. <xsl:if test="$dec-number &gt; 15">
  986. <xsl:call-template name="decimal2hex">
  987. <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
  988. <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
  989. </xsl:call-template>
  990. </xsl:if>
  991. <xsl:if test="$dec-number &lt; 16">
  992. <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
  993. </xsl:if>
  994. </xsl:template>
  995. <xsl:template name="decNumber2hex">
  996. <xsl:param name="dec-value"/>
  997. <xsl:choose>
  998. <xsl:when test="$dec-value = 10">
  999. <xsl:value-of select="'A'"/>
  1000. </xsl:when>
  1001. <xsl:when test="$dec-value = 11">
  1002. <xsl:value-of select="'B'"/>
  1003. </xsl:when>
  1004. <xsl:when test="$dec-value = 12">
  1005. <xsl:value-of select="'C'"/>
  1006. </xsl:when>
  1007. <xsl:when test="$dec-value = 13">
  1008. <xsl:value-of select="'D'"/>
  1009. </xsl:when>
  1010. <xsl:when test="$dec-value = 14">
  1011. <xsl:value-of select="'E'"/>
  1012. </xsl:when>
  1013. <xsl:when test="$dec-value = 15">
  1014. <xsl:value-of select="'F'"/>
  1015. </xsl:when>
  1016. <xsl:otherwise>
  1017. <xsl:value-of select="$dec-value"/>
  1018. </xsl:otherwise>
  1019. </xsl:choose>
  1020. </xsl:template>
  1021. <xsl:template name="recursion-condformat-style-table-cell">
  1022. <xsl:param name="style-value-t"/>
  1023. <xsl:variable name="style-value" select="$style-value-t"/>
  1024. <xsl:choose>
  1025. <xsl:when test="starts-with($style-value,'background')">
  1026. <xsl:choose>
  1027. <xsl:when test="contains($style-value,'mso-pattern')">
  1028. <xsl:variable name="color-value">
  1029. <xsl:call-template name="translate-color-style">
  1030. <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
  1031. </xsl:call-template>
  1032. </xsl:variable>
  1033. <xsl:variable name="mso-value">
  1034. <xsl:call-template name="translate-color-style">
  1035. <xsl:with-param name="source-str" select="normalize-space(substring-after($style-value,'mso-pattern'))"/>
  1036. </xsl:call-template>
  1037. </xsl:variable>
  1038. <xsl:variable name="mso-color" select="substring-after($mso-value,'#')"/>
  1039. <xsl:variable name="pattern-color-value" select="substring($mso-color,1,6)"/>
  1040. <xsl:variable name="pattern" select="concat('0.',normalize-space(substring-before(substring-after($mso-color,'gray-'),';')))"/>
  1041. <xsl:variable name="pattern-color">
  1042. <xsl:call-template name="cell-pattern-color">
  1043. <xsl:with-param name="pattern" select="$pattern"/>
  1044. <xsl:with-param name="color-value" select="$color-value"/>
  1045. <xsl:with-param name="pattern-color-value" select="concat('#',$pattern-color-value)"/>
  1046. </xsl:call-template>
  1047. </xsl:variable>
  1048. <xsl:attribute name="fo:background-color"><xsl:value-of select="normalize-space($pattern-color)"/></xsl:attribute>
  1049. </xsl:when>
  1050. <xsl:otherwise>
  1051. <xsl:attribute name="fo:background-color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
  1052. </xsl:otherwise>
  1053. </xsl:choose>
  1054. </xsl:when>
  1055. <xsl:when test="starts-with($style-value,'border')">
  1056. <xsl:attribute name="fo:border"><xsl:value-of select="'0.002cm solid #000000'"/></xsl:attribute>
  1057. </xsl:when>
  1058. </xsl:choose>
  1059. <xsl:if test="contains($style-value,':')">
  1060. <xsl:call-template name="recursion-condformat-style-table-cell">
  1061. <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
  1062. </xsl:call-template>
  1063. </xsl:if>
  1064. </xsl:template>
  1065. <xsl:template name="recursion-condformat-style-text">
  1066. <xsl:param name="style-value-t"/>
  1067. <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
  1068. <xsl:choose>
  1069. <xsl:when test="starts-with($style-value,'color')">
  1070. <xsl:attribute name="fo:color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
  1071. </xsl:when>
  1072. <xsl:when test="starts-with($style-value,'font-style')">
  1073. <xsl:attribute name="fo:font-style"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
  1074. </xsl:when>
  1075. <xsl:when test="starts-with($style-value,'font-weight')">
  1076. <xsl:variable name="font-weight" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
  1077. <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="($font-weight &gt; 300) and ($font-weight &lt; 500)"><xsl:value-of select="'normal'"/></xsl:when><xsl:when test="($font-weight &gt; 500) or ($font-weight = 500)"><xsl:value-of select="'bold'"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1078. </xsl:when>
  1079. <xsl:when test="starts-with($style-value,'text-underline-style')">
  1080. <xsl:attribute name="style:text-underline-type"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
  1081. <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'#000000'"/></xsl:attribute>
  1082. </xsl:when>
  1083. </xsl:choose>
  1084. <xsl:if test="contains($style-value,':')">
  1085. <xsl:call-template name="recursion-condformat-style-text">
  1086. <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
  1087. </xsl:call-template>
  1088. </xsl:if>
  1089. </xsl:template>
  1090. <xsl:template name="translate-color-style">
  1091. <xsl:param name="source-str"/>
  1092. <xsl:choose>
  1093. <xsl:when test="starts-with($source-str,'#')">
  1094. <xsl:value-of select="$source-str"/>
  1095. </xsl:when>
  1096. <xsl:otherwise>
  1097. <xsl:choose>
  1098. <xsl:when test="starts-with($source-str,'black')">
  1099. <xsl:value-of select="'#000000'"/>
  1100. </xsl:when>
  1101. <xsl:when test="starts-with($source-str,'maroon')">
  1102. <xsl:value-of select="'#800000'"/>
  1103. </xsl:when>
  1104. <xsl:when test="starts-with($source-str,'red')">
  1105. <xsl:value-of select="'#FF0000'"/>
  1106. </xsl:when>
  1107. <xsl:when test="starts-with($source-str,'fuchsia')">
  1108. <xsl:value-of select="'#FF00FF'"/>
  1109. </xsl:when>
  1110. <xsl:when test="starts-with($source-str,'olive')">
  1111. <xsl:value-of select="'#808000'"/>
  1112. </xsl:when>
  1113. <xsl:when test="starts-with($source-str,'yellow')">
  1114. <xsl:value-of select="'#FFFF00'"/>
  1115. </xsl:when>
  1116. <xsl:when test="starts-with($source-str,'green')">
  1117. <xsl:value-of select="'#008000'"/>
  1118. </xsl:when>
  1119. <xsl:when test="starts-with($source-str,'lime')">
  1120. <xsl:value-of select="'#00FF00'"/>
  1121. </xsl:when>
  1122. <xsl:when test="starts-with($source-str,'teal')">
  1123. <xsl:value-of select="'#008080'"/>
  1124. </xsl:when>
  1125. <xsl:when test="starts-with($source-str,'aqua')">
  1126. <xsl:value-of select="'#00FFFF'"/>
  1127. </xsl:when>
  1128. <xsl:when test="starts-with($source-str,'navy')">
  1129. <xsl:value-of select="'#000080'"/>
  1130. </xsl:when>
  1131. <xsl:when test="starts-with($source-str,'blue')">
  1132. <xsl:value-of select="'#0000FF'"/>
  1133. </xsl:when>
  1134. <xsl:when test="starts-with($source-str,'purple')">
  1135. <xsl:value-of select="'#800080'"/>
  1136. </xsl:when>
  1137. <xsl:when test="starts-with($source-str,'gray')">
  1138. <xsl:value-of select="'#808080'"/>
  1139. </xsl:when>
  1140. <xsl:when test="starts-with($source-str,'silver')">
  1141. <xsl:value-of select="'#C0C0C0'"/>
  1142. </xsl:when>
  1143. <xsl:when test="starts-with($source-str,'white')">
  1144. <xsl:value-of select="'#FFFFFF'"/>
  1145. </xsl:when>
  1146. <xsl:otherwise>
  1147. <xsl:value-of select="'#FFFFFF'"/>
  1148. </xsl:otherwise>
  1149. </xsl:choose>
  1150. </xsl:otherwise>
  1151. </xsl:choose>
  1152. </xsl:template>
  1153. <xsl:template name="CondFormat_automatic_style">
  1154. <xsl:for-each select="../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
  1155. <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
  1156. <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
  1157. <xsl:element name="style:style">
  1158. <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('ce',$table-pos,'-',$conditions)"/></xsl:call-template></xsl:attribute>
  1159. <xsl:attribute name="style:family">table-cell</xsl:attribute>
  1160. <xsl:for-each select="uof:单元格式样/表:条件">
  1161. <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
  1162. <xsl:variable name="base-address">
  1163. <xsl:choose>
  1164. <xsl:when test="contains(../表:区域,',')">
  1165. <xsl:choose>
  1166. <xsl:when test="contains(substring-before(../表:区域,','),':')">
  1167. <xsl:value-of select="substring-before(substring-after(../表:区域,':'),',')"/>
  1168. </xsl:when>
  1169. <xsl:otherwise>
  1170. <xsl:value-of select="substring-before(../表:区域,',')"/>
  1171. </xsl:otherwise>
  1172. </xsl:choose>
  1173. </xsl:when>
  1174. <xsl:otherwise>
  1175. <xsl:value-of select="../表:区域"/>
  1176. </xsl:otherwise>
  1177. </xsl:choose>
  1178. </xsl:variable>
  1179. <xsl:variable name="base-cell-address">
  1180. <xsl:call-template name="translate-unit">
  1181. <xsl:with-param name="column-number" select="substring-before(substring-after($base-address,'R'),'C')"/>
  1182. <xsl:with-param name="row-number" select="substring-after($base-address,'C')"/>
  1183. <xsl:with-param name="column-pos-style" select="absolute"/>
  1184. <xsl:with-param name="row-pos-style" select="absolute"/>
  1185. </xsl:call-template>
  1186. </xsl:variable>
  1187. <xsl:variable name="condition-value">
  1188. <xsl:call-template name="translate-condition">
  1189. </xsl:call-template>
  1190. </xsl:variable>
  1191. <xsl:element name="style:map">
  1192. <xsl:attribute name="style:condition"><xsl:value-of select="$condition-value"/></xsl:attribute>
  1193. <xsl:attribute name="style:apply-style-name"><xsl:value-of select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:attribute>
  1194. <xsl:attribute name="style:base-cell-address"><xsl:value-of select="concat(../../@Name,'.',$base-cell-address)"/></xsl:attribute>
  1195. </xsl:element>
  1196. </xsl:for-each>
  1197. </xsl:element>
  1198. </xsl:for-each>
  1199. </xsl:template>
  1200. <xsl:template name="translate-condition">
  1201. <xsl:variable name="address-value">
  1202. <xsl:call-template name="translate-expression">
  1203. <xsl:with-param name="cell-row-pos" select="0"/>
  1204. <xsl:with-param name="cell-column-pos" select="0"/>
  1205. <xsl:with-param name="expression" select="表:第一操作数"/>
  1206. <xsl:with-param name="return-value" select="''"/>
  1207. </xsl:call-template>
  1208. </xsl:variable>
  1209. <xsl:choose>
  1210. <xsl:when test="表:操作码">
  1211. <xsl:variable name="qualifier" select="表:操作码"/>
  1212. <xsl:variable name="first-value" select="表:第一操作数"/>
  1213. <xsl:choose>
  1214. <xsl:when test="$qualifier = 'Equal'">
  1215. <xsl:choose>
  1216. <xsl:when test="starts-with($first-value,'&quot;')">
  1217. <xsl:value-of select="concat('cell-content()=',$address-value)"/>
  1218. </xsl:when>
  1219. <xsl:otherwise>
  1220. <xsl:value-of select="concat('cell-content()=[',$address-value,']')"/>
  1221. </xsl:otherwise>
  1222. </xsl:choose>
  1223. </xsl:when>
  1224. <xsl:when test="$qualifier = 'Less'">
  1225. <xsl:value-of select="concat('cell-content()&lt;[',$address-value,']')"/>
  1226. </xsl:when>
  1227. <xsl:when test="$qualifier = 'Greater'">
  1228. <xsl:value-of select="concat('cell-content()&gt;[',$address-value,']')"/>
  1229. </xsl:when>
  1230. <xsl:when test="$qualifier = 'LessOrEqual'">
  1231. <xsl:value-of select="concat('cell-content()&lt;=[',$address-value,']')"/>
  1232. </xsl:when>
  1233. <xsl:when test="$qualifier = 'GreaterOrEqual'">
  1234. <xsl:value-of select="concat('cell-content()&gt;=[',$address-value,']')"/>
  1235. </xsl:when>
  1236. <xsl:when test="$qualifier = 'NotEqual'">
  1237. <xsl:value-of select="concat('cell-content()!=[',$address-value,']')"/>
  1238. </xsl:when>
  1239. <xsl:when test="$qualifier = 'Between'">
  1240. <xsl:variable name="second-value">
  1241. <xsl:call-template name="translate-expression">
  1242. <xsl:with-param name="cell-row-pos" select="0"/>
  1243. <xsl:with-param name="cell-column-pos" select="0"/>
  1244. <xsl:with-param name="expression" select="表:第二操作数"/>
  1245. <xsl:with-param name="return-value" select="''"/>
  1246. </xsl:call-template>
  1247. </xsl:variable>
  1248. <xsl:value-of select="concat('cell-content-is-between([',$address-value,'],[',$second-value,'])')"/>
  1249. </xsl:when>
  1250. <xsl:when test="$qualifier = 'NotBetween'">
  1251. <xsl:variable name="second-value">
  1252. <xsl:call-template name="translate-expression">
  1253. <xsl:with-param name="cell-row-pos" select="0"/>
  1254. <xsl:with-param name="cell-column-pos" select="0"/>
  1255. <xsl:with-param name="expression" select="表:第二操作数"/>
  1256. <xsl:with-param name="return-value" select="''"/>
  1257. </xsl:call-template>
  1258. </xsl:variable>
  1259. <xsl:value-of select="concat('cell-content-is-not-between([',$address-value,'],[',$second-value,'])')"/>
  1260. </xsl:when>
  1261. </xsl:choose>
  1262. </xsl:when>
  1263. <xsl:otherwise>
  1264. <xsl:value-of select="concat('is-true-formula(',$address-value,')')"/>
  1265. </xsl:otherwise>
  1266. </xsl:choose>
  1267. </xsl:template>
  1268. <xsl:template name="translate-expression">
  1269. <xsl:param name="cell-row-pos"/>
  1270. <xsl:param name="cell-column-pos"/>
  1271. <xsl:param name="expression"/>
  1272. <xsl:param name="return-value"/>
  1273. <xsl:variable name="temp-range">
  1274. <xsl:choose>
  1275. <xsl:when test="$expression != ''">
  1276. <xsl:call-template name="parse-range-name">
  1277. <xsl:with-param name="expression" select="$expression"/>
  1278. <xsl:with-param name="return-value" select="''"/>
  1279. </xsl:call-template>
  1280. </xsl:when>
  1281. <xsl:otherwise>
  1282. <xsl:value-of select="''"/>
  1283. </xsl:otherwise>
  1284. </xsl:choose>
  1285. </xsl:variable>
  1286. <xsl:variable name="range-type">
  1287. <xsl:choose>
  1288. <xsl:when test="substring($temp-range, 1, 1) = '1'">
  1289. <xsl:value-of select="1"/>
  1290. </xsl:when>
  1291. <xsl:when test="substring($temp-range, 1, 1) = '2'">
  1292. <xsl:value-of select="2"/>
  1293. </xsl:when>
  1294. <xsl:otherwise>
  1295. <xsl:value-of select="2"/>
  1296. </xsl:otherwise>
  1297. </xsl:choose>
  1298. </xsl:variable>
  1299. <xsl:variable name="current-range">
  1300. <xsl:value-of select="substring($temp-range, 2)"/>
  1301. </xsl:variable>
  1302. <xsl:choose>
  1303. <xsl:when test="$range-type = 1">
  1304. <xsl:call-template name="translate-expression">
  1305. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1306. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1307. <xsl:with-param name="expression">
  1308. <xsl:choose>
  1309. <xsl:when test="contains($current-range, '#$')">
  1310. <xsl:variable name="temp-token">
  1311. <xsl:choose>
  1312. <xsl:when test="contains($current-range, '\')">
  1313. <xsl:value-of select="concat(']', substring-after($current-range, '#$'), &quot;&apos;&quot;)"/>
  1314. </xsl:when>
  1315. <xsl:otherwise>
  1316. <xsl:value-of select="substring-after($current-range, '#$')"/>
  1317. </xsl:otherwise>
  1318. </xsl:choose>
  1319. </xsl:variable>
  1320. <xsl:value-of select="substring-after($expression, $temp-token)"/>
  1321. </xsl:when>
  1322. <xsl:otherwise>
  1323. <xsl:value-of select="substring-after($expression, $current-range)"/>
  1324. </xsl:otherwise>
  1325. </xsl:choose>
  1326. </xsl:with-param>
  1327. <xsl:with-param name="return-value">
  1328. <xsl:choose>
  1329. <xsl:when test="$current-range = '='">
  1330. <xsl:text>oooc:=</xsl:text>
  1331. </xsl:when>
  1332. <xsl:when test="substring($current-range, string-length($current-range)) = '('">
  1333. <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range, '[.')"/>
  1334. </xsl:when>
  1335. <xsl:when test="$current-range = ','">
  1336. <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '];[.')"/>
  1337. </xsl:when>
  1338. <xsl:when test="$current-range = ')'">
  1339. <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '])')"/>
  1340. </xsl:when>
  1341. <xsl:otherwise>
  1342. <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
  1343. </xsl:otherwise>
  1344. </xsl:choose>
  1345. </xsl:with-param>
  1346. </xsl:call-template>
  1347. </xsl:when>
  1348. <xsl:otherwise>
  1349. <xsl:variable name="handle-type">
  1350. <xsl:choose>
  1351. <xsl:when test="starts-with($current-range, 'R')">
  1352. <xsl:choose>
  1353. <xsl:when test="contains($current-range, 'C')">
  1354. <xsl:variable name="part-type-r">
  1355. <xsl:call-template name="handle-type-number">
  1356. <xsl:with-param name="t-part" select="substring-before( substring-after($current-range, 'R'), 'C')"/>
  1357. </xsl:call-template>
  1358. </xsl:variable>
  1359. <xsl:variable name="part-type-c">
  1360. <xsl:call-template name="handle-type-number">
  1361. <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
  1362. </xsl:call-template>
  1363. </xsl:variable>
  1364. <xsl:choose>
  1365. <xsl:when test="($part-type-r = 1) and ($part-type-c = 1)">
  1366. <xsl:value-of select="1"/>
  1367. </xsl:when>
  1368. <xsl:otherwise>
  1369. <xsl:value-of select="4"/>
  1370. </xsl:otherwise>
  1371. </xsl:choose>
  1372. </xsl:when>
  1373. <xsl:otherwise>
  1374. <xsl:variable name="part-type">
  1375. <xsl:call-template name="handle-type-number">
  1376. <xsl:with-param name="t-part" select="substring-after($current-range, 'R')"/>
  1377. </xsl:call-template>
  1378. </xsl:variable>
  1379. <xsl:choose>
  1380. <xsl:when test="$part-type = 1">
  1381. <xsl:value-of select="2"/>
  1382. </xsl:when>
  1383. <xsl:when test="$part-type = 2">
  1384. <xsl:value-of select="4"/>
  1385. </xsl:when>
  1386. <xsl:otherwise>
  1387. <xsl:value-of select="4"/>
  1388. </xsl:otherwise>
  1389. </xsl:choose>
  1390. </xsl:otherwise>
  1391. </xsl:choose>
  1392. </xsl:when>
  1393. <xsl:when test="starts-with($current-range, 'C')">
  1394. <xsl:variable name="part-type">
  1395. <xsl:call-template name="handle-type-number">
  1396. <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
  1397. </xsl:call-template>
  1398. </xsl:variable>
  1399. <xsl:choose>
  1400. <xsl:when test="$part-type = 1">
  1401. <xsl:value-of select="3"/>
  1402. </xsl:when>
  1403. <xsl:when test="$part-type = 2">
  1404. <xsl:value-of select="4"/>
  1405. </xsl:when>
  1406. <xsl:otherwise>
  1407. <xsl:value-of select="4"/>
  1408. </xsl:otherwise>
  1409. </xsl:choose>
  1410. </xsl:when>
  1411. <xsl:otherwise>
  1412. <xsl:value-of select="4"/>
  1413. </xsl:otherwise>
  1414. </xsl:choose>
  1415. </xsl:variable>
  1416. <xsl:choose>
  1417. <xsl:when test="$handle-type = 1">
  1418. <xsl:variable name="after-R">
  1419. <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
  1420. </xsl:variable>
  1421. <xsl:choose>
  1422. <xsl:when test="$after-R='C' or $after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
  1423. <xsl:variable name="row-pos">
  1424. <xsl:choose>
  1425. <xsl:when test="$after-R='['">
  1426. <xsl:value-of select="$cell-row-pos+substring-before( substring-after($current-range,'R['),']')"/>
  1427. </xsl:when>
  1428. <xsl:when test="$after-R='C'">
  1429. <xsl:value-of select="$cell-row-pos"/>
  1430. </xsl:when>
  1431. <xsl:otherwise>
  1432. <xsl:value-of select="substring-before(substring-after($current-range,'R'),'C')"/>
  1433. </xsl:otherwise>
  1434. </xsl:choose>
  1435. </xsl:variable>
  1436. <xsl:variable name="row-pos-style">
  1437. <xsl:choose>
  1438. <xsl:when test="$after-R='[' or $after-R='C'">relative</xsl:when>
  1439. <xsl:otherwise>absolute</xsl:otherwise>
  1440. </xsl:choose>
  1441. </xsl:variable>
  1442. <xsl:variable name="after-C">
  1443. <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,1)"/>
  1444. </xsl:variable>
  1445. <xsl:variable name="column-digit-length">
  1446. <xsl:choose>
  1447. <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
  1448. <xsl:call-template name="get-digit-length">
  1449. <xsl:with-param name="complexive-string" select="substring-after(substring-after($current-range,'R'),'C')"/>
  1450. </xsl:call-template>
  1451. </xsl:when>
  1452. </xsl:choose>
  1453. </xsl:variable>
  1454. <xsl:variable name="column-pos">
  1455. <xsl:choose>
  1456. <xsl:when test="$after-C='['">
  1457. <xsl:value-of select="$cell-column-pos + substring-before(substring-after(substring-after($current-range,'R'),'C['),']')"/>
  1458. </xsl:when>
  1459. <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
  1460. <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,$column-digit-length)"/>
  1461. </xsl:when>
  1462. <xsl:otherwise>
  1463. <xsl:value-of select="$cell-column-pos"/>
  1464. </xsl:otherwise>
  1465. </xsl:choose>
  1466. </xsl:variable>
  1467. <xsl:variable name="column-pos-style">
  1468. <xsl:choose>
  1469. <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">absolute</xsl:when>
  1470. <xsl:otherwise>relative</xsl:otherwise>
  1471. </xsl:choose>
  1472. </xsl:variable>
  1473. <xsl:variable name="trans-unit">
  1474. <xsl:call-template name="translate-unit">
  1475. <xsl:with-param name="column-number" select="$column-pos"/>
  1476. <xsl:with-param name="row-number" select="$row-pos"/>
  1477. <xsl:with-param name="column-pos-style" select="$column-pos-style"/>
  1478. <xsl:with-param name="row-pos-style" select="$row-pos-style"/>
  1479. </xsl:call-template>
  1480. </xsl:variable>
  1481. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit)"/>
  1482. <xsl:call-template name="translate-expression">
  1483. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1484. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1485. <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
  1486. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1487. </xsl:call-template>
  1488. </xsl:when>
  1489. <xsl:otherwise>
  1490. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before(substring-after($expression, '('),'R'),',!', ';.'))"/>
  1491. <xsl:call-template name="translate-expression">
  1492. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1493. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1494. <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
  1495. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1496. </xsl:call-template>
  1497. </xsl:otherwise>
  1498. </xsl:choose>
  1499. </xsl:when>
  1500. <xsl:when test="$handle-type = 2">
  1501. <xsl:variable name="after-R">
  1502. <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
  1503. </xsl:variable>
  1504. <xsl:choose>
  1505. <xsl:when test="$after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
  1506. <xsl:variable name="row-number">
  1507. <xsl:choose>
  1508. <xsl:when test="$after-R = '['">
  1509. <xsl:value-of select="substring-before(substring-after($current-range, 'R['), ']')"/>
  1510. </xsl:when>
  1511. <xsl:otherwise>
  1512. <xsl:value-of select="substring-after($current-range, 'R')"/>
  1513. </xsl:otherwise>
  1514. </xsl:choose>
  1515. </xsl:variable>
  1516. <xsl:variable name="row-pos">
  1517. <xsl:choose>
  1518. <xsl:when test="$after-R='['">
  1519. <xsl:value-of select="$cell-row-pos + $row-number"/>
  1520. </xsl:when>
  1521. <xsl:when test="$after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
  1522. <xsl:value-of select="$row-number"/>
  1523. </xsl:when>
  1524. <xsl:otherwise>
  1525. <xsl:value-of select="$cell-row-pos"/>
  1526. </xsl:otherwise>
  1527. </xsl:choose>
  1528. </xsl:variable>
  1529. <xsl:variable name="trans-unit1">
  1530. <xsl:call-template name="translate-unit">
  1531. <xsl:with-param name="column-number" select="1"/>
  1532. <xsl:with-param name="row-number" select="$row-pos"/>
  1533. <xsl:with-param name="column-pos-style" select="'relative'"/>
  1534. <xsl:with-param name="row-pos-style" select="'relative'"/>
  1535. </xsl:call-template>
  1536. </xsl:variable>
  1537. <xsl:variable name="trans-unit2">
  1538. <xsl:call-template name="translate-unit">
  1539. <xsl:with-param name="column-number" select="256"/>
  1540. <xsl:with-param name="row-number" select="$row-pos"/>
  1541. <xsl:with-param name="column-pos-style" select="'relative'"/>
  1542. <xsl:with-param name="row-pos-style" select="'relative'"/>
  1543. </xsl:call-template>
  1544. </xsl:variable>
  1545. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
  1546. <xsl:call-template name="translate-expression">
  1547. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1548. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1549. <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
  1550. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1551. </xsl:call-template>
  1552. </xsl:when>
  1553. <xsl:otherwise>
  1554. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'R'),',!', ';.'),'R')"/>
  1555. <xsl:call-template name="translate-expression">
  1556. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1557. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1558. <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
  1559. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1560. </xsl:call-template>
  1561. </xsl:otherwise>
  1562. </xsl:choose>
  1563. </xsl:when>
  1564. <xsl:when test="$handle-type = 3">
  1565. <xsl:variable name="after-C">
  1566. <xsl:value-of select="substring(substring-after($current-range,'C'),1,1)"/>
  1567. </xsl:variable>
  1568. <xsl:choose>
  1569. <xsl:when test="$after-C='[' or $after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
  1570. <xsl:variable name="column-number">
  1571. <xsl:choose>
  1572. <xsl:when test="$after-C = '['">
  1573. <xsl:value-of select="substring-before(substring-after($current-range, 'C['), ']')"/>
  1574. </xsl:when>
  1575. <xsl:otherwise>
  1576. <xsl:value-of select="substring-after($current-range, 'C')"/>
  1577. </xsl:otherwise>
  1578. </xsl:choose>
  1579. </xsl:variable>
  1580. <xsl:variable name="column-pos">
  1581. <xsl:choose>
  1582. <xsl:when test="$after-C='['">
  1583. <xsl:value-of select="$cell-column-pos + $column-number"/>
  1584. </xsl:when>
  1585. <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
  1586. <xsl:value-of select="$column-number"/>
  1587. </xsl:when>
  1588. <xsl:otherwise>
  1589. <xsl:value-of select="$cell-column-pos"/>
  1590. </xsl:otherwise>
  1591. </xsl:choose>
  1592. </xsl:variable>
  1593. <xsl:variable name="trans-unit1">
  1594. <xsl:call-template name="translate-unit">
  1595. <xsl:with-param name="column-number" select="$column-pos"/>
  1596. <xsl:with-param name="row-number" select="1"/>
  1597. <xsl:with-param name="column-pos-style" select="'relative'"/>
  1598. <xsl:with-param name="row-pos-style" select="'relative'"/>
  1599. </xsl:call-template>
  1600. </xsl:variable>
  1601. <xsl:variable name="trans-unit2">
  1602. <xsl:call-template name="translate-unit">
  1603. <xsl:with-param name="column-number" select="$column-pos"/>
  1604. <xsl:with-param name="row-number" select="32000"/>
  1605. <xsl:with-param name="column-pos-style" select="'relative'"/>
  1606. <xsl:with-param name="row-pos-style" select="'relative'"/>
  1607. </xsl:call-template>
  1608. </xsl:variable>
  1609. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
  1610. <xsl:call-template name="translate-expression">
  1611. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1612. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1613. <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
  1614. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1615. </xsl:call-template>
  1616. </xsl:when>
  1617. <xsl:otherwise>
  1618. <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'C'),',!', ';.'),'C')"/>
  1619. <xsl:call-template name="translate-expression">
  1620. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1621. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1622. <xsl:with-param name="expression" select="substring-after($current-range,'C')"/>
  1623. <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
  1624. </xsl:call-template>
  1625. </xsl:otherwise>
  1626. </xsl:choose>
  1627. </xsl:when>
  1628. <xsl:otherwise>
  1629. <xsl:variable name="next-pit" select="substring-after($expression, $current-range)"/>
  1630. <xsl:choose>
  1631. <xsl:when test="contains($next-pit, '+') or contains($next-pit, '-') or contains($next-pit, '*') or contains($next-pit, '/') or contains($next-pit, ')') or contains($next-pit, '^') or contains($next-pit, ':') or contains($next-pit, '&quot;') or contains($next-pit, ';') or contains($next-pit, ',') or contains($next-pit, '[')">
  1632. <xsl:call-template name="translate-expression">
  1633. <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
  1634. <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
  1635. <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
  1636. <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
  1637. </xsl:call-template>
  1638. </xsl:when>
  1639. <xsl:otherwise>
  1640. <xsl:value-of select="translate( concat($return-value, substring-before($expression, $current-range), $current-range),',!', ';.')"/>
  1641. </xsl:otherwise>
  1642. </xsl:choose>
  1643. </xsl:otherwise>
  1644. </xsl:choose>
  1645. </xsl:otherwise>
  1646. </xsl:choose>
  1647. </xsl:template>
  1648. <xsl:template name="parse-range-name">
  1649. <xsl:param name="expression"/>
  1650. <xsl:param name="return-value"/>
  1651. <xsl:variable name="first-one" select="substring($expression,1,1)"/>
  1652. <xsl:choose>
  1653. <xsl:when test="$first-one = '='">
  1654. <xsl:choose>
  1655. <xsl:when test="string-length(normalize-space($return-value)) &gt; 0">
  1656. <xsl:value-of select="concat('2', $return-value)"/>
  1657. </xsl:when>
  1658. <xsl:otherwise>
  1659. <xsl:text>1=</xsl:text>
  1660. </xsl:otherwise>
  1661. </xsl:choose>
  1662. </xsl:when>
  1663. <xsl:when test="$first-one='(' or $first-one='!' or $first-one='&amp;'">
  1664. <xsl:value-of select="concat('1', $return-value, $first-one)"/>
  1665. </xsl:when>
  1666. <xsl:when test="$first-one='['">
  1667. <xsl:choose>
  1668. <xsl:when test="starts-with(substring-after($expression, ']'), 'C')">
  1669. <xsl:call-template name="parse-range-name">
  1670. <xsl:with-param name="expression" select="substring-after($expression, ']')"/>
  1671. <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, ']'), ']')"/>
  1672. </xsl:call-template>
  1673. </xsl:when>
  1674. <xsl:when test="contains(substring-before($expression, ']'), '.') and contains(substring-after($expression, ']'), '!')">
  1675. <xsl:value-of select="concat('1', &quot;&apos;&quot;, substring-before(substring-after($expression, '['), ']'), &quot;&apos;&quot;, '#$', substring-before(substring-after($expression, ']'), '!'))"/>
  1676. </xsl:when>
  1677. <xsl:otherwise>
  1678. <xsl:value-of select="concat('2', $return-value, substring-before($expression, ']'), ']')"/>
  1679. </xsl:otherwise>
  1680. </xsl:choose>
  1681. </xsl:when>
  1682. <xsl:when test="$first-one='&quot;'">
  1683. <xsl:value-of select="concat('1', $first-one, substring-before(substring-after($expression, '&quot;'), '&quot;'), '&quot;')"/>
  1684. </xsl:when>
  1685. <xsl:when test="$first-one=&quot;&apos;&quot;">
  1686. <xsl:variable name="str-in" select="substring-before(substring-after($expression, &quot;&apos;&quot;), &quot;&apos;&quot;)"/>
  1687. <xsl:choose>
  1688. <xsl:when test="contains($str-in, '\') and contains($str-in, '[') and contains($str-in, ']')">
  1689. <xsl:variable name="first-pos" select="substring-before($str-in, '[')"/>
  1690. <xsl:variable name="second-pos" select="substring-before(substring-after($str-in, '['), ']')"/>
  1691. <xsl:variable name="third-pos" select="substring-after($str-in, ']')"/>
  1692. <xsl:value-of select="concat('1', &quot;&apos;&quot;, $first-pos, $second-pos, &quot;&apos;&quot;, '#$', $third-pos)"/>
  1693. </xsl:when>
  1694. <xsl:otherwise>
  1695. <xsl:value-of select="concat('1', &quot;&apos;&quot;, $str-in, &quot;&apos;&quot;)"/>
  1696. </xsl:otherwise>
  1697. </xsl:choose>
  1698. </xsl:when>
  1699. <xsl:when test="$first-one='+' or $first-one='-' or $first-one='*' or $first-one='/' or $first-one=')' or $first-one='^' or $first-one=':' or $first-one='&quot;' or $first-one=';' or $first-one=',' or $first-one='&gt;' or $first-one='&lt;'">
  1700. <xsl:choose>
  1701. <xsl:when test="$return-value = ''">
  1702. <xsl:value-of select="concat('1', $first-one)"/>
  1703. </xsl:when>
  1704. <xsl:otherwise>
  1705. <xsl:value-of select="concat('2', $return-value)"/>
  1706. </xsl:otherwise>
  1707. </xsl:choose>
  1708. </xsl:when>
  1709. <xsl:otherwise>
  1710. <xsl:choose>
  1711. <xsl:when test="$expression = ''">
  1712. <xsl:value-of select="concat('2', $return-value)"/>
  1713. </xsl:when>
  1714. <xsl:otherwise>
  1715. <xsl:call-template name="parse-range-name">
  1716. <xsl:with-param name="expression" select="substring($expression, 2, string-length($expression)-1)"/>
  1717. <xsl:with-param name="return-value" select="concat($return-value, substring($expression, 1, 1))"/>
  1718. </xsl:call-template>
  1719. </xsl:otherwise>
  1720. </xsl:choose>
  1721. </xsl:otherwise>
  1722. </xsl:choose>
  1723. </xsl:template>
  1724. <xsl:template name="handle-type-number">
  1725. <xsl:param name="t-part"/>
  1726. <xsl:choose>
  1727. <xsl:when test="starts-with($t-part, '[')">
  1728. <xsl:variable name="tt-str" select="substring-before( substring-after( $t-part, '['), ']')"/>
  1729. <xsl:choose>
  1730. <xsl:when test="($tt-str &lt; 0) or ($tt-str &gt; 0) or ($tt-str = 0)">
  1731. <xsl:value-of select="1"/>
  1732. </xsl:when>
  1733. <xsl:otherwise>
  1734. <xsl:value-of select="2"/>
  1735. </xsl:otherwise>
  1736. </xsl:choose>
  1737. </xsl:when>
  1738. <xsl:when test="($t-part &lt; 0) or ($t-part &gt; 0) or ($t-part = 0)">
  1739. <xsl:value-of select="1"/>
  1740. </xsl:when>
  1741. <xsl:when test="$t-part = ''">
  1742. <xsl:value-of select="1"/>
  1743. </xsl:when>
  1744. <xsl:otherwise>
  1745. <xsl:value-of select="2"/>
  1746. </xsl:otherwise>
  1747. </xsl:choose>
  1748. </xsl:template>
  1749. <xsl:template name="translate-unit">
  1750. <xsl:param name="column-number"/>
  1751. <xsl:param name="row-number"/>
  1752. <xsl:param name="column-pos-style"/>
  1753. <xsl:param name="row-pos-style"/>
  1754. <xsl:variable name="column-number1">
  1755. <xsl:value-of select="floor( $column-number div 26 )"/>
  1756. </xsl:variable>
  1757. <xsl:variable name="column-number2">
  1758. <xsl:value-of select="$column-number mod 26"/>
  1759. </xsl:variable>
  1760. <xsl:variable name="column-character1">
  1761. <xsl:call-template name="number-to-character">
  1762. <xsl:with-param name="number" select="$column-number1"/>
  1763. </xsl:call-template>
  1764. </xsl:variable>
  1765. <xsl:variable name="column-character2">
  1766. <xsl:call-template name="number-to-character">
  1767. <xsl:with-param name="number" select="$column-number2"/>
  1768. </xsl:call-template>
  1769. </xsl:variable>
  1770. <xsl:choose>
  1771. <xsl:when test="$column-pos-style = 'absolute'">
  1772. <xsl:value-of select="concat( '$', $column-character1, $column-character2)"/>
  1773. </xsl:when>
  1774. <xsl:otherwise>
  1775. <xsl:value-of select="concat( $column-character1, $column-character2)"/>
  1776. </xsl:otherwise>
  1777. </xsl:choose>
  1778. <xsl:choose>
  1779. <xsl:when test="$row-pos-style ='absolute'">
  1780. <xsl:value-of select="concat( '$', $row-number)"/>
  1781. </xsl:when>
  1782. <xsl:otherwise>
  1783. <xsl:value-of select="$row-number"/>
  1784. </xsl:otherwise>
  1785. </xsl:choose>
  1786. </xsl:template>
  1787. <xsl:template name="number-to-character">
  1788. <xsl:param name="number"/>
  1789. <xsl:choose>
  1790. <xsl:when test="$number = 0"/>
  1791. <xsl:when test="$number = 1">A</xsl:when>
  1792. <xsl:when test="$number = 2">B</xsl:when>
  1793. <xsl:when test="$number = 3">C</xsl:when>
  1794. <xsl:when test="$number = 4">D</xsl:when>
  1795. <xsl:when test="$number = 5">E</xsl:when>
  1796. <xsl:when test="$number = 6">F</xsl:when>
  1797. <xsl:when test="$number = 7">G</xsl:when>
  1798. <xsl:when test="$number = 8">H</xsl:when>
  1799. <xsl:when test="$number = 9">I</xsl:when>
  1800. <xsl:when test="$number = 10">J</xsl:when>
  1801. <xsl:when test="$number = 11">K</xsl:when>
  1802. <xsl:when test="$number = 12">L</xsl:when>
  1803. <xsl:when test="$number = 13">M</xsl:when>
  1804. <xsl:when test="$number = 14">N</xsl:when>
  1805. <xsl:when test="$number = 15">O</xsl:when>
  1806. <xsl:when test="$number = 16">P</xsl:when>
  1807. <xsl:when test="$number = 17">Q</xsl:when>
  1808. <xsl:when test="$number = 18">R</xsl:when>
  1809. <xsl:when test="$number = 19">S</xsl:when>
  1810. <xsl:when test="$number = 20">T</xsl:when>
  1811. <xsl:when test="$number = 21">U</xsl:when>
  1812. <xsl:when test="$number = 22">V</xsl:when>
  1813. <xsl:when test="$number = 23">W</xsl:when>
  1814. <xsl:when test="$number = 24">X</xsl:when>
  1815. <xsl:when test="$number = 25">Y</xsl:when>
  1816. <xsl:when test="$number = 26">Z</xsl:when>
  1817. <xsl:otherwise/>
  1818. </xsl:choose>
  1819. </xsl:template>
  1820. <xsl:template name="get-digit-length">
  1821. <xsl:param name="complexive-string"/>
  1822. <xsl:variable name="first-char">
  1823. <xsl:value-of select="substring( $complexive-string, 1, 1)"/>
  1824. </xsl:variable>
  1825. <xsl:choose>
  1826. <xsl:when test="$first-char = '1' or $first-char = '2' or $first-char = '3' or $first-char = '4' or $first-char = '5' or $first-char = '6' or $first-char = '7' or $first-char = '8' or $first-char = '9' or $first-char = '0' ">
  1827. <xsl:variable name="temp">
  1828. <xsl:call-template name="get-digit-length">
  1829. <xsl:with-param name="complexive-string" select="substring( $complexive-string, 2)"/>
  1830. </xsl:call-template>
  1831. </xsl:variable>
  1832. <xsl:value-of select="$temp+1"/>
  1833. </xsl:when>
  1834. <xsl:otherwise>0</xsl:otherwise>
  1835. </xsl:choose>
  1836. </xsl:template>
  1837. <xsl:template match="字:句属性" mode="style">
  1838. <!--chengxz 0725-->
  1839. <xsl:if test="not(@字:式样引用)">
  1840. <xsl:element name="style:style">
  1841. <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
  1842. <xsl:attribute name="style:family">text</xsl:attribute>
  1843. <xsl:if test="@字:式样引用">
  1844. <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
  1845. </xsl:if>
  1846. <xsl:element name="style:text-properties">
  1847. <xsl:apply-templates select="./*"/>
  1848. </xsl:element>
  1849. </xsl:element>
  1850. </xsl:if>
  1851. </xsl:template>
  1852. <xsl:template name="style-style-content">
  1853. <xsl:variable name="style-name" select="@表:标识符"/>
  1854. <xsl:variable name="apply-style-name" select="@表:名称"/>
  1855. <xsl:attribute name="style:family"><xsl:choose><xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">table-column</xsl:when><xsl:otherwise>table-cell</xsl:otherwise></xsl:choose></xsl:attribute>
  1856. <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽">
  1857. <xsl:element name="style:table-column-properties">
  1858. <xsl:attribute name="style:column-width"><xsl:value-of select="concat(/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽,$uofUnit)"/></xsl:attribute>
  1859. <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:跨度">
  1860. <xsl:attribute name="fo:break-before">auto</xsl:attribute>
  1861. </xsl:if>
  1862. <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">
  1863. <xsl:if test="preceding-sibling::表:列[1]/@表:跨度 and ancestor::表:工作表/表:分页符集/表:分页符/@表:列号">
  1864. <xsl:variable name="kuadu">
  1865. <xsl:value-of select="preceding-sibling::表:列[1]/@表:跨度"/>
  1866. </xsl:variable>
  1867. <xsl:if test="not($kuadu='1')">
  1868. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  1869. </xsl:if>
  1870. <xsl:if test="$kuadu='1' and not(preceding::表:列[2])">
  1871. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  1872. </xsl:if>
  1873. </xsl:if>
  1874. </xsl:for-each>
  1875. </xsl:element>
  1876. </xsl:if>
  1877. <xsl:element name="style:table-cell-properties">
  1878. <xsl:if test="表:对齐格式">
  1879. <xsl:if test="表:对齐格式/表:垂直对齐方式">
  1880. <xsl:variable name="vertical-align">
  1881. <xsl:choose>
  1882. <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'top'">top</xsl:when>
  1883. <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'center'">center</xsl:when>
  1884. <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'bottom'">bottom</xsl:when>
  1885. <xsl:otherwise>middle</xsl:otherwise>
  1886. </xsl:choose>
  1887. </xsl:variable>
  1888. <xsl:attribute name="style:vertical-align"><xsl:value-of select="$vertical-align"/></xsl:attribute>
  1889. </xsl:if>
  1890. <xsl:if test="表:对齐格式/表:自动换行/@表:值 = 'true'">
  1891. <xsl:attribute name="fo:wrap-option">wrap</xsl:attribute>
  1892. </xsl:if>
  1893. <xsl:if test="表:对齐格式/表:缩进">
  1894. <xsl:attribute name="fo:padding-left"><xsl:variable name="indent" select="表:对齐格式/表:缩进 * 10"/><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat($indent,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  1895. </xsl:if>
  1896. <xsl:if test="表:对齐格式/表:文字旋转角度">
  1897. <xsl:attribute name="style:rotation-angle"><xsl:choose><xsl:when test="表:对齐格式/表:文字旋转角度 &lt; 0"><xsl:value-of select="360 - 表:对齐格式/表:文字旋转角度"/></xsl:when><xsl:otherwise><xsl:value-of select="表:对齐格式/表:文字旋转角度"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1898. <xsl:attribute name="style:rotation-align">none</xsl:attribute>
  1899. </xsl:if>
  1900. <xsl:if test="表:对齐格式/表:文字方向 = 'vertical'">
  1901. <xsl:attribute name="style:direction">ttb</xsl:attribute>
  1902. <xsl:if test="not(表:对齐格式/字:水平对齐方式)">
  1903. <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
  1904. </xsl:if>
  1905. </xsl:if>
  1906. </xsl:if>
  1907. <!--xsl:if test="表:边框">
  1908. <xsl:apply-templates select="表:边框" />
  1909. </xsl:if-->
  1910. <!--chenjh add 边框 again-->
  1911. <xsl:if test="表:边框/uof:上/@uof:宽度 !=''">
  1912. <xsl:variable name="top-line-width" select="concat(表:边框/uof:上/@uof:宽度,$uofUnit)"/>
  1913. <xsl:variable name="top-line-tyle">
  1914. <xsl:choose>
  1915. <xsl:when test="表:边框/uof:上/@uof:类型='single'">solid</xsl:when>
  1916. <xsl:when test="表:边框/uof:上/@uof:类型='double'">double</xsl:when>
  1917. </xsl:choose>
  1918. </xsl:variable>
  1919. <xsl:variable name="top-line-color" select="表:边框/uof:上/@uof:颜色"/>
  1920. <xsl:variable name="border-top" select="concat($top-line-width,' ',$top-line-tyle,' ',$top-line-color)"/>
  1921. <xsl:attribute name="fo:border-top"><xsl:value-of select="$border-top"/></xsl:attribute>
  1922. </xsl:if>
  1923. <xsl:if test="表:边框/uof:下/@uof:宽度 !=''">
  1924. <xsl:variable name="bottom-line-width" select="concat(表:边框/uof:下/@uof:宽度,$uofUnit)"/>
  1925. <xsl:variable name="bottom-line-tyle">
  1926. <xsl:choose>
  1927. <xsl:when test="表:边框/uof:下/@uof:类型='single'">solid</xsl:when>
  1928. <xsl:when test="表:边框/uof:下/@uof:类型='double'">double</xsl:when>
  1929. </xsl:choose>
  1930. </xsl:variable>
  1931. <xsl:variable name="bottom-line-color" select="表:边框/uof:下/@uof:颜色"/>
  1932. <xsl:variable name="border-bottom" select="concat($bottom-line-width,' ',$bottom-line-tyle,' ',$bottom-line-color)"/>
  1933. <xsl:attribute name="fo:border-bottom"><xsl:value-of select="$border-bottom"/></xsl:attribute>
  1934. </xsl:if>
  1935. <xsl:if test="表:边框/uof:左/@uof:宽度 !=''">
  1936. <xsl:variable name="left-line-width" select="concat(表:边框/uof:左/@uof:宽度,$uofUnit)"/>
  1937. <xsl:variable name="left-line-tyle">
  1938. <xsl:choose>
  1939. <xsl:when test="表:边框/uof:左/@uof:类型='single'">solid</xsl:when>
  1940. <xsl:when test="表:边框/uof:左/@uof:类型='double'">double</xsl:when>
  1941. </xsl:choose>
  1942. </xsl:variable>
  1943. <xsl:variable name="left-line-color" select="表:边框/uof:左/@uof:颜色"/>
  1944. <xsl:variable name="border-left" select="concat($left-line-width,' ',$left-line-tyle,' ',$left-line-color)"/>
  1945. <xsl:attribute name="fo:border-left"><xsl:value-of select="$border-left"/></xsl:attribute>
  1946. </xsl:if>
  1947. <xsl:if test="表:边框/uof:右/@uof:宽度 !=''">
  1948. <xsl:variable name="right-line-width" select="concat(表:边框/uof:右/@uof:宽度,$uofUnit)"/>
  1949. <xsl:variable name="right-line-tyle">
  1950. <xsl:choose>
  1951. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  1952. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  1953. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  1954. <xsl:otherwise>solid</xsl:otherwise>
  1955. </xsl:choose>
  1956. </xsl:variable>
  1957. <xsl:variable name="right-line-color" select="表:边框/uof:右/@uof:颜色"/>
  1958. <xsl:variable name="border-right" select="concat($right-line-width,' ',$right-line-tyle,' ',$right-line-color)"/>
  1959. <xsl:attribute name="fo:border-right"><xsl:value-of select="$border-right"/></xsl:attribute>
  1960. </xsl:if>
  1961. <xsl:if test="表:边框/uof:对角线1/@uof:宽度 !=''">
  1962. <xsl:variable name="diagonal-lr-width" select="concat(表:边框/uof:对角线1/@uof:宽度,$uofUnit)"/>
  1963. <xsl:variable name="diagonal-lr-tyle">
  1964. <xsl:choose>
  1965. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
  1966. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
  1967. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
  1968. <xsl:otherwise>solid</xsl:otherwise>
  1969. </xsl:choose>
  1970. </xsl:variable>
  1971. <xsl:variable name="diagonal-lr-color" select="表:边框/uof:对角线1/@uof:颜色"/>
  1972. <xsl:variable name="border-diagonal" select="concat($diagonal-lr-width,' ',$diagonal-lr-tyle,' ',$diagonal-lr-color)"/>
  1973. <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
  1974. </xsl:if>
  1975. <xsl:if test="表:边框/uof:对角线2/@uof:宽度 !=''">
  1976. <xsl:variable name="diagonal-rl-width" select="concat(表:边框/uof:对角线2/@uof:宽度,$uofUnit)"/>
  1977. <xsl:variable name="diagonal-rl-tyle">
  1978. <xsl:choose>
  1979. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
  1980. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
  1981. <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
  1982. <xsl:otherwise>solid</xsl:otherwise>
  1983. </xsl:choose>
  1984. </xsl:variable>
  1985. <xsl:variable name="diagonal-rl-color" select="表:边框/uof:对角线2/@uof:颜色"/>
  1986. <xsl:variable name="border-diagonal" select="concat($diagonal-rl-width,' ',$diagonal-rl-tyle,' ',$diagonal-rl-color)"/>
  1987. <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
  1988. </xsl:if>
  1989. <xsl:if test="表:边框/*/@uof:阴影">
  1990. <xsl:choose>
  1991. <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
  1992. <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
  1993. </xsl:when>
  1994. <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
  1995. <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
  1996. </xsl:when>
  1997. <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
  1998. <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
  1999. </xsl:when>
  2000. <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
  2001. <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
  2002. </xsl:when>
  2003. </xsl:choose>
  2004. </xsl:if>
  2005. <!--边框 end -->
  2006. <xsl:if test="表:填充">
  2007. <xsl:choose>
  2008. <xsl:when test="表:填充/图:颜色">
  2009. <xsl:attribute name="fo:background-color"><xsl:value-of select="表:填充/图:颜色"/></xsl:attribute>
  2010. </xsl:when>
  2011. <xsl:otherwise>
  2012. <xsl:if test="表:填充/图:图案/@图:前景色">
  2013. <xsl:variable name="pattern-value">
  2014. <xsl:call-template name="cell-pattern-color">
  2015. <xsl:with-param name="pattern" select="concat('0.',substring-after(表:填充/图:图案/图:背景色,'y'))"/>
  2016. <xsl:with-param name="color-value" select="表:填充/图:颜色"/>
  2017. <xsl:with-param name="pattern-color-value" select="表:填充/图:图案/图:背景色"/>
  2018. </xsl:call-template>
  2019. </xsl:variable>
  2020. <xsl:attribute name="fo:background-color"><xsl:value-of select="$pattern-value"/></xsl:attribute>
  2021. </xsl:if>
  2022. </xsl:otherwise>
  2023. </xsl:choose>
  2024. </xsl:if>
  2025. <xsl:if test="表:字体格式/字:隐藏文字">
  2026. <xsl:choose>
  2027. <xsl:when test="表:字体格式/字:隐藏文字 = 'true'">
  2028. <xsl:attribute name="style:cell-protect">protected formula-hidden</xsl:attribute>
  2029. </xsl:when>
  2030. <xsl:otherwise>
  2031. <xsl:attribute name="style:cell-protect">none</xsl:attribute>
  2032. </xsl:otherwise>
  2033. </xsl:choose>
  2034. </xsl:if>
  2035. <xsl:attribute name="style:cell-protect">none</xsl:attribute>
  2036. <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
  2037. </xsl:element>
  2038. <xsl:element name="style:paragraph-properties">
  2039. <xsl:if test="表:对齐格式/表:水平对齐方式">
  2040. <xsl:variable name="text-align">
  2041. <xsl:choose>
  2042. <xsl:when test="表:对齐格式/表:水平对齐方式 = 'left'">start</xsl:when>
  2043. <xsl:when test="表:对齐格式/表:水平对齐方式 = 'center'">center</xsl:when>
  2044. <xsl:when test="表:对齐格式/表:水平对齐方式 = 'right'">end</xsl:when>
  2045. <xsl:when test="表:对齐格式/表:水平对齐方式 = 'justify'">justify</xsl:when>
  2046. <xsl:otherwise>start</xsl:otherwise>
  2047. </xsl:choose>
  2048. </xsl:variable>
  2049. <xsl:attribute name="fo:text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
  2050. </xsl:if>
  2051. </xsl:element>
  2052. <xsl:element name="style:text-properties">
  2053. <xsl:if test="表:字体格式/字:字体">
  2054. <xsl:choose>
  2055. <xsl:when test="(表:字体格式/字:字体/@字:中文字体引用)or (表:字体格式/字:字体/@字:西文字体引用)">
  2056. <xsl:variable name="fontnameZ" select="表:字体格式/字:字体/@字:中文字体引用"/>
  2057. <xsl:variable name="fontnameX" select="表:字体格式/字:字体/@字:西文字体引用"/>
  2058. <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
  2059. <xsl:if test="(./@uof:标识符 = $fontnameZ)or(./@uof:标识符 = $fontnameX)">
  2060. <xsl:attribute name="style:font-name"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
  2061. <xsl:attribute name="style:font-name-asian"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
  2062. <xsl:attribute name="style:font-name-complex"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
  2063. <xsl:attribute name="style:font-charset"><xsl:value-of select="./@uof:字体族"/></xsl:attribute>
  2064. </xsl:if>
  2065. </xsl:for-each>
  2066. </xsl:when>
  2067. <xsl:otherwise>
  2068. <xsl:attribute name="style:font-name">Arial</xsl:attribute>
  2069. </xsl:otherwise>
  2070. </xsl:choose>
  2071. <xsl:if test="表:字体格式/字:粗体/@字:值">
  2072. <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2073. <xsl:attribute name="style:font-weight-asian"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2074. <xsl:attribute name="style:font-weight-complex"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2075. </xsl:if>
  2076. <xsl:if test="表:字体格式/字:斜体/@字:值">
  2077. <xsl:attribute name="fo:font-style"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2078. <xsl:attribute name="style:font-style-asian"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2079. <xsl:attribute name="style:font-style-complex"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
  2080. </xsl:if>
  2081. <xsl:choose>
  2082. <xsl:when test="表:字体格式/字:字体/@字:颜色">
  2083. <xsl:attribute name="fo:color"><xsl:value-of select="表:字体格式/字:字体/@字:颜色"/></xsl:attribute>
  2084. </xsl:when>
  2085. <xsl:otherwise>
  2086. <xsl:attribute name="style:use-window-font-color">true</xsl:attribute>
  2087. </xsl:otherwise>
  2088. </xsl:choose>
  2089. <xsl:choose>
  2090. <xsl:when test="表:字体格式/字:字体/@字:字号">
  2091. <xsl:attribute name="fo:font-size"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
  2092. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
  2093. <xsl:attribute name="style:font-size-complex"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
  2094. </xsl:when>
  2095. <xsl:otherwise>
  2096. <xsl:attribute name="fo:font-size">12pt</xsl:attribute>
  2097. <xsl:attribute name="style:font-size-asian">12pt</xsl:attribute>
  2098. <xsl:attribute name="style:font-size-complex">12pt</xsl:attribute>
  2099. </xsl:otherwise>
  2100. </xsl:choose>
  2101. <xsl:if test="表:字体格式/字:浮雕">
  2102. <xsl:variable name="aa">
  2103. <xsl:value-of select="表:字体格式/字:浮雕/@字:类型"/>
  2104. </xsl:variable>
  2105. <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="$aa='emboss'">embossed</xsl:when><xsl:when test="$aa='engrave'">engraved</xsl:when></xsl:choose></xsl:attribute>
  2106. </xsl:if>
  2107. <xsl:if test="表:字体格式/字:阴影/@字:值 = '1' or 表:字体格式/字:阴影/@字:值 = 'true'">
  2108. <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
  2109. </xsl:if>
  2110. <xsl:if test="表:字体格式/字:删除线">
  2111. <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
  2112. <xsl:choose>
  2113. <xsl:when test="表:字体格式/字:删除线/@字:类型='double'">
  2114. <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
  2115. </xsl:when>
  2116. <xsl:when test="表:字体格式/字:删除线/@字:类型='single'">
  2117. <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
  2118. <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
  2119. </xsl:when>
  2120. <xsl:when test="表:字体格式/字:删除线/@字:类型='bold'">
  2121. <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
  2122. </xsl:when>
  2123. <xsl:when test="表:字体格式/字:删除线/@字:类型='带/'">
  2124. <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
  2125. </xsl:when>
  2126. <xsl:when test="表:字体格式/字:删除线/@字:类型='带X'">
  2127. <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
  2128. </xsl:when>
  2129. <xsl:otherwise/>
  2130. </xsl:choose>
  2131. </xsl:if>
  2132. <xsl:if test="表:字体格式/字:下划线">
  2133. <xsl:apply-templates select="表:字体格式/字:下划线"/>
  2134. </xsl:if>
  2135. </xsl:if>
  2136. <xsl:if test="表:字体格式/字:着重号">
  2137. <xsl:apply-templates select="表:字体格式/字:着重号"/>
  2138. </xsl:if>
  2139. <xsl:if test="表:字体格式/字:空心/@字:值='true'">
  2140. <xsl:attribute name="style:text-outline">true</xsl:attribute>
  2141. </xsl:if>
  2142. </xsl:element>
  2143. </xsl:template>
  2144. <xsl:template name="单元格具体式样">
  2145. <xsl:choose>
  2146. <xsl:when test="@表:类型 = 'Default'">
  2147. <xsl:element name="style:default-style">
  2148. <xsl:call-template name="style-style-content"/>
  2149. </xsl:element>
  2150. </xsl:when>
  2151. <xsl:otherwise>
  2152. <xsl:element name="style:style">
  2153. <xsl:attribute name="style:name"><xsl:value-of select="@表:标识符"/></xsl:attribute>
  2154. <xsl:if test="表:数字格式/@表:格式码 = 'general'">
  2155. <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
  2156. </xsl:if>
  2157. <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
  2158. <xsl:attribute name="style:data-style-name"><xsl:value-of select="concat( @表:标识符, 'F')"/></xsl:attribute>
  2159. <!--chengxz这里要改 -->
  2160. <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="'N2'"/></xsl:attribute-->
  2161. <xsl:call-template name="style-style-content"/>
  2162. </xsl:element>
  2163. </xsl:otherwise>
  2164. </xsl:choose>
  2165. </xsl:template>
  2166. <xsl:template match="表:边框">
  2167. <!--chengxz 0622-->
  2168. <xsl:if test="not(uof:下)">
  2169. <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
  2170. </xsl:if>
  2171. <xsl:if test="not(uof:上)">
  2172. <xsl:attribute name="fo:border-top">none</xsl:attribute>
  2173. </xsl:if>
  2174. <xsl:if test="not(uof:左)">
  2175. <xsl:attribute name="fo:border-left">none</xsl:attribute>
  2176. </xsl:if>
  2177. <xsl:if test="not(uof:右)">
  2178. <xsl:attribute name="fo:border-right">none</xsl:attribute>
  2179. </xsl:if>
  2180. <xsl:apply-templates select="uof:对角线1"/>
  2181. <xsl:apply-templates select="uof:对角线2"/>
  2182. <xsl:apply-templates select="uof:上"/>
  2183. <xsl:apply-templates select="uof:下"/>
  2184. <xsl:apply-templates select="uof:左"/>
  2185. <xsl:apply-templates select="uof:右"/>
  2186. </xsl:template>
  2187. <xsl:template match="uof:上">
  2188. <xsl:variable name="bordtype">
  2189. <xsl:choose>
  2190. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2191. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2192. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2193. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2194. <xsl:otherwise>solid</xsl:otherwise>
  2195. </xsl:choose>
  2196. </xsl:variable>
  2197. <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
  2198. <xsl:if test="@uof:类型 = 'double'">
  2199. <xsl:attribute name="style:border-line-width-top">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2200. </xsl:if>
  2201. </xsl:template>
  2202. <xsl:template match="uof:下">
  2203. <xsl:variable name="bordtype">
  2204. <xsl:choose>
  2205. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2206. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2207. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2208. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2209. <xsl:otherwise>solid</xsl:otherwise>
  2210. </xsl:choose>
  2211. </xsl:variable>
  2212. <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(@uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ',@uof:颜色)"/></xsl:attribute>
  2213. <xsl:if test="@uof:类型 = 'double'">
  2214. <xsl:attribute name="style:border-line-width-bottom">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2215. </xsl:if>
  2216. </xsl:template>
  2217. <xsl:template match="uof:左">
  2218. <xsl:variable name="bordtype">
  2219. <xsl:choose>
  2220. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2221. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2222. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2223. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2224. <xsl:otherwise>solid</xsl:otherwise>
  2225. </xsl:choose>
  2226. </xsl:variable>
  2227. <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
  2228. <xsl:if test="@uof:类型 = 'double'">
  2229. <xsl:attribute name="style:border-line-width-left">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2230. </xsl:if>
  2231. </xsl:template>
  2232. <xsl:template match="uof:右">
  2233. <xsl:variable name="bordtype">
  2234. <xsl:choose>
  2235. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2236. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2237. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2238. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2239. <xsl:otherwise>solid</xsl:otherwise>
  2240. </xsl:choose>
  2241. </xsl:variable>
  2242. <xsl:attribute name="fo:border-right"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
  2243. <xsl:if test="@uof:类型 = 'double'">
  2244. <xsl:attribute name="style:border-line-width-right">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2245. </xsl:if>
  2246. </xsl:template>
  2247. <xsl:template match="uof:对角线1">
  2248. <xsl:variable name="bordtype">
  2249. <xsl:choose>
  2250. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2251. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2252. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2253. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2254. <xsl:otherwise>solid</xsl:otherwise>
  2255. </xsl:choose>
  2256. </xsl:variable>
  2257. <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
  2258. <xsl:if test="@uof:类型 = 'double'">
  2259. <xsl:attribute name="style:diagonal-bl-tr-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2260. </xsl:if>
  2261. </xsl:template>
  2262. <xsl:template match="uof:对角线2">
  2263. <xsl:variable name="bordtype">
  2264. <xsl:choose>
  2265. <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
  2266. <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
  2267. <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
  2268. <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
  2269. <xsl:otherwise>solid</xsl:otherwise>
  2270. </xsl:choose>
  2271. </xsl:variable>
  2272. <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
  2273. <xsl:if test="@uof:类型 = 'double'">
  2274. <xsl:attribute name="style:diagonal-tl-br-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
  2275. </xsl:if>
  2276. </xsl:template>
  2277. <xsl:template match="表:字体格式">
  2278. <xsl:choose>
  2279. <xsl:when test="字:上下标/@字:上下标 = 'sup'">
  2280. <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
  2281. <style:text-properties style:text-position="33% 58%"/>
  2282. </style:style>
  2283. </xsl:when>
  2284. <xsl:when test="字:上下标/@字:上下标 = 'sub'">
  2285. <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
  2286. <style:text-properties style:text-position="-33% 58%"/>
  2287. </style:style>
  2288. </xsl:when>
  2289. <xsl:otherwise/>
  2290. </xsl:choose>
  2291. </xsl:template>
  2292. <xsl:template name="tablecolumngroup">
  2293. <xsl:param name="start"/>
  2294. <xsl:param name="end"/>
  2295. <xsl:param name="prestart"/>
  2296. <xsl:param name="preend"/>
  2297. <xsl:param name="nextstart"/>
  2298. <xsl:param name="nextend"/>
  2299. <table:table-column-group>
  2300. <table:table-column>
  2301. <xsl:attribute name="table:style-name">co1</xsl:attribute>
  2302. <xsl:attribute name="table:table-column-repeated"><xsl:value-of select="@表:终止 - @表:起始 + 1"/></xsl:attribute>
  2303. </table:table-column>
  2304. <xsl:if test="$nextstart &gt;= $start and $nextend &lt;= $end">
  2305. <xsl:for-each select="following-sibling::表:列[1]">
  2306. <xsl:call-template name="tablecolumngroup"/>
  2307. </xsl:for-each>
  2308. </xsl:if>
  2309. </table:table-column-group>
  2310. </xsl:template>
  2311. <xsl:template match="表:工作表">
  2312. <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
  2313. <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
  2314. <xsl:element name="table:table">
  2315. <xsl:attribute name="table:name"><xsl:value-of select="@表:名称"/></xsl:attribute>
  2316. <xsl:if test="表:工作表内容">
  2317. <xsl:attribute name="table:style-name"><xsl:value-of select="concat( 'ta', count(preceding-sibling::表:工作表)+1)"/></xsl:attribute>
  2318. <xsl:if test="(@表:隐藏 = '1')or(@表:隐藏 = 'true')">
  2319. <xsl:attribute name="table:protected">true</xsl:attribute>
  2320. </xsl:if>
  2321. <xsl:if test="表:工作表内容/uof:锚点 or 表:工作表内容/表:图表">
  2322. <table:shapes>
  2323. <xsl:apply-templates select="表:工作表内容/uof:锚点"/>
  2324. <xsl:apply-templates select="表:工作表内容/表:图表">
  2325. <xsl:with-param name="table-name" select="@表:名称"/>
  2326. </xsl:apply-templates>
  2327. </table:shapes>
  2328. </xsl:if>
  2329. <xsl:variable name="table-pos">
  2330. <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
  2331. </xsl:variable>
  2332. <xsl:if test="表:工作表内容/表:分组集/表:列">
  2333. <xsl:for-each select="表:工作表内容/表:分组集/表:列">
  2334. <xsl:variable name="start" select="@表:起始"/>
  2335. <xsl:variable name="end" select="@表:终止"/>
  2336. <xsl:variable name="prestart" select="preceding-sibling::表:列/@表:起始"/>
  2337. <xsl:variable name="preend" select="preceding-sibling::表:列/@表:终止"/>
  2338. <xsl:variable name="nextstart" select="following-sibling::表:列/@表:起始"/>
  2339. <xsl:variable name="nextend" select="following-sibling::表:列/@表:终止"/>
  2340. <xsl:call-template name="tablecolumngroup">
  2341. <xsl:with-param name="start" select="$start"/>
  2342. <xsl:with-param name="end" select="$end"/>
  2343. <xsl:with-param name="prestart" select="$prestart"/>
  2344. <xsl:with-param name="preend" select="$preend"/>
  2345. <xsl:with-param name="nextstart" select="$nextstart"/>
  2346. <xsl:with-param name="nextend" select="$nextend"/>
  2347. </xsl:call-template>
  2348. </xsl:for-each>
  2349. </xsl:if>
  2350. <xsl:for-each select="表:工作表内容/表:列">
  2351. <table:table-column>
  2352. <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
  2353. <xsl:if test="@表:跨度 and not(@表:跨度='1')">
  2354. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:跨度"/></xsl:attribute>
  2355. </xsl:if>
  2356. <xsl:if test="@表:隐藏">
  2357. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2358. </xsl:if>
  2359. </table:table-column>
  2360. </xsl:for-each>
  2361. <xsl:variable name="condition-pos-str1">
  2362. <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
  2363. <xsl:call-template name="condition-row-column-string">
  2364. <xsl:with-param name="last" select="''"/>
  2365. <xsl:with-param name="total" select="count(../../表:公用处理规则/表:条件格式化集/表:条件格式化)"/>
  2366. <xsl:with-param name="index" select="1"/>
  2367. </xsl:call-template>
  2368. </xsl:if>
  2369. </xsl:variable>
  2370. <xsl:variable name="condition-pos-str2">
  2371. <xsl:if test="../../表:公用处理规则/表:数据有效性集/表:数据有效性">
  2372. <xsl:call-template name="validation-row-column-string">
  2373. <xsl:with-param name="last" select="''"/>
  2374. <xsl:with-param name="total" select="count(../../表:公用处理规则/表:数据有效性集/表:数据有效性)"/>
  2375. <xsl:with-param name="index" select="1"/>
  2376. </xsl:call-template>
  2377. </xsl:if>
  2378. </xsl:variable>
  2379. <xsl:variable name="condition-pos-str" select="concat($condition-pos-str1, $condition-pos-str2)"/>
  2380. <xsl:choose>
  2381. <xsl:when test="./表:工作表内容/表:行">
  2382. <xsl:call-template name="create-rows">
  2383. <xsl:with-param name="lastrowpos" select="0"/>
  2384. <xsl:with-param name="row-count" select="count(表:工作表内容/表:行)"/>
  2385. <xsl:with-param name="currentRow" select="1"/>
  2386. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2387. </xsl:call-template>
  2388. </xsl:when>
  2389. <xsl:otherwise>
  2390. <xsl:variable name="tableHasStyle">
  2391. <xsl:choose>
  2392. <xsl:when test="./表:工作表内容[@表:式样引用]">
  2393. <xsl:value-of select="1"/>
  2394. </xsl:when>
  2395. <xsl:otherwise>
  2396. <xsl:value-of select="0"/>
  2397. </xsl:otherwise>
  2398. </xsl:choose>
  2399. </xsl:variable>
  2400. <xsl:choose>
  2401. <xsl:when test="./表:分页符集/表:分页符[@表:行号]">
  2402. <xsl:for-each select="./表:分页符集/表:分页符[@表:行号]">
  2403. <xsl:variable name="number-repeated">
  2404. <xsl:choose>
  2405. <xsl:when test="position() = 1">
  2406. <xsl:value-of select="./@表:行号"/>
  2407. </xsl:when>
  2408. <xsl:otherwise>
  2409. <xsl:value-of select="./@表:行号 - preceding::表:分页符[@表:行号 and (position()=count(.))]/@表:行号 - 1"/>
  2410. </xsl:otherwise>
  2411. </xsl:choose>
  2412. </xsl:variable>
  2413. <xsl:if test="$number-repeated &gt; 0">
  2414. <xsl:element name="table:table-row">
  2415. <xsl:if test="($rowpath/@表:隐藏 = '1') or ($rowpath/@表:隐藏 = 'true')">
  2416. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2417. </xsl:if>
  2418. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$table-pos)"/></xsl:attribute>
  2419. <xsl:attribute name="table:number-rows-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
  2420. <xsl:choose>
  2421. <xsl:when test="$tableHasStyle = 1">
  2422. <table:table-cell table:number-columns-repeated="256"/>
  2423. </xsl:when>
  2424. <xsl:otherwise>
  2425. <table:table-cell/>
  2426. </xsl:otherwise>
  2427. </xsl:choose>
  2428. </xsl:element>
  2429. </xsl:if>
  2430. <xsl:element name="table:table-row">
  2431. <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
  2432. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2433. </xsl:if>
  2434. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$table-pos)"/></xsl:attribute>
  2435. <xsl:choose>
  2436. <xsl:when test="$tableHasStyle = 1">
  2437. <table:table-cell table:number-columns-repeated="256"/>
  2438. </xsl:when>
  2439. <xsl:otherwise>
  2440. <table:table-cell/>
  2441. </xsl:otherwise>
  2442. </xsl:choose>
  2443. </xsl:element>
  2444. </xsl:for-each>
  2445. </xsl:when>
  2446. <xsl:otherwise>
  2447. <xsl:element name="table:table-row">
  2448. <xsl:choose>
  2449. <xsl:when test="表:工作表内容/@表:式样引用">
  2450. <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
  2451. </xsl:when>
  2452. <xsl:otherwise>
  2453. <xsl:attribute name="table:style-name"><xsl:text>ro1</xsl:text></xsl:attribute>
  2454. </xsl:otherwise>
  2455. </xsl:choose>
  2456. <xsl:element name="table:table-cell"/>
  2457. </xsl:element>
  2458. </xsl:otherwise>
  2459. </xsl:choose>
  2460. <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
  2461. <xsl:variable name="condition-row-max">
  2462. <xsl:call-template name="condition-row-col-pos-max">
  2463. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2464. <xsl:with-param name="last-value" select="0"/>
  2465. <xsl:with-param name="div-value" select="'R'"/>
  2466. </xsl:call-template>
  2467. </xsl:variable>
  2468. <xsl:variable name="condition-col-max">
  2469. <xsl:call-template name="condition-row-col-pos-max">
  2470. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2471. <xsl:with-param name="last-value" select="0"/>
  2472. <xsl:with-param name="div-value" select="'C'"/>
  2473. </xsl:call-template>
  2474. </xsl:variable>
  2475. <xsl:variable name="break-row-max">
  2476. <xsl:call-template name="break-row-beyond-max">
  2477. <xsl:with-param name="pos" select="1"/>
  2478. <xsl:with-param name="last-value" select="0"/>
  2479. <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
  2480. </xsl:call-template>
  2481. </xsl:variable>
  2482. <xsl:variable name="end-value">
  2483. <xsl:choose>
  2484. <xsl:when test="$condition-row-max &lt; $break-row-max">
  2485. <xsl:value-of select="$break-row-max"/>
  2486. </xsl:when>
  2487. <xsl:otherwise>
  2488. <xsl:value-of select="$condition-row-max"/>
  2489. </xsl:otherwise>
  2490. </xsl:choose>
  2491. </xsl:variable>
  2492. <xsl:call-template name="get-row-beyond-last">
  2493. <xsl:with-param name="index-value" select="1"/>
  2494. <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2495. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2496. <xsl:with-param name="end-pos" select="$end-value"/>
  2497. <xsl:with-param name="total-col" select="$condition-col-max"/>
  2498. </xsl:call-template>
  2499. </xsl:if>
  2500. <xsl:if test="./表:工作表内容/@表:式样引用">
  2501. <table:table-row table:style-name="ro1" table:number-rows-repeated="32000">
  2502. <table:table-cell table:number-columns-repeated="256"/>
  2503. </table:table-row>
  2504. </xsl:if>
  2505. </xsl:otherwise>
  2506. </xsl:choose>
  2507. </xsl:if>
  2508. </xsl:element>
  2509. <xsl:if test="表:图表">
  2510. <table:shapes>
  2511. <xsl:apply-templates select="表:图表">
  2512. <xsl:with-param name="table-name" select="@表:名称"/>
  2513. </xsl:apply-templates>
  2514. </table:shapes>
  2515. </xsl:if>
  2516. </xsl:template>
  2517. <!--xsl:template name="create-columns-without-input"></xsl:template>
  2518. <xsl:template name="create-columns"></xsl:template>
  2519. <xsl:template name="condition-row-column-string"></xsl:template>
  2520. <xsl:template name="validation-row-column-string"></xsl:template>
  2521. <xsl:template name="create-rows"></xsl:template>
  2522. <xsl:template name="condition-row-col-pos-max"></xsl:template>
  2523. <xsl:template name="get-row-beyond-last"></xsl:template-->
  2524. <!--xsl:template name="break-row-beyond-max"></xsl:template-->
  2525. <!-- chengxz有问题-->
  2526. <xsl:template name="create-columns-without-input">
  2527. <xsl:param name="table-pos"/>
  2528. <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
  2529. <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
  2530. <xsl:choose>
  2531. <xsl:when test="./表:分页符集/表:分页符[@表:列号]">
  2532. <xsl:for-each select="./表:分页符集/表:分页符[@表:列号]">
  2533. <xsl:variable name="number-repeated">
  2534. <xsl:choose>
  2535. <xsl:when test="position() = 1">
  2536. <xsl:value-of select="./@表:列号"/>
  2537. </xsl:when>
  2538. <xsl:otherwise>
  2539. <xsl:value-of select="./@表:列号 - preceding::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
  2540. </xsl:otherwise>
  2541. </xsl:choose>
  2542. </xsl:variable>
  2543. <xsl:if test="$number-repeated &gt; 0">
  2544. <xsl:element name="table:table-column">
  2545. <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
  2546. <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
  2547. </xsl:if>
  2548. <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
  2549. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2550. </xsl:if>
  2551. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$table-pos)"/></xsl:attribute>
  2552. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
  2553. </xsl:element>
  2554. </xsl:if>
  2555. <xsl:element name="table:table-column">
  2556. <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
  2557. <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
  2558. </xsl:if>
  2559. <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
  2560. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2561. </xsl:if>
  2562. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$table-pos)"/></xsl:attribute>
  2563. </xsl:element>
  2564. </xsl:for-each>
  2565. </xsl:when>
  2566. <xsl:otherwise>
  2567. <xsl:element name="table:table-column">
  2568. <xsl:choose>
  2569. <xsl:when test="表:工作表内容/@表:式样引用">
  2570. <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
  2571. </xsl:when>
  2572. <xsl:otherwise>
  2573. <xsl:attribute name="table:style-name"><xsl:text>co1</xsl:text></xsl:attribute>
  2574. </xsl:otherwise>
  2575. </xsl:choose>
  2576. <xsl:if test="表:工作表内容/@表:最大列 and 表:工作表内容/@表:最大列 > 0">
  2577. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="表:工作表内容/@表:最大列"/></xsl:attribute>
  2578. </xsl:if>
  2579. <xsl:attribute name="table:default-cell-style-name"><xsl:text>Default</xsl:text></xsl:attribute>
  2580. </xsl:element>
  2581. </xsl:otherwise>
  2582. </xsl:choose>
  2583. </xsl:template>
  2584. <xsl:template name="create-columns">
  2585. <xsl:param name="columnCount"/>
  2586. <xsl:param name="currentColumn" select="1"/>
  2587. <xsl:param name="finishedColumns" select="0"/>
  2588. <xsl:param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2589. <xsl:param name="currentColumnNode"/>
  2590. <xsl:choose>
  2591. <xsl:when test="$finishedColumns &lt; $columnCount">
  2592. <xsl:choose>
  2593. <xsl:when test="$currentColumnNode">
  2594. <xsl:choose>
  2595. <xsl:when test="$currentColumnNode/@表:列号 - $finishedColumns &gt; 1">
  2596. <xsl:call-template name="create-default-column">
  2597. <xsl:with-param name="currentColumn" select="$currentColumn"/>
  2598. <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
  2599. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2600. </xsl:call-template>
  2601. <xsl:call-template name="create-columns">
  2602. <xsl:with-param name="columnCount" select="$columnCount"/>
  2603. <xsl:with-param name="currentColumn" select="$currentColumn"/>
  2604. <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
  2605. <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
  2606. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2607. </xsl:call-template>
  2608. </xsl:when>
  2609. <xsl:otherwise>
  2610. <xsl:element name="table:table-column">
  2611. <xsl:if test="($currentColumnNode/@表:隐藏 = '1') or ($currentColumnNode/@表:隐藏 = 'true')">
  2612. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  2613. </xsl:if>
  2614. <xsl:if test="$currentColumnNode/@表:跨度">
  2615. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$currentColumnNode/@表:跨度 + 1"/></xsl:attribute>
  2616. </xsl:if>
  2617. <xsl:choose>
  2618. <xsl:when test="key('ColBreak', $currentColumn)">
  2619. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
  2620. </xsl:when>
  2621. <xsl:otherwise>
  2622. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
  2623. </xsl:otherwise>
  2624. </xsl:choose>
  2625. </xsl:element>
  2626. <xsl:call-template name="create-columns">
  2627. <xsl:with-param name="columnCount" select="$columnCount"/>
  2628. <xsl:with-param name="currentColumn" select="$currentColumn + 1"/>
  2629. <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
  2630. <xsl:with-param name="currentColumnNode" select="表:工作表属性/表:列[$currentColumn + 1]"/>
  2631. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2632. </xsl:call-template>
  2633. </xsl:otherwise>
  2634. </xsl:choose>
  2635. </xsl:when>
  2636. <xsl:otherwise>
  2637. <xsl:call-template name="create-default-column">
  2638. <xsl:with-param name="currentColumn" select="$currentColumn"/>
  2639. <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
  2640. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2641. </xsl:call-template>
  2642. <xsl:call-template name="create-columns">
  2643. <xsl:with-param name="columnCount" select="$columnCount"/>
  2644. <xsl:with-param name="currentColumn" select="$currentColumn"/>
  2645. <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
  2646. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2647. </xsl:call-template>
  2648. </xsl:otherwise>
  2649. </xsl:choose>
  2650. </xsl:when>
  2651. <xsl:otherwise>
  2652. <xsl:if test="$currentColumn = $columnCount">
  2653. <xsl:if test="表:分页符集/表:分页符/@表:列号 &gt; $finishedColumns">
  2654. <xsl:call-template name="get-column-beyond-last">
  2655. <xsl:with-param name="index-value" select="$finishedColumns"/>
  2656. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  2657. </xsl:call-template>
  2658. </xsl:if>
  2659. </xsl:if>
  2660. </xsl:otherwise>
  2661. </xsl:choose>
  2662. </xsl:template>
  2663. <xsl:template name="get-column-beyond-last">
  2664. <xsl:param name="index-value"/>
  2665. <xsl:param name="worksheetNo"/>
  2666. <xsl:for-each select="表:分页符集/表:分页符[@表:列号]">
  2667. <xsl:variable name="each-column-value" select="@表:列号"/>
  2668. <xsl:choose>
  2669. <xsl:when test="$each-column-value + 1 &gt; $index-value">
  2670. <xsl:variable name="number-repeated">
  2671. <xsl:choose>
  2672. <xsl:when test="preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 + 1 = $index-value">
  2673. <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
  2674. </xsl:when>
  2675. <xsl:when test="preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 + 1 &gt; $index-value">
  2676. <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 - 1"/>
  2677. </xsl:when>
  2678. <xsl:otherwise>
  2679. <xsl:value-of select="$each-column-value - $index-value + 1"/>
  2680. </xsl:otherwise>
  2681. </xsl:choose>
  2682. </xsl:variable>
  2683. <xsl:if test="$number-repeated &gt; 0">
  2684. <xsl:element name="table:table-column">
  2685. <xsl:attribute name="table:style-name"><xsl:value-of select="'co1'"/></xsl:attribute>
  2686. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
  2687. </xsl:element>
  2688. </xsl:if>
  2689. <xsl:element name="table:table-column">
  2690. <xsl:if test="../../表:工作表内容[@表:式样引用]">
  2691. <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./表:工作表内容/@表:式样引用"/></xsl:attribute>
  2692. </xsl:if>
  2693. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
  2694. </xsl:element>
  2695. </xsl:when>
  2696. <xsl:when test="$each-column-value + 1 = $index-value">
  2697. <xsl:element name="table:table-column">
  2698. <xsl:if test="/../../表:工作表内容[@表:式样引用]">
  2699. <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./../../表:工作表内容/@表:式样引用"/></xsl:attribute>
  2700. </xsl:if>
  2701. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
  2702. </xsl:element>
  2703. </xsl:when>
  2704. </xsl:choose>
  2705. </xsl:for-each>
  2706. </xsl:template>
  2707. <xsl:template name="condition-row-column-string">
  2708. <xsl:param name="last"/>
  2709. <xsl:param name="total"/>
  2710. <xsl:param name="index"/>
  2711. <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
  2712. <xsl:variable name="current">
  2713. <xsl:call-template name="parse-range">
  2714. <xsl:with-param name="range-value" select="../../表:公用处理规则/表:条件格式化集/表:条件格式化[position() = $index]/表:范围"/>
  2715. </xsl:call-template>
  2716. </xsl:variable>
  2717. <xsl:variable name="current-value" select="concat('(c',$table-pos,'-',$index,':', $current,');')"/>
  2718. <xsl:if test="$index &lt; $total">
  2719. <xsl:call-template name="condition-row-column-string">
  2720. <xsl:with-param name="last" select="concat($last, $current-value)"/>
  2721. <xsl:with-param name="total" select="$total"/>
  2722. <xsl:with-param name="index" select="$index + 1"/>
  2723. </xsl:call-template>
  2724. </xsl:if>
  2725. <xsl:if test="$index = $total">
  2726. <xsl:value-of select="concat($last, $current-value)"/>
  2727. </xsl:if>
  2728. </xsl:template>
  2729. <xsl:template name="validation-row-column-string">
  2730. <xsl:param name="last"/>
  2731. <xsl:param name="total"/>
  2732. <xsl:param name="index"/>
  2733. <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
  2734. <xsl:variable name="current">
  2735. <xsl:call-template name="parse-range">
  2736. <xsl:with-param name="range-value" select="../../表:公用处理规则/表:数据有效性集/表:数据有效性[position() = $index]/表:范围"/>
  2737. </xsl:call-template>
  2738. </xsl:variable>
  2739. <xsl:variable name="current-value" select="concat('(v',$index,':', $current,');')"/>
  2740. <xsl:if test="$index &lt; $total">
  2741. <xsl:call-template name="validation-row-column-string">
  2742. <xsl:with-param name="last" select="concat($last, $current-value)"/>
  2743. <xsl:with-param name="total" select="$total"/>
  2744. <xsl:with-param name="index" select="$index + 1"/>
  2745. </xsl:call-template>
  2746. </xsl:if>
  2747. <xsl:if test="$index = $total">
  2748. <xsl:value-of select="concat($last, $current-value)"/>
  2749. </xsl:if>
  2750. </xsl:template>
  2751. <xsl:template name="create-rows">
  2752. <xsl:param name="lastrowpos"/>
  2753. <xsl:param name="row-count"/>
  2754. <xsl:param name="currentRow"/>
  2755. <xsl:param name="condition-pos-str"/>
  2756. <xsl:choose>
  2757. <xsl:when test="$currentRow &lt; ($row-count + 1)">
  2758. <xsl:variable name="span-value">
  2759. <xsl:choose>
  2760. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
  2761. <xsl:choose>
  2762. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2763. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
  2764. </xsl:when>
  2765. <xsl:otherwise>
  2766. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos"/>
  2767. </xsl:otherwise>
  2768. </xsl:choose>
  2769. </xsl:when>
  2770. <xsl:otherwise>
  2771. <xsl:choose>
  2772. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2773. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
  2774. </xsl:when>
  2775. <xsl:otherwise>
  2776. <xsl:value-of select="1"/>
  2777. </xsl:otherwise>
  2778. </xsl:choose>
  2779. </xsl:otherwise>
  2780. </xsl:choose>
  2781. </xsl:variable>
  2782. <xsl:variable name="current-index">
  2783. <xsl:choose>
  2784. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
  2785. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
  2786. </xsl:when>
  2787. <xsl:otherwise>
  2788. <xsl:value-of select="$lastrowpos + 1"/>
  2789. </xsl:otherwise>
  2790. </xsl:choose>
  2791. </xsl:variable>
  2792. <xsl:choose>
  2793. <xsl:when test="./表:工作表内容/表:分组集/表:行">
  2794. <xsl:for-each select="./表:工作表内容/表:分组集/表:行[1]">
  2795. <xsl:call-template name="table:table-row-group"/>
  2796. </xsl:for-each>
  2797. <xsl:for-each select="./表:工作表内容/表:行[not(@表:行号)]">
  2798. <xsl:call-template name="create-row">
  2799. <xsl:with-param name="index-value" select="$lastrowpos"/>
  2800. <xsl:with-param name="span-value" select="$span-value"/>
  2801. <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2802. <xsl:with-param name="row-value" select="$currentRow"/>
  2803. <xsl:with-param name="times" select="1"/>
  2804. <xsl:with-param name="current-index" select="$current-index"/>
  2805. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2806. </xsl:call-template>
  2807. </xsl:for-each>
  2808. </xsl:when>
  2809. <xsl:when test="./表:工作表内容/表:分组集 and ( ./表:工作表内容/表:分组集/表:行/@表:起始 &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= ./表:工作表内容/表:分组集/表:行/@表:终止 )">
  2810. <xsl:element name="table:table-row-group">
  2811. <xsl:variable name="TempStart">
  2812. <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:起始"/>
  2813. </xsl:variable>
  2814. <xsl:variable name="TempEnd">
  2815. <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:终止"/>
  2816. </xsl:variable>
  2817. <xsl:for-each select="./表:工作表内容/表:行">
  2818. <xsl:if test="$TempStart &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= $TempEnd">
  2819. <xsl:call-template name="create-row">
  2820. <xsl:with-param name="index-value" select="$lastrowpos"/>
  2821. <xsl:with-param name="span-value" select="$span-value"/>
  2822. <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2823. <xsl:with-param name="row-value" select="$currentRow"/>
  2824. <xsl:with-param name="times" select="1"/>
  2825. <xsl:with-param name="current-index" select="$current-index"/>
  2826. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2827. </xsl:call-template>
  2828. </xsl:if>
  2829. </xsl:for-each>
  2830. </xsl:element>
  2831. </xsl:when>
  2832. <xsl:otherwise>
  2833. <xsl:call-template name="create-row">
  2834. <xsl:with-param name="index-value" select="$lastrowpos"/>
  2835. <xsl:with-param name="span-value" select="$span-value"/>
  2836. <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2837. <xsl:with-param name="row-value" select="$currentRow"/>
  2838. <xsl:with-param name="times" select="1"/>
  2839. <xsl:with-param name="current-index" select="$current-index"/>
  2840. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2841. </xsl:call-template>
  2842. <xsl:if test="$currentRow &lt; $row-count">
  2843. <xsl:call-template name="create-rows">
  2844. <xsl:with-param name="lastrowpos">
  2845. <xsl:choose>
  2846. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
  2847. <xsl:choose>
  2848. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2849. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
  2850. </xsl:when>
  2851. <xsl:otherwise>
  2852. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
  2853. </xsl:otherwise>
  2854. </xsl:choose>
  2855. </xsl:when>
  2856. <xsl:otherwise>
  2857. <xsl:choose>
  2858. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2859. <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
  2860. </xsl:when>
  2861. <xsl:otherwise>
  2862. <xsl:value-of select="$lastrowpos + 1"/>
  2863. </xsl:otherwise>
  2864. </xsl:choose>
  2865. </xsl:otherwise>
  2866. </xsl:choose>
  2867. </xsl:with-param>
  2868. <xsl:with-param name="row-count" select="$row-count"/>
  2869. <xsl:with-param name="currentRow" select="$currentRow + 1"/>
  2870. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2871. </xsl:call-template>
  2872. </xsl:if>
  2873. </xsl:otherwise>
  2874. </xsl:choose>
  2875. </xsl:when>
  2876. <xsl:when test="$currentRow = $row-count">
  2877. <xsl:variable name="last-pos">
  2878. <xsl:choose>
  2879. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
  2880. <xsl:choose>
  2881. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2882. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
  2883. </xsl:when>
  2884. <xsl:otherwise>
  2885. <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
  2886. </xsl:otherwise>
  2887. </xsl:choose>
  2888. </xsl:when>
  2889. <xsl:otherwise>
  2890. <xsl:choose>
  2891. <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
  2892. <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
  2893. </xsl:when>
  2894. <xsl:otherwise>
  2895. <xsl:value-of select="$lastrowpos + 1"/>
  2896. </xsl:otherwise>
  2897. </xsl:choose>
  2898. </xsl:otherwise>
  2899. </xsl:choose>
  2900. </xsl:variable>
  2901. <xsl:if test="./表:分页符集/表:分页符/@表:行号 &gt; ($last-pos - 1) or ../../表:公用处理规则/表:条件格式化集/表:条件格式化">
  2902. <xsl:variable name="condition-row-max">
  2903. <xsl:call-template name="condition-row-col-pos-max">
  2904. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2905. <xsl:with-param name="last-value" select="0"/>
  2906. <xsl:with-param name="div-value" select="'R'"/>
  2907. </xsl:call-template>
  2908. </xsl:variable>
  2909. <xsl:variable name="condition-col-max">
  2910. <xsl:call-template name="condition-row-col-pos-max">
  2911. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2912. <xsl:with-param name="last-value" select="0"/>
  2913. <xsl:with-param name="div-value" select="'C'"/>
  2914. </xsl:call-template>
  2915. </xsl:variable>
  2916. <xsl:variable name="break-row-max">
  2917. <xsl:call-template name="break-row-beyond-max">
  2918. <xsl:with-param name="pos" select="1"/>
  2919. <xsl:with-param name="last-value" select="0"/>
  2920. <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
  2921. </xsl:call-template>
  2922. </xsl:variable>
  2923. <xsl:variable name="end-value">
  2924. <xsl:choose>
  2925. <xsl:when test="$condition-row-max &lt; $break-row-max">
  2926. <xsl:value-of select="$break-row-max"/>
  2927. </xsl:when>
  2928. <xsl:otherwise>
  2929. <xsl:value-of select="$condition-row-max"/>
  2930. </xsl:otherwise>
  2931. </xsl:choose>
  2932. </xsl:variable>
  2933. <xsl:call-template name="get-row-beyond-last">
  2934. <xsl:with-param name="index-value" select="$last-pos + 1"/>
  2935. <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
  2936. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  2937. <xsl:with-param name="end-pos" select="$end-value"/>
  2938. <xsl:with-param name="total-col" select="$condition-col-max"/>
  2939. </xsl:call-template>
  2940. </xsl:if>
  2941. <xsl:if test="./表:工作表内容/表:列[@表:式样引用] or ./表:工作表内容[@表:式样引用]">
  2942. <table:table-row table:style-name="ro1" table:number-rows-repeated="31990">
  2943. <table:table-cell table:number-columns-repeated="256"/>
  2944. </table:table-row>
  2945. <table:table-row table:style-name="ro1">
  2946. <table:table-cell table:number-columns-repeated="256"/>
  2947. </table:table-row>
  2948. </xsl:if>
  2949. </xsl:when>
  2950. </xsl:choose>
  2951. </xsl:template>
  2952. <!-- add row-group 2.6-->
  2953. <xsl:template name="table:table-row-group">
  2954. <xsl:param name="start"/>
  2955. <xsl:param name="end"/>
  2956. <xsl:variable name="start1" select="@表:起始"/>
  2957. <xsl:variable name="end1" select="@表:终止"/>
  2958. <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
  2959. <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
  2960. <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
  2961. <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
  2962. <xsl:variable name="numrow" select="$end1 - $start1"/>
  2963. <xsl:variable name="position" select="position()"/>
  2964. <xsl:choose>
  2965. <xsl:when test="$nextstart &gt;= $start1 and $nextend &lt;= $end1">
  2966. <table:table-row-group>
  2967. <xsl:call-template name="creategroup"/>
  2968. </table:table-row-group>
  2969. </xsl:when>
  2970. <xsl:when test="$nextstart &gt;= $end1">
  2971. <xsl:choose>
  2972. <xsl:when test="$nextend &lt;=$preend">
  2973. <xsl:call-template name="row">
  2974. <xsl:with-param name="start1" select="$start1"/>
  2975. <xsl:with-param name="end1" select="$end1"/>
  2976. <xsl:with-param name="nextstart" select="$nextstart"/>
  2977. <xsl:with-param name="nextend" select="$nextend"/>
  2978. <xsl:with-param name="prestart" select="$prestart"/>
  2979. <xsl:with-param name="preend" select="$preend"/>
  2980. </xsl:call-template>
  2981. </xsl:when>
  2982. <xsl:otherwise>
  2983. <xsl:call-template name="levelgroup"/>
  2984. </xsl:otherwise>
  2985. </xsl:choose>
  2986. </xsl:when>
  2987. <xsl:otherwise>
  2988. <xsl:call-template name="row">
  2989. <xsl:with-param name="start1" select="$start1"/>
  2990. <xsl:with-param name="end1" select="$end1"/>
  2991. <xsl:with-param name="nextstart" select="$nextstart"/>
  2992. <xsl:with-param name="nextend" select="$nextend"/>
  2993. <xsl:with-param name="prestart" select="$prestart"/>
  2994. <xsl:with-param name="preend" select="$preend"/>
  2995. </xsl:call-template>
  2996. </xsl:otherwise>
  2997. </xsl:choose>
  2998. </xsl:template>
  2999. <xsl:template name="levelrowgroup">
  3000. <xsl:param name="start"/>
  3001. <xsl:param name="end"/>
  3002. <xsl:variable name="start1" select="@表:起始"/>
  3003. <xsl:variable name="end1" select="@表:终止"/>
  3004. <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
  3005. <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
  3006. <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
  3007. <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
  3008. <xsl:variable name="numrow" select="$end1 - $start1"/>
  3009. <xsl:variable name="position" select="position()"/>
  3010. <xsl:call-template name="row">
  3011. <xsl:with-param name="start1" select="$start1"/>
  3012. <xsl:with-param name="end1" select="$end1"/>
  3013. <xsl:with-param name="nextstart" select="$nextstart"/>
  3014. <xsl:with-param name="nextend" select="$nextend"/>
  3015. <xsl:with-param name="prestart" select="$prestart"/>
  3016. <xsl:with-param name="preend" select="$preend"/>
  3017. </xsl:call-template>
  3018. </xsl:template>
  3019. <xsl:template name="creategroup">
  3020. <xsl:for-each select="following-sibling::表:行">
  3021. <xsl:variable name="start1" select="@表:起始"/>
  3022. <xsl:variable name="end1" select="@表:终止"/>
  3023. <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
  3024. <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
  3025. <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
  3026. <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
  3027. <xsl:if test="$start1 &gt;= $prestart and $end1 &lt;= $preend">
  3028. <xsl:call-template name="table:table-row-group"/>
  3029. </xsl:if>
  3030. </xsl:for-each>
  3031. </xsl:template>
  3032. <xsl:template name="levelgroup">
  3033. <xsl:for-each select="parent::表:分组集/表:行">
  3034. <xsl:call-template name="levelrowgroup"/>
  3035. </xsl:for-each>
  3036. </xsl:template>
  3037. <xsl:template name="row">
  3038. <xsl:param name="start1"/>
  3039. <xsl:param name="end1"/>
  3040. <xsl:param name="nextstart"/>
  3041. <xsl:param name="nextend"/>
  3042. <xsl:param name="prestart"/>
  3043. <xsl:param name="preend"/>
  3044. <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
  3045. <xsl:variable name="rownum" select="@表:行号"/>
  3046. <xsl:variable name="aa" select="$start1 - $prestart"/>
  3047. <xsl:if test="$rownum &gt;= $prestart and $rownum &lt;= ($prestart + $aa - 1) and $start1 &lt;= $preend">
  3048. <table:table-row>
  3049. <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
  3050. <xsl:call-template name="celldata"/>
  3051. </table:table-row>
  3052. </xsl:if>
  3053. </xsl:for-each>
  3054. <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
  3055. <xsl:variable name="rownum" select="@表:行号"/>
  3056. <xsl:variable name="ss" select="$start1 - $preend"/>
  3057. <xsl:if test="$rownum &gt;= ($preend +1) and $rownum &lt;= ($preend + $ss - 1) and $start1 &gt;= $preend">
  3058. <table:table-row>
  3059. <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
  3060. <xsl:call-template name="celldata"/>
  3061. </table:table-row>
  3062. </xsl:if>
  3063. </xsl:for-each>
  3064. <table:table-row-group>
  3065. <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
  3066. <xsl:variable name="rownum" select="@表:行号"/>
  3067. <xsl:if test="$rownum &lt;= $end1">
  3068. <xsl:if test="$rownum &gt;= $start1">
  3069. <table:table-row>
  3070. <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
  3071. <xsl:call-template name="celldata"/>
  3072. </table:table-row>
  3073. </xsl:if>
  3074. </xsl:if>
  3075. </xsl:for-each>
  3076. </table:table-row-group>
  3077. <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
  3078. <xsl:variable name="rownum" select="@表:行号"/>
  3079. <xsl:variable name="bb" select="$preend - $end1"/>
  3080. <xsl:if test="$rownum &gt;= ($end1 + 1) and $rownum &lt;= ($end1 + $bb) and $start1 &lt; $preend">
  3081. <table:table-row>
  3082. <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
  3083. <xsl:call-template name="celldata"/>
  3084. </table:table-row>
  3085. </xsl:if>
  3086. </xsl:for-each>
  3087. </xsl:template>
  3088. <xsl:template name="celldata">
  3089. <xsl:for-each select="./表:单元格">
  3090. <table:table-cell>
  3091. <xsl:choose>
  3092. <xsl:when test="表:数据/@表:数据类型 = 'number'">
  3093. <xsl:attribute name="office:value-type">float</xsl:attribute>
  3094. <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3095. </xsl:when>
  3096. <xsl:when test="表:数据/@表:数据类型 = 'date'">
  3097. <xsl:attribute name="office:value-type">date</xsl:attribute>
  3098. <xsl:attribute name="table:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  3099. </xsl:when>
  3100. <xsl:when test="表:数据/@表:数据类型 = 'time'">
  3101. <xsl:attribute name="office:value-type">time</xsl:attribute>
  3102. <xsl:attribute name="table:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  3103. </xsl:when>
  3104. <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
  3105. <xsl:attribute name="office:value-type">boolean</xsl:attribute>
  3106. <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3107. </xsl:when>
  3108. <xsl:when test="表:数据/@表:数据类型 = 'text'">
  3109. <xsl:attribute name="office:value-type">string</xsl:attribute>
  3110. <xsl:attribute name="table:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  3111. </xsl:when>
  3112. </xsl:choose>
  3113. <xsl:if test="表:数据/字:句/字:文本串">
  3114. <text:p>
  3115. <xsl:value-of select="表:数据/字:句/字:文本串"/>
  3116. </text:p>
  3117. </xsl:if>
  3118. </table:table-cell>
  3119. </xsl:for-each>
  3120. </xsl:template>
  3121. <!-- add row-group 2.8 -->
  3122. <xsl:template name="create-row">
  3123. <xsl:param name="index-value"/>
  3124. <xsl:param name="span-value"/>
  3125. <xsl:param name="worksheetNo"/>
  3126. <xsl:param name="row-value"/>
  3127. <xsl:param name="times"/>
  3128. <xsl:param name="current-index"/>
  3129. <xsl:param name="condition-pos-str"/>
  3130. <xsl:element name="table:table-row">
  3131. <xsl:choose>
  3132. <xsl:when test="./表:分页符集/表:分页符/@表:行号 = ($index-value + $times - 1)">
  3133. <xsl:choose>
  3134. <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
  3135. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
  3136. </xsl:when>
  3137. <xsl:otherwise>
  3138. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob', $worksheetNo, '-', $row-value)"/></xsl:attribute>
  3139. </xsl:otherwise>
  3140. </xsl:choose>
  3141. </xsl:when>
  3142. <xsl:otherwise>
  3143. <xsl:choose>
  3144. <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
  3145. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
  3146. </xsl:when>
  3147. <xsl:otherwise>
  3148. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro', $worksheetNo, '-', $row-value)"/></xsl:attribute>
  3149. </xsl:otherwise>
  3150. </xsl:choose>
  3151. </xsl:otherwise>
  3152. </xsl:choose>
  3153. <!--chengxiuzhi0617-->
  3154. <xsl:if test="./表:工作表内容/表:行[position() = $row-value]/@表:隐藏 = 'true'">
  3155. <xsl:choose>
  3156. <xsl:when test="./表:工作表内容/表:行[position() = $row-value]/@表:跨度">
  3157. <xsl:if test="$index-value + $times &gt; ($current-index - 1)">
  3158. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  3159. </xsl:if>
  3160. </xsl:when>
  3161. <xsl:otherwise>
  3162. <xsl:if test="$index-value + $times = $current-index">
  3163. <xsl:attribute name="table:visibility">collapse</xsl:attribute>
  3164. </xsl:if>
  3165. </xsl:otherwise>
  3166. </xsl:choose>
  3167. </xsl:if>
  3168. <xsl:choose>
  3169. <xsl:when test="not(./表:工作表内容/表:行[position() = $row-value]/*)">
  3170. <table:table-cell>
  3171. <xsl:for-each select="./表:单元格/表:数据">
  3172. <xsl:choose>
  3173. <xsl:when test="@表:数据类型 = 'number'">
  3174. <xsl:attribute name="office:value-type">float</xsl:attribute>
  3175. <xsl:attribute name="office:value"><xsl:choose><xsl:when test="@表:数据数值"><xsl:value-of select="@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
  3176. </xsl:when>
  3177. <xsl:when test="@表:数据类型 = 'date'">
  3178. <xsl:attribute name="office:value-type">date</xsl:attribute>
  3179. <xsl:attribute name="table:date-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
  3180. </xsl:when>
  3181. <xsl:when test="@表:数据类型 = 'time'">
  3182. <xsl:attribute name="office:value-type">time</xsl:attribute>
  3183. <xsl:attribute name="table:time-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
  3184. </xsl:when>
  3185. <xsl:when test="@表:数据类型 = 'boolean'">
  3186. <xsl:attribute name="office:value-type">boolean</xsl:attribute>
  3187. <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  3188. </xsl:when>
  3189. <xsl:when test="@表:数据类型 = 'text'">
  3190. <xsl:attribute name="office:value-type">string</xsl:attribute>
  3191. <xsl:attribute name="table:string-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
  3192. </xsl:when>
  3193. </xsl:choose>
  3194. <xsl:if test="字:句/字:文本串">
  3195. <text:p>
  3196. <xsl:value-of select="字:句/字:文本串"/>
  3197. </text:p>
  3198. </xsl:if>
  3199. </xsl:for-each>
  3200. </table:table-cell>
  3201. </xsl:when>
  3202. <xsl:otherwise>
  3203. <xsl:choose>
  3204. <xsl:when test="$index-value + $times &lt; $current-index">
  3205. <xsl:variable name="current" select="concat('R',($index-value + $times),'C')"/>
  3206. <xsl:variable name="col-pos-max">
  3207. <xsl:call-template name="condition-row-col-pos-max">
  3208. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3209. <xsl:with-param name="last-value" select="0"/>
  3210. <xsl:with-param name="div-value" select="'C'"/>
  3211. </xsl:call-template>
  3212. </xsl:variable>
  3213. <xsl:choose>
  3214. <xsl:when test="contains($condition-pos-str,$current)">
  3215. <xsl:call-template name="get-cell-span-in">
  3216. <xsl:with-param name="row-pos" select="$index-value + $times"/>
  3217. <xsl:with-param name="c-start" select="1"/>
  3218. <xsl:with-param name="c-end" select="$col-pos-max"/>
  3219. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3220. </xsl:call-template>
  3221. </xsl:when>
  3222. <xsl:otherwise>
  3223. <table:table-cell/>
  3224. </xsl:otherwise>
  3225. </xsl:choose>
  3226. </xsl:when>
  3227. <xsl:when test="$index-value + $times = $current-index">
  3228. <xsl:apply-templates select="表:工作表内容/表:行[position() = $row-value]" mode="selected">
  3229. <xsl:with-param name="row-pos" select="$index-value + $times"/>
  3230. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3231. </xsl:apply-templates>
  3232. </xsl:when>
  3233. <xsl:otherwise>
  3234. <table:table-cell/>
  3235. </xsl:otherwise>
  3236. </xsl:choose>
  3237. </xsl:otherwise>
  3238. </xsl:choose>
  3239. </xsl:element>
  3240. <xsl:if test="$times &lt; $span-value">
  3241. <xsl:call-template name="create-row">
  3242. <xsl:with-param name="index-value" select="$index-value"/>
  3243. <xsl:with-param name="span-value" select="$span-value"/>
  3244. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  3245. <xsl:with-param name="row-value" select="$row-value"/>
  3246. <xsl:with-param name="times" select="$times + 1"/>
  3247. <xsl:with-param name="current-index" select="$current-index"/>
  3248. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3249. </xsl:call-template>
  3250. </xsl:if>
  3251. </xsl:template>
  3252. <xsl:template name="condition-row-col-pos-max">
  3253. <xsl:param name="condition-pos-str"/>
  3254. <xsl:param name="last-value"/>
  3255. <xsl:param name="div-value"/>
  3256. <xsl:variable name="pre-value">
  3257. <xsl:choose>
  3258. <xsl:when test="$div-value = 'R'">
  3259. <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),'C')"/>
  3260. </xsl:when>
  3261. <xsl:otherwise>
  3262. <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),',')"/>
  3263. </xsl:otherwise>
  3264. </xsl:choose>
  3265. </xsl:variable>
  3266. <xsl:variable name="end-value">
  3267. <xsl:choose>
  3268. <xsl:when test="$last-value &lt; $pre-value">
  3269. <xsl:value-of select="$pre-value"/>
  3270. </xsl:when>
  3271. <xsl:otherwise>
  3272. <xsl:value-of select="$last-value"/>
  3273. </xsl:otherwise>
  3274. </xsl:choose>
  3275. </xsl:variable>
  3276. <xsl:choose>
  3277. <xsl:when test="contains($condition-pos-str,$div-value)">
  3278. <xsl:call-template name="condition-row-col-pos-max">
  3279. <xsl:with-param name="condition-pos-str" select="substring-after($condition-pos-str,$div-value)"/>
  3280. <xsl:with-param name="last-value" select="$end-value"/>
  3281. <xsl:with-param name="div-value" select="$div-value"/>
  3282. </xsl:call-template>
  3283. </xsl:when>
  3284. <xsl:otherwise>
  3285. <xsl:value-of select="$end-value"/>
  3286. </xsl:otherwise>
  3287. </xsl:choose>
  3288. </xsl:template>
  3289. <xsl:template name="break-row-beyond-max">
  3290. <xsl:param name="pos"/>
  3291. <xsl:param name="last-value"/>
  3292. <xsl:param name="count-value"/>
  3293. <xsl:variable name="pre-value" select="./表:分页符集/表:分页符[@表:列号 and (position() = $pos)]/@表:列号"/>
  3294. <xsl:variable name="end-value">
  3295. <xsl:choose>
  3296. <xsl:when test="$last-value &lt; $pre-value">
  3297. <xsl:value-of select="$pre-value"/>
  3298. </xsl:when>
  3299. <xsl:otherwise>
  3300. <xsl:value-of select="$last-value"/>
  3301. </xsl:otherwise>
  3302. </xsl:choose>
  3303. </xsl:variable>
  3304. <xsl:choose>
  3305. <xsl:when test="$pos &lt; $count-value">
  3306. <xsl:call-template name="break-row-beyond-max">
  3307. <xsl:with-param name="pos" select="$pos + 1"/>
  3308. <xsl:with-param name="last-value" select="$end-value"/>
  3309. <xsl:with-param name="count-value" select="$count-value"/>
  3310. </xsl:call-template>
  3311. </xsl:when>
  3312. <xsl:otherwise>
  3313. <xsl:value-of select="$end-value"/>
  3314. </xsl:otherwise>
  3315. </xsl:choose>
  3316. </xsl:template>
  3317. <xsl:template name="get-row-beyond-last">
  3318. <xsl:param name="index-value"/>
  3319. <xsl:param name="worksheetNo"/>
  3320. <xsl:param name="condition-pos-str"/>
  3321. <xsl:param name="end-pos"/>
  3322. <xsl:param name="total-col"/>
  3323. <xsl:variable name="current" select="concat('R',$index-value)"/>
  3324. <xsl:element name="table:table-row">
  3325. <xsl:choose>
  3326. <xsl:when test="./表:分页符集/表:分页符/@行号 = ($index-value - 1)">
  3327. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
  3328. </xsl:when>
  3329. <xsl:otherwise>
  3330. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
  3331. </xsl:otherwise>
  3332. </xsl:choose>
  3333. <xsl:choose>
  3334. <xsl:when test="contains($condition-pos-str,$current)">
  3335. <xsl:call-template name="get-cell-span-in">
  3336. <xsl:with-param name="row-pos" select="$index-value"/>
  3337. <xsl:with-param name="c-start" select="1"/>
  3338. <xsl:with-param name="c-end" select="$total-col"/>
  3339. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3340. </xsl:call-template>
  3341. </xsl:when>
  3342. <xsl:otherwise>
  3343. <table:table-cell/>
  3344. </xsl:otherwise>
  3345. </xsl:choose>
  3346. </xsl:element>
  3347. <xsl:if test="$index-value &lt; ($end-pos + 1)">
  3348. <xsl:call-template name="get-row-beyond-last">
  3349. <xsl:with-param name="index-value" select="$index-value + 1"/>
  3350. <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
  3351. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3352. <xsl:with-param name="end-pos" select="$end-pos"/>
  3353. <xsl:with-param name="total-col" select="$total-col"/>
  3354. </xsl:call-template>
  3355. </xsl:if>
  3356. </xsl:template>
  3357. <xsl:template name="get-cell-span-in">
  3358. <xsl:param name="row-pos"/>
  3359. <xsl:param name="c-start"/>
  3360. <xsl:param name="c-end"/>
  3361. <xsl:param name="condition-pos-str"/>
  3362. <xsl:variable name="current" select="concat('R',$row-pos,'C',$c-start,',')"/>
  3363. <xsl:variable name="style-name">
  3364. <xsl:choose>
  3365. <xsl:when test="contains($condition-pos-str,$current)">
  3366. <xsl:variable name="temp-str">
  3367. <xsl:call-template name="condition-str">
  3368. <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current)"/>
  3369. </xsl:call-template>
  3370. </xsl:variable>
  3371. <xsl:choose>
  3372. <xsl:when test="starts-with($temp-str, 'c')">
  3373. <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
  3374. </xsl:when>
  3375. <xsl:when test="starts-with($temp-str, 'v')">
  3376. <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
  3377. </xsl:when>
  3378. </xsl:choose>
  3379. </xsl:when>
  3380. <xsl:otherwise>
  3381. <xsl:choose>
  3382. <xsl:when test="../表:单元格[position() = position() - 1]/@表:式样引用">
  3383. <xsl:value-of select="../表:单元格[position() = position() - 1]/@表:式样引用 "/>
  3384. </xsl:when>
  3385. <xsl:when test="../@表:式样引用">
  3386. <xsl:value-of select="../@表:式样引用"/>
  3387. </xsl:when>
  3388. <xsl:otherwise>
  3389. <xsl:value-of select="'Default'"/>
  3390. </xsl:otherwise>
  3391. </xsl:choose>
  3392. </xsl:otherwise>
  3393. </xsl:choose>
  3394. </xsl:variable>
  3395. <xsl:choose>
  3396. <xsl:when test="$c-start &lt; $c-end">
  3397. <xsl:call-template name="get-cell-condition-in">
  3398. <xsl:with-param name="style-name" select="$style-name"/>
  3399. </xsl:call-template>
  3400. <xsl:call-template name="get-cell-span-in">
  3401. <xsl:with-param name="row-pos" select="$row-pos"/>
  3402. <xsl:with-param name="c-start" select="$c-start + 1"/>
  3403. <xsl:with-param name="c-end" select="$c-end"/>
  3404. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3405. </xsl:call-template>
  3406. </xsl:when>
  3407. <xsl:when test="$c-start = $c-end">
  3408. <xsl:call-template name="get-cell-condition-in">
  3409. <xsl:with-param name="style-name" select="$style-name"/>
  3410. </xsl:call-template>
  3411. </xsl:when>
  3412. <xsl:otherwise>
  3413. <table:table-cell/>
  3414. </xsl:otherwise>
  3415. </xsl:choose>
  3416. </xsl:template>
  3417. <xsl:template name="get-cell-condition-in">
  3418. <xsl:param name="style-name"/>
  3419. <xsl:element name="table:table-cell">
  3420. <xsl:if test="not( contains($style-name, 'Default'))">
  3421. <xsl:choose>
  3422. <xsl:when test="starts-with($style-name, 'val')">
  3423. <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
  3424. </xsl:when>
  3425. <xsl:when test="starts-with($style-name, 'ce')">
  3426. <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
  3427. </xsl:when>
  3428. <xsl:otherwise>
  3429. <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
  3430. </xsl:otherwise>
  3431. </xsl:choose>
  3432. </xsl:if>
  3433. <!--chengxiuzhi0617 单元格-->
  3434. </xsl:element>
  3435. </xsl:template>
  3436. <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:分页符集/表:分页符[@表:列号]" name="ColBreak" use="Column"/>
  3437. <xsl:template name="create-default-column">
  3438. <xsl:param name="currentColumn"/>
  3439. <xsl:param name="currentColumnNode"/>
  3440. <xsl:param name="worksheetNo"/>
  3441. <xsl:element name="table:table-column">
  3442. <xsl:attribute name="table:default-cell-style-name"><xsl:call-template name="get-default-cell-style"><xsl:with-param name="currentColumnNode" select="$currentColumnNode"/></xsl:call-template></xsl:attribute>
  3443. <xsl:choose>
  3444. <xsl:when test="key('ColBreak', $currentColumn)">
  3445. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
  3446. </xsl:when>
  3447. <xsl:otherwise>
  3448. <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$worksheetNo)"/></xsl:attribute>
  3449. </xsl:otherwise>
  3450. </xsl:choose>
  3451. <!--chengxiuzhi0617用key就错-->
  3452. </xsl:element>
  3453. </xsl:template>
  3454. <xsl:template name="get-default-cell-style">
  3455. <xsl:param name="currentColumnNode"/>
  3456. <xsl:choose>
  3457. <xsl:when test="$currentColumnNode">
  3458. <xsl:choose>
  3459. <xsl:when test="$currentColumnNode/@表:式样引用">
  3460. <xsl:value-of select="$currentColumnNode/@表:式样引用"/>
  3461. </xsl:when>
  3462. <xsl:otherwise>Default</xsl:otherwise>
  3463. </xsl:choose>
  3464. </xsl:when>
  3465. <xsl:otherwise>
  3466. <xsl:choose>
  3467. <xsl:when test="./表:工作表内容[@表:式样引用]">
  3468. <xsl:value-of select="./表:工作表内容/@表:式样引用"/>
  3469. </xsl:when>
  3470. <xsl:otherwise>Default</xsl:otherwise>
  3471. </xsl:choose>
  3472. </xsl:otherwise>
  3473. </xsl:choose>
  3474. </xsl:template>
  3475. <xsl:template match="表:行" mode="selected">
  3476. <xsl:param name="row-pos"/>
  3477. <xsl:param name="condition-pos-str"/>
  3478. <xsl:choose>
  3479. <xsl:when test="表:单元格">
  3480. <xsl:apply-templates select="表:单元格[1]" mode="selected">
  3481. <xsl:with-param name="row-pos" select="$row-pos"/>
  3482. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3483. <xsl:with-param name="col-pos-max">
  3484. <xsl:call-template name="condition-row-col-pos-max">
  3485. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3486. <xsl:with-param name="last-value" select="0"/>
  3487. <xsl:with-param name="div-value" select="'C'"/>
  3488. </xsl:call-template>
  3489. </xsl:with-param>
  3490. <xsl:with-param name="col-pos-before" select="0"/>
  3491. </xsl:apply-templates>
  3492. </xsl:when>
  3493. <xsl:otherwise>
  3494. <xsl:variable name="current" select="concat('R',$row-pos,'C')"/>
  3495. <xsl:choose>
  3496. <xsl:when test="contains($condition-pos-str,$current)">
  3497. <xsl:call-template name="get-cell-span-in">
  3498. <xsl:with-param name="row-pos" select="$row-pos"/>
  3499. <xsl:with-param name="c-start" select="1"/>
  3500. <xsl:with-param name="c-end">
  3501. <xsl:call-template name="condition-row-col-pos-max">
  3502. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3503. <xsl:with-param name="last-value" select="0"/>
  3504. <xsl:with-param name="div-value" select="'C'"/>
  3505. </xsl:call-template>
  3506. </xsl:with-param>
  3507. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3508. <xsl:with-param name="col-pos" select="1"/>
  3509. </xsl:call-template>
  3510. </xsl:when>
  3511. <xsl:otherwise>
  3512. <table:table-cell/>
  3513. </xsl:otherwise>
  3514. </xsl:choose>
  3515. </xsl:otherwise>
  3516. </xsl:choose>
  3517. </xsl:template>
  3518. <xsl:template match="表:单元格" mode="selected">
  3519. <xsl:param name="condition-pos-str"/>
  3520. <xsl:param name="col-pos-max"/>
  3521. <xsl:param name="col-pos-before"/>
  3522. <xsl:param name="row-pos"/>
  3523. <xsl:param name="col-repeated" select="1"/>
  3524. <xsl:variable name="col-pos">
  3525. <xsl:choose>
  3526. <xsl:when test="@表:列号">
  3527. <xsl:choose>
  3528. <xsl:when test="@表:合并列数">
  3529. <xsl:value-of select="@表:合并列数 + @表:列号"/>
  3530. </xsl:when>
  3531. <xsl:otherwise>
  3532. <xsl:value-of select="@表:列号"/>
  3533. </xsl:otherwise>
  3534. </xsl:choose>
  3535. </xsl:when>
  3536. <xsl:otherwise>
  3537. <xsl:choose>
  3538. <xsl:when test="@表:合并列数">
  3539. <xsl:value-of select="1 + @表:合并列数 + $col-pos-before"/>
  3540. </xsl:when>
  3541. <xsl:otherwise>
  3542. <xsl:value-of select="1 + $col-pos-before"/>
  3543. </xsl:otherwise>
  3544. </xsl:choose>
  3545. </xsl:otherwise>
  3546. </xsl:choose>
  3547. </xsl:variable>
  3548. <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
  3549. <xsl:variable name="maodian" select="boolean($next-cell/uof:锚点)"/>
  3550. <xsl:variable name="cell-is-repeatable" select="not(current()/*) and not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
  3551. <xsl:if test="$col-repeated = 1">
  3552. <xsl:if test="@表:列号 != ($col-pos-before + 1)">
  3553. <xsl:call-template name="get-cell-span-in">
  3554. <xsl:with-param name="row-pos" select="$row-pos"/>
  3555. <xsl:with-param name="c-start" select="$col-pos-before + 1"/>
  3556. <xsl:with-param name="c-end" select="@表:列号 - 1"/>
  3557. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3558. </xsl:call-template>
  3559. </xsl:if>
  3560. <xsl:element name="table:table-cell">
  3561. <xsl:call-template name="create-table-cell-attributes">
  3562. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3563. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3564. <xsl:with-param name="col-pos" select="$col-pos"/>
  3565. <xsl:with-param name="row-pos" select="$row-pos"/>
  3566. </xsl:call-template>
  3567. <xsl:if test="$cell-is-repeatable">
  3568. <xsl:apply-templates select="$next-cell" mode="selected">
  3569. <xsl:with-param name="row-pos" select="$row-pos"/>
  3570. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3571. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3572. <xsl:with-param name="col-pos-before" select="$col-pos + 1"/>
  3573. <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
  3574. </xsl:apply-templates>
  3575. </xsl:if>
  3576. <xsl:call-template name="create-table-cell-content">
  3577. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3578. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3579. <xsl:with-param name="col-pos" select="$col-pos"/>
  3580. <xsl:with-param name="row-pos" select="$row-pos"/>
  3581. </xsl:call-template>
  3582. </xsl:element>
  3583. <xsl:if test="@表:合并列数">
  3584. <xsl:element name="table:covered-table-cell">
  3585. <xsl:if test="@表:合并列数 &gt; 1">
  3586. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:合并列数"/></xsl:attribute>
  3587. </xsl:if>
  3588. </xsl:element>
  3589. </xsl:if>
  3590. </xsl:if>
  3591. <xsl:choose>
  3592. <xsl:when test="not($cell-is-repeatable and $col-repeated = 1)">
  3593. <xsl:choose>
  3594. <xsl:when test="not($cell-is-repeatable) and $col-repeated &gt; 1">
  3595. <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$col-repeated"/></xsl:attribute>
  3596. </xsl:when>
  3597. <xsl:when test="not($next-cell)">
  3598. <xsl:if test="../../../../../表:公用处理规则/表:条件格式化集/表:条件格式化">
  3599. <xsl:call-template name="get-cell-span-in">
  3600. <xsl:with-param name="row-pos" select="$row-pos"/>
  3601. <xsl:with-param name="c-start" select="$col-pos"/>
  3602. <xsl:with-param name="c-end" select="$col-pos-max"/>
  3603. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3604. </xsl:call-template>
  3605. </xsl:if>
  3606. </xsl:when>
  3607. <xsl:when test="not($cell-is-repeatable)">
  3608. <xsl:apply-templates select="$next-cell" mode="selected">
  3609. <xsl:with-param name="row-pos" select="$row-pos"/>
  3610. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3611. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3612. <xsl:with-param name="col-pos-before" select="$col-pos"/>
  3613. </xsl:apply-templates>
  3614. </xsl:when>
  3615. <xsl:otherwise>
  3616. <xsl:apply-templates select="$next-cell" mode="selected">
  3617. <xsl:with-param name="row-pos" select="$row-pos"/>
  3618. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3619. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3620. <xsl:with-param name="col-pos-before" select="$col-pos"/>
  3621. <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
  3622. </xsl:apply-templates>
  3623. </xsl:otherwise>
  3624. </xsl:choose>
  3625. </xsl:when>
  3626. <xsl:otherwise>
  3627. <xsl:if test="$next-cell">
  3628. <xsl:apply-templates select="$next-cell" mode="skip">
  3629. <xsl:with-param name="row-pos" select="$row-pos"/>
  3630. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  3631. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  3632. <xsl:with-param name="col-pos-before" select="$col-pos"/>
  3633. </xsl:apply-templates>
  3634. </xsl:if>
  3635. </xsl:otherwise>
  3636. </xsl:choose>
  3637. </xsl:template>
  3638. <!--Redoffice comment liliang sc0012 06.02.15-->
  3639. <!--新增内容-->
  3640. <xsl:template match="uof:锚点">
  3641. <xsl:variable name="tuxing1" select="@uof:图形引用"/>
  3642. <xsl:choose>
  3643. <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
  3644. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif'">
  3645. <xsl:element name="draw:frame">
  3646. <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::uof:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
  3647. <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
  3648. <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
  3649. <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
  3650. <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
  3651. <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
  3652. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  3653. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  3654. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  3655. <xsl:variable name="rotate-angle">
  3656. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  3657. </xsl:variable>
  3658. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  3659. </xsl:if>
  3660. <xsl:if test="图:文本内容">
  3661. <xsl:apply-templates select="图:文本内容/字:段落"/>
  3662. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  3663. </xsl:if>
  3664. </xsl:for-each>
  3665. <xsl:element name="draw:image">
  3666. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
  3667. <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符= $tuxing1]/uof:路径"/></xsl:attribute>
  3668. </xsl:if>
  3669. <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
  3670. <office:binary-data>
  3671. <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
  3672. </office:binary-data>
  3673. </xsl:if>
  3674. </xsl:element>
  3675. </xsl:element>
  3676. </xsl:if>
  3677. </xsl:when>
  3678. <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true']">
  3679. <draw:text-box text:anchor-type="paragraph">
  3680. <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
  3681. <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
  3682. <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
  3683. <xsl:if test="@uof:x坐标">
  3684. <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
  3685. </xsl:if>
  3686. <xsl:if test="@uof:y坐标">
  3687. <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
  3688. </xsl:if>
  3689. <xsl:attribute name="draw:z-index"><xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:层次"/></xsl:attribute>
  3690. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
  3691. <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
  3692. </draw:text-box>
  3693. </xsl:when>
  3694. <xsl:otherwise>
  3695. <xsl:call-template name="graph">
  3696. <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]"/>
  3697. <xsl:with-param name="groupx" select="0"/>
  3698. <xsl:with-param name="groupy" select="0"/>
  3699. </xsl:call-template>
  3700. </xsl:otherwise>
  3701. </xsl:choose>
  3702. </xsl:template>
  3703. <xsl:template name="graph">
  3704. <xsl:param name="id"/>
  3705. <xsl:param name="groupx"/>
  3706. <xsl:param name="groupy"/>
  3707. <xsl:for-each select="$id">
  3708. <xsl:variable name="tuxing1">
  3709. <xsl:value-of select="图:预定义图形/图:类别"/>
  3710. </xsl:variable>
  3711. <xsl:choose>
  3712. <xsl:when test="$tuxing1='11'">
  3713. <xsl:call-template name="Rectangle">
  3714. <xsl:with-param name="groupx1" select="$groupx"/>
  3715. <xsl:with-param name="groupy1" select="$groupy"/>
  3716. </xsl:call-template>
  3717. </xsl:when>
  3718. <xsl:when test="$tuxing1='19'">
  3719. <xsl:call-template name="Oval">
  3720. <xsl:with-param name="groupx1" select="$groupx"/>
  3721. <xsl:with-param name="groupy1" select="$groupy"/>
  3722. </xsl:call-template>
  3723. </xsl:when>
  3724. <xsl:when test="$tuxing1='61'">
  3725. <xsl:call-template name="Line">
  3726. <xsl:with-param name="groupx1" select="$groupx"/>
  3727. <xsl:with-param name="groupy1" select="$groupy"/>
  3728. </xsl:call-template>
  3729. </xsl:when>
  3730. <xsl:when test="$tuxing1='64'">
  3731. <xsl:call-template name="Curve">
  3732. <xsl:with-param name="groupx1" select="$groupx"/>
  3733. <xsl:with-param name="groupy1" select="$groupy"/>
  3734. </xsl:call-template>
  3735. </xsl:when>
  3736. <xsl:when test="$tuxing1='65'">
  3737. <xsl:call-template name="Freeform">
  3738. <xsl:with-param name="groupx1" select="$groupx"/>
  3739. <xsl:with-param name="groupy1" select="$groupy"/>
  3740. </xsl:call-template>
  3741. </xsl:when>
  3742. <xsl:when test="$tuxing1='66'">
  3743. <xsl:call-template name="Scribble">
  3744. <xsl:with-param name="groupx1" select="$groupx"/>
  3745. <xsl:with-param name="groupy1" select="$groupy"/>
  3746. </xsl:call-template>
  3747. </xsl:when>
  3748. <xsl:when test="$tuxing1='4'">
  3749. <xsl:element name="draw:g">
  3750. <xsl:variable name="tu">
  3751. <xsl:value-of select="@图:标识符"/>
  3752. </xsl:variable>
  3753. <xsl:attribute name="draw:style-name"><xsl:value-of select="$tu"/></xsl:attribute>
  3754. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  3755. <xsl:variable name="this-group-x">
  3756. <xsl:choose>
  3757. <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
  3758. <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:x坐标"/>
  3759. </xsl:when>
  3760. <xsl:otherwise>
  3761. <xsl:value-of select="number(0)"/>
  3762. </xsl:otherwise>
  3763. </xsl:choose>
  3764. </xsl:variable>
  3765. <xsl:variable name="this-group-y">
  3766. <xsl:choose>
  3767. <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:y坐标">
  3768. <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:y坐标"/>
  3769. </xsl:when>
  3770. <xsl:otherwise>
  3771. <xsl:value-of select="number(0)"/>
  3772. </xsl:otherwise>
  3773. </xsl:choose>
  3774. </xsl:variable>
  3775. <xsl:variable name="group-x">
  3776. <xsl:value-of select="number($groupx + $this-group-x)"/>
  3777. </xsl:variable>
  3778. <xsl:variable name="group-y">
  3779. <xsl:value-of select="number($groupy + $this-group-y)"/>
  3780. </xsl:variable>
  3781. <xsl:call-template name="组合图形">
  3782. <xsl:with-param name="zuheliebiao" select="@图:组合列表"/>
  3783. <xsl:with-param name="groupx1" select="$group-x"/>
  3784. <xsl:with-param name="groupy1" select="$group-y"/>
  3785. </xsl:call-template>
  3786. </xsl:element>
  3787. </xsl:when>
  3788. </xsl:choose>
  3789. </xsl:for-each>
  3790. </xsl:template>
  3791. <xsl:template name="common">
  3792. <xsl:param name="groupx"/>
  3793. <xsl:param name="groupy"/>
  3794. <xsl:variable name="tuxing">
  3795. <xsl:value-of select="@图:标识符"/>
  3796. </xsl:variable>
  3797. <xsl:choose>
  3798. <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
  3799. <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
  3800. <xsl:if test="@uof:x坐标">
  3801. <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
  3802. </xsl:if>
  3803. <xsl:if test="@uof:y坐标">
  3804. <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
  3805. </xsl:if>
  3806. <xsl:variable name="tuxing1" select="@uof:图形引用"/>
  3807. <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
  3808. <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
  3809. </xsl:for-each>
  3810. </xsl:when>
  3811. <xsl:otherwise>
  3812. <xsl:variable name="zuheweizhi-x">
  3813. <xsl:value-of select="图:组合位置/@图:x坐标"/>
  3814. </xsl:variable>
  3815. <xsl:variable name="zuheweizhi-y">
  3816. <xsl:value-of select="图:组合位置/@图:y坐标"/>
  3817. </xsl:variable>
  3818. <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
  3819. <xsl:attribute name="svg:x"><xsl:value-of select="concat(($groupx + $zuheweizhi-x),$uofUnit)"/></xsl:attribute>
  3820. <xsl:attribute name="svg:y"><xsl:value-of select="concat(($groupy + $zuheweizhi-y),$uofUnit)"/></xsl:attribute>
  3821. <xsl:attribute name="svg:width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
  3822. <xsl:attribute name="svg:height"><xsl:value-of select="concat(图:预定义图形/图:属性 /图:高度,$uofUnit)"/></xsl:attribute>
  3823. </xsl:otherwise>
  3824. </xsl:choose>
  3825. <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
  3826. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  3827. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  3828. <xsl:variable name="rotate-angle">
  3829. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  3830. </xsl:variable>
  3831. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  3832. </xsl:if>
  3833. <xsl:if test="图:文本内容">
  3834. <xsl:apply-templates select="图:文本内容/字:段落"/>
  3835. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  3836. </xsl:if>
  3837. </xsl:template>
  3838. <xsl:template name="组合图形">
  3839. <xsl:param name="zuheliebiao"/>
  3840. <xsl:param name="groupx1"/>
  3841. <xsl:param name="groupy1"/>
  3842. <xsl:variable name="x">
  3843. <xsl:value-of select="$groupx1"/>
  3844. </xsl:variable>
  3845. <xsl:variable name="y">
  3846. <xsl:value-of select="$groupy1"/>
  3847. </xsl:variable>
  3848. <xsl:variable name="first-pictures">
  3849. <xsl:value-of select="substring-before($zuheliebiao,',')"/>
  3850. </xsl:variable>
  3851. <xsl:variable name="other-pictures">
  3852. <xsl:value-of select="substring-after($zuheliebiao,',')"/>
  3853. </xsl:variable>
  3854. <xsl:choose>
  3855. <xsl:when test="contains($other-pictures,',')">
  3856. <xsl:call-template name="graph">
  3857. <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
  3858. <xsl:with-param name="groupx" select="$groupx1"/>
  3859. <xsl:with-param name="groupy" select="$groupy1"/>
  3860. </xsl:call-template>
  3861. <xsl:call-template name="组合图形">
  3862. <xsl:with-param name="zuheliebiao" select="$other-pictures"/>
  3863. <xsl:with-param name="groupx1" select="$x"/>
  3864. <xsl:with-param name="groupy1" select="$y"/>
  3865. </xsl:call-template>
  3866. </xsl:when>
  3867. <xsl:otherwise>
  3868. <xsl:call-template name="graph">
  3869. <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
  3870. <xsl:with-param name="groupx" select="$groupx1"/>
  3871. <xsl:with-param name="groupy" select="$groupy1"/>
  3872. </xsl:call-template>
  3873. <xsl:call-template name="graph">
  3874. <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $other-pictures]"/>
  3875. <xsl:with-param name="groupx" select="$groupx1"/>
  3876. <xsl:with-param name="groupy" select="$groupy1"/>
  3877. </xsl:call-template>
  3878. </xsl:otherwise>
  3879. </xsl:choose>
  3880. </xsl:template>
  3881. <xsl:template name="Curve">
  3882. <xsl:param name="groupx1"/>
  3883. <xsl:param name="groupy1"/>
  3884. <xsl:element name="draw:path">
  3885. <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
  3886. <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
  3887. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  3888. <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
  3889. <xsl:call-template name="common">
  3890. <xsl:with-param name="groupx" select="$groupx1"/>
  3891. <xsl:with-param name="groupy" select="$groupy1"/>
  3892. </xsl:call-template>
  3893. </xsl:element>
  3894. </xsl:template>
  3895. <xsl:template name="Freeform">
  3896. <xsl:param name="groupx1"/>
  3897. <xsl:param name="groupy1"/>
  3898. <xsl:element name="draw:polygon">
  3899. <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
  3900. <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
  3901. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  3902. <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
  3903. <xsl:call-template name="common">
  3904. <xsl:with-param name="groupx" select="$groupx1"/>
  3905. <xsl:with-param name="groupy" select="$groupy1"/>
  3906. </xsl:call-template>
  3907. </xsl:element>
  3908. </xsl:template>
  3909. <xsl:template name="Scribble">
  3910. <xsl:param name="groupx1"/>
  3911. <xsl:param name="groupy1"/>
  3912. <xsl:element name="draw:polyline">
  3913. <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
  3914. <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
  3915. <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
  3916. <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
  3917. <xsl:call-template name="common">
  3918. <xsl:with-param name="groupx" select="$groupx1"/>
  3919. <xsl:with-param name="groupy" select="$groupy1"/>
  3920. </xsl:call-template>
  3921. </xsl:element>
  3922. </xsl:template>
  3923. <xsl:template name="drawpoints">
  3924. <xsl:param name="points"/>
  3925. <xsl:param name="value"/>
  3926. <xsl:variable name="frist-piont">
  3927. <xsl:value-of select="substring-before($points,'lineto')"/>
  3928. </xsl:variable>
  3929. <xsl:variable name="other-points">
  3930. <xsl:value-of select="substring-after($points,'lineto')"/>
  3931. </xsl:variable>
  3932. <xsl:choose>
  3933. <xsl:when test="contains($other-points,'lineto')">
  3934. <xsl:variable name="x-coor">
  3935. <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
  3936. </xsl:variable>
  3937. <xsl:variable name="y-coor">
  3938. <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
  3939. </xsl:variable>
  3940. <xsl:variable name="all-points">
  3941. <xsl:value-of select="concat($value,$x-coor,',',$y-coor,' ')"/>
  3942. </xsl:variable>
  3943. <xsl:call-template name="drawpoints">
  3944. <xsl:with-param name="points" select="$other-points"/>
  3945. <xsl:with-param name="value" select="$all-points"/>
  3946. </xsl:call-template>
  3947. </xsl:when>
  3948. <xsl:otherwise>
  3949. <xsl:variable name="q-x-coor">
  3950. <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
  3951. </xsl:variable>
  3952. <xsl:variable name="q-y-coor">
  3953. <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
  3954. </xsl:variable>
  3955. <xsl:variable name="e-x-coor">
  3956. <xsl:value-of select="substring-before($other-points,' ') * 1000"/>
  3957. </xsl:variable>
  3958. <xsl:variable name="e-y-coor">
  3959. <xsl:value-of select="substring-after($other-points,' ') * 1000"/>
  3960. </xsl:variable>
  3961. <xsl:value-of select="concat($value,$q-x-coor,',',$q-y-coor,' ',$e-x-coor,',',$e-y-coor)"/>
  3962. </xsl:otherwise>
  3963. </xsl:choose>
  3964. </xsl:template>
  3965. <xsl:template name="Oval">
  3966. <xsl:param name="groupx1"/>
  3967. <xsl:param name="groupy1"/>
  3968. <xsl:element name="draw:ellipse">
  3969. <xsl:call-template name="common">
  3970. <xsl:with-param name="groupx" select="$groupx1"/>
  3971. <xsl:with-param name="groupy" select="$groupy1"/>
  3972. </xsl:call-template>
  3973. </xsl:element>
  3974. </xsl:template>
  3975. <xsl:template name="Rectangle">
  3976. <xsl:param name="groupx1"/>
  3977. <xsl:param name="groupy1"/>
  3978. <xsl:element name="draw:rect">
  3979. <xsl:call-template name="common">
  3980. <xsl:with-param name="groupx" select="$groupx1"/>
  3981. <xsl:with-param name="groupy" select="$groupy1"/>
  3982. </xsl:call-template>
  3983. </xsl:element>
  3984. </xsl:template>
  3985. <xsl:template name="Line">
  3986. <xsl:param name="groupx1"/>
  3987. <xsl:param name="groupy1"/>
  3988. <xsl:element name="draw:line">
  3989. <xsl:variable name="tuxing1" select="@图:标识符"/>
  3990. <xsl:choose>
  3991. <xsl:when test="key('rel_graphic_name',@图:标识符)">
  3992. <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
  3993. <xsl:attribute name="svg:x1"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
  3994. <xsl:attribute name="svg:y1"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
  3995. <xsl:attribute name="svg:x2"><xsl:value-of select="concat((number(@uof:x坐标) + number(@uof:宽度)),$uofUnit)"/></xsl:attribute>
  3996. <xsl:attribute name="svg:y2"><xsl:value-of select="concat((number(@uof:y坐标) + number(@uof:高度)),$uofUnit)"/></xsl:attribute>
  3997. </xsl:for-each>
  3998. </xsl:when>
  3999. <xsl:otherwise>
  4000. <xsl:variable name="zuheweizhi-x">
  4001. <xsl:value-of select="图:组合位置/@图:x坐标"/>
  4002. </xsl:variable>
  4003. <xsl:variable name="zuheweizhi-y">
  4004. <xsl:value-of select="图:组合位置/@图:y坐标"/>
  4005. </xsl:variable>
  4006. <xsl:variable name="hex">
  4007. <xsl:value-of select="concat(number($groupx1 + $zuheweizhi-x),$uofUnit)"/>
  4008. </xsl:variable>
  4009. <xsl:variable name="hey">
  4010. <xsl:value-of select="concat(number($groupy1 + $zuheweizhi-y),$uofUnit)"/>
  4011. </xsl:variable>
  4012. <xsl:attribute name="svg:x1"><xsl:value-of select="$hex"/></xsl:attribute>
  4013. <xsl:attribute name="svg:y1"><xsl:value-of select="$hey"/></xsl:attribute>
  4014. <xsl:attribute name="svg:x2"><xsl:value-of select="concat(($hex + 图:预定义图形/图:属性/图:宽度),$uofUnit)"/></xsl:attribute>
  4015. <xsl:attribute name="svg:y2"><xsl:value-of select="concat(($hey + 图:预定义图形/图:属性/图:高度),$uofUnit)"/></xsl:attribute>
  4016. </xsl:otherwise>
  4017. </xsl:choose>
  4018. <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
  4019. <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
  4020. <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
  4021. <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
  4022. <xsl:variable name="rotate-angle">
  4023. <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
  4024. </xsl:variable>
  4025. <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
  4026. </xsl:if>
  4027. <xsl:if test="图:文本内容">
  4028. <xsl:apply-templates select="图:文本内容/字:段落"/>
  4029. <xsl:apply-templates select="图:文本内容/字:文字表"/>
  4030. </xsl:if>
  4031. </xsl:element>
  4032. </xsl:template>
  4033. <!--Redoffice comment liliang end 06.02.15-->
  4034. <xsl:template match="表:单元格" mode="skip">
  4035. <xsl:param name="condition-pos-str"/>
  4036. <xsl:param name="col-pos-max"/>
  4037. <xsl:param name="col-pos-before"/>
  4038. <xsl:param name="row-pos"/>
  4039. <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
  4040. <xsl:variable name="cell-is-repeatable" select="not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
  4041. <xsl:choose>
  4042. <xsl:when test="$cell-is-repeatable">
  4043. <xsl:apply-templates select="$next-cell" mode="skip">
  4044. <xsl:with-param name="row-pos" select="$row-pos"/>
  4045. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  4046. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  4047. <xsl:with-param name="col-pos-before" select="$col-pos-before + 1"/>
  4048. </xsl:apply-templates>
  4049. </xsl:when>
  4050. <xsl:otherwise>
  4051. <xsl:if test="$next-cell">
  4052. <xsl:apply-templates select="$next-cell" mode="selected">
  4053. <xsl:with-param name="row-pos" select="$row-pos"/>
  4054. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  4055. <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
  4056. <xsl:with-param name="col-pos-before" select="$col-pos-before +1"/>
  4057. </xsl:apply-templates>
  4058. <!--chengxz0925 no otherwise ,some content cells missed -->
  4059. </xsl:if>
  4060. <!--chengxz 060418 add if sentence-->
  4061. </xsl:otherwise>
  4062. </xsl:choose>
  4063. </xsl:template>
  4064. <!--xsl:template name="create-table-cell-attributes"></xsl:template>
  4065. <xsl:template name="create-table-cell-content"></xsl:template>
  4066. <xsl:template name="create-data-content"></xsl:template>
  4067. <xsl:template name="get-condition-dependent-cell-attributes"></xsl:template-->
  4068. <xsl:template name="create-table-cell-attributes">
  4069. <xsl:param name="condition-pos-str"/>
  4070. <xsl:param name="col-pos-max"/>
  4071. <xsl:param name="col-pos"/>
  4072. <xsl:param name="row-pos"/>
  4073. <xsl:choose>
  4074. <xsl:when test="$condition-pos-str">
  4075. <xsl:call-template name="get-condition-dependent-cell-attributes">
  4076. <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
  4077. <xsl:with-param name="current-pos-str" select="concat('R',$row-pos,'C',$col-pos,',')"/>
  4078. </xsl:call-template>
  4079. </xsl:when>
  4080. <xsl:otherwise>
  4081. <xsl:attribute name="table:style-name"><xsl:choose><xsl:when test="@表:式样引用"><xsl:value-of select="@表:式样引用"/></xsl:when><xsl:when test="../@表:式样引用 and ../@表:式样引用 != ''"><xsl:value-of select="../@表:式样引用"/></xsl:when><xsl:otherwise><xsl:value-of select="'Default'"/></xsl:otherwise></xsl:choose></xsl:attribute>
  4082. <!--chengxiuzhi-->
  4083. </xsl:otherwise>
  4084. </xsl:choose>
  4085. <xsl:if test="@表:合并列数 or @表:合并行数">
  4086. <xsl:choose>
  4087. <xsl:when test="@表:合并列数">
  4088. <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="@表:合并列数 + 1"/></xsl:attribute>
  4089. </xsl:when>
  4090. <xsl:otherwise>
  4091. <xsl:attribute name="table:number-columns-spanned">1</xsl:attribute>
  4092. </xsl:otherwise>
  4093. </xsl:choose>
  4094. <xsl:choose>
  4095. <xsl:when test="@表:合并行数">
  4096. <xsl:attribute name="table:number-rows-spanned"><xsl:value-of select="@表:合并行数+1"/></xsl:attribute>
  4097. </xsl:when>
  4098. <xsl:otherwise>
  4099. <xsl:attribute name="table:number-rows-spanned">1</xsl:attribute>
  4100. </xsl:otherwise>
  4101. </xsl:choose>
  4102. </xsl:if>
  4103. <xsl:if test="表:数据">
  4104. <xsl:if test="表:数据/表:公式">
  4105. <xsl:variable name="calc-formula">
  4106. <xsl:call-template name="translate-expression">
  4107. <xsl:with-param name="cell-row-pos" select="$row-pos"/>
  4108. <xsl:with-param name="cell-column-pos" select="$col-pos"/>
  4109. <xsl:with-param name="expression" select="表:数据/表:公式"/>
  4110. <xsl:with-param name="return-value" select="''"/>
  4111. </xsl:call-template>
  4112. </xsl:variable>
  4113. <xsl:attribute name="table:formula"><xsl:value-of select="$calc-formula"/></xsl:attribute>
  4114. </xsl:if>
  4115. <!--RedOffice Comment from Zengjh:UOF0020 2006-04-17 Based on Original-->
  4116. <xsl:variable name="table-stylename" select="@表:式样引用"/>
  4117. <xsl:variable name="data-format">
  4118. <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
  4119. <xsl:if test="$table-stylename = ./@ 表:标识符">
  4120. <xsl:value-of select="表:数字格式/@表:分类名称"/>
  4121. </xsl:if>
  4122. </xsl:for-each>
  4123. </xsl:variable>
  4124. <xsl:variable name="data-formatcode">
  4125. <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
  4126. <xsl:if test="$table-stylename= ./@表:标识符">
  4127. <xsl:value-of select="表:数字格式/@表:格式码"/>
  4128. </xsl:if>
  4129. </xsl:for-each>
  4130. </xsl:variable>
  4131. <xsl:choose>
  4132. <xsl:when test="表:数据/@表:数据类型 = 'number'">
  4133. <xsl:choose>
  4134. <xsl:when test="$data-format = 'percentage' or contains( $data-formatcode, '%')">
  4135. <xsl:attribute name="office:value-type">percentage</xsl:attribute>
  4136. </xsl:when>
  4137. <xsl:when test="contains($data-format, 'currency')">
  4138. <xsl:attribute name="office:value-type">currency</xsl:attribute>
  4139. <xsl:attribute name="office:currency">CNY</xsl:attribute>
  4140. </xsl:when>
  4141. <xsl:otherwise>
  4142. <xsl:attribute name="office:value-type">float</xsl:attribute>
  4143. </xsl:otherwise>
  4144. </xsl:choose>
  4145. <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
  4146. </xsl:when>
  4147. <xsl:when test="表:数据/@表:数据类型 = 'date'">
  4148. <xsl:attribute name="office:value-type">date</xsl:attribute>
  4149. <xsl:attribute name="office:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  4150. </xsl:when>
  4151. <xsl:when test="表:数据/@表:数据类型 = 'time'">
  4152. <xsl:attribute name="office:value-type">time</xsl:attribute>
  4153. <xsl:attribute name="office:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  4154. </xsl:when>
  4155. <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
  4156. <xsl:attribute name="office:value-type">boolean</xsl:attribute>
  4157. <xsl:attribute name="office:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  4158. </xsl:when>
  4159. <xsl:when test="表:数据/@表:数据类型 = 'text'">
  4160. <xsl:attribute name="office:value-type">string</xsl:attribute>
  4161. <xsl:attribute name="office:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
  4162. </xsl:when>
  4163. </xsl:choose>
  4164. </xsl:if>
  4165. <!-- zhangying ok and /uof:UOF/uof:电子表格/表:公共处理规则/表:数据有效性集-->
  4166. <xsl:if test="表:数据">
  4167. <xsl:variable name="validation-name">
  4168. <xsl:call-template name="zyvalidationtest">
  4169. <xsl:with-param name="column-num" select="$col-pos"/>
  4170. <xsl:with-param name="row-num" select="$row-pos"/>
  4171. <xsl:with-param name="table-name" select="ancestor::表:工作表/@表:名称"/>
  4172. <xsl:with-param name="validation-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:数据有效性集/表:数据有效性"/>
  4173. <xsl:with-param name="validation-num" select="'1'"/>
  4174. </xsl:call-template>
  4175. </xsl:variable>
  4176. <xsl:if test="$validation-name!=''">
  4177. <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$validation-name"/></xsl:attribute>
  4178. </xsl:if>
  4179. </xsl:if>
  4180. <!-- zhangying mod end -->
  4181. </xsl:template>
  4182. <!-- zhangying o -->
  4183. <xsl:template name="zyvalidationtest">
  4184. <xsl:param name="row-num"/>
  4185. <xsl:param name="column-num"/>
  4186. <xsl:param name="table-name"/>
  4187. <xsl:param name="validation-set"/>
  4188. <xsl:param name="validation-num"/>
  4189. <xsl:if test="$validation-set">
  4190. <xsl:variable name="zone" select="$validation-set/表:区域/text()"/>
  4191. <xsl:variable name="success">
  4192. <xsl:choose>
  4193. <xsl:when test="$table-name=substring-after(substring-before($zone,'.'),'$')">
  4194. <xsl:variable name="validation-row-left-top" select="substring-before(substring-after(substring-after(substring-after($zone,'$'),'$'),'$'),':')"/>
  4195. <xsl:variable name="validation-row-right-bottom" select="substring-after(substring-after(substring-after($zone,':$'),'$'),'$')"/>
  4196. <xsl:choose>
  4197. <xsl:when test="($row-num &gt;= $validation-row-left-top and $row-num &lt;= $validation-row-right-bottom) or $validation-row-left-top=$validation-row-right-bottom">
  4198. <xsl:variable name="validation-column-left-top">
  4199. <xsl:call-template name="translate-column-char-to-number">
  4200. <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,'$'),'$'),'$')"/>
  4201. </xsl:call-template>
  4202. </xsl:variable>
  4203. <xsl:variable name="validation-column-right-bottom">
  4204. <xsl:call-template name="translate-column-char-to-number">
  4205. <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,':$'),'$'),'$')"/>
  4206. </xsl:call-template>
  4207. </xsl:variable>
  4208. <xsl:choose>
  4209. <xsl:when test="($column-num &gt;= $validation-column-left-top) and ($column-num &lt;= $validation-column-right-bottom)">yes</xsl:when>
  4210. <xsl:otherwise/>
  4211. </xsl:choose>
  4212. </xsl:when>
  4213. <xsl:otherwise/>
  4214. </xsl:choose>
  4215. </xsl:when>
  4216. <xsl:otherwise/>
  4217. </xsl:choose>
  4218. </xsl:variable>
  4219. <xsl:choose>
  4220. <xsl:when test="$success='yes'">
  4221. <xsl:value-of select="concat('val',$validation-num)"/>
  4222. </xsl:when>
  4223. <xsl:otherwise>
  4224. <xsl:call-template name="zyvalidationtest">
  4225. <xsl:with-param name="table-name" select="$table-name"/>
  4226. <xsl:with-param name="row-num" select="$row-num"/>
  4227. <xsl:with-param name="column-num" select="$column-num"/>
  4228. <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
  4229. <xsl:with-param name="validation-num" select="$validation-num + 1"/>
  4230. </xsl:call-template>
  4231. </xsl:otherwise>
  4232. </xsl:choose>
  4233. </xsl:if>
  4234. </xsl:template>
  4235. <!--zhangying mod end -->
  4236. <xsl:template name="create-table-cell-content">
  4237. <xsl:param name="condition-pos-str"/>
  4238. <xsl:param name="col-pos-max"/>
  4239. <xsl:param name="col-pos"/>
  4240. <xsl:param name="row-pos"/>
  4241. <!--Redoffice comment liliang SC0011 06.02.15 -->
  4242. <!--新增内容-->
  4243. <xsl:apply-templates select="uof:锚点"/>
  4244. <!--Redoffice comment liliang end 06.02.15 -->
  4245. <xsl:apply-templates select="表:批注" mode="body"/>
  4246. <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
  4247. <xsl:apply-templates select="表:图表"/>
  4248. <xsl:if test="表:数据/字:句">
  4249. <text:p>
  4250. <xsl:call-template name="create-data-content">
  4251. <xsl:with-param name="style-id" select="../../@表:式样引用"/>
  4252. </xsl:call-template>
  4253. </text:p>
  4254. </xsl:if>
  4255. <!--chengxz0701多个句不能读入-->
  4256. </xsl:template>
  4257. <xsl:template name="create-data-content">
  4258. <xsl:param name="style-id" select="@表:式样引用"/>
  4259. <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
  4260. <xsl:choose>
  4261. <xsl:when test="$html-children and $html-children != ''">
  4262. <xsl:for-each select="$html-children">
  4263. <text:span text:style-name="{concat($style-id, 'T', count(preceding::表:数据/字:句/字:文本串[child::html:*]), '_', position())}">
  4264. <xsl:copy-of select="text()"/>
  4265. </text:span>
  4266. </xsl:for-each>
  4267. </xsl:when>
  4268. <xsl:when test="@表:超链接引用">
  4269. <text:a xlink:href="{@表:超链接引用}">
  4270. <xsl:value-of select="表:数据/字:句/字:文本串"/>
  4271. </text:a>
  4272. </xsl:when>
  4273. <xsl:otherwise>
  4274. <xsl:for-each select="表:数据/字:句">
  4275. <xsl:choose>
  4276. <xsl:when test="name(descendant::*[1])='字:句属性'">
  4277. <text:span>
  4278. <xsl:attribute name="text:style-name"><xsl:value-of select="descendant::*[1]/@字:式样引用"/></xsl:attribute>
  4279. <xsl:value-of select="./字:文本串"/>
  4280. </text:span>
  4281. </xsl:when>
  4282. <xsl:otherwise>
  4283. <xsl:value-of select="./字:文本串"/>
  4284. </xsl:otherwise>
  4285. </xsl:choose>
  4286. </xsl:for-each>
  4287. </xsl:otherwise>
  4288. </xsl:choose>
  4289. </xsl:template>
  4290. <xsl:template name="create-comment-data-content">
  4291. <xsl:param name="style-id" select="@表:式样引用"/>
  4292. <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
  4293. <xsl:choose>
  4294. <xsl:when test="$html-children and $html-children != ''">
  4295. <xsl:for-each select="$html-children">
  4296. <text:span text:style-name="{concat($style-id, 'T', count(preceding::图:文本内容/字:段落/字:句/字:文本串[child::html:*]), '_', position())}">
  4297. <xsl:copy-of select="text()"/>
  4298. </text:span>
  4299. </xsl:for-each>
  4300. </xsl:when>
  4301. <xsl:when test="@表:超链接引用">
  4302. <text:a xlink:href="{@表:超链接引用}">
  4303. <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
  4304. </text:a>
  4305. </xsl:when>
  4306. <xsl:otherwise>
  4307. <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
  4308. </xsl:otherwise>
  4309. </xsl:choose>
  4310. </xsl:template>
  4311. <xsl:template name="get-condition-dependent-cell-attributes">
  4312. <xsl:param name="condition-pos-str"/>
  4313. <xsl:param name="current-pos-str"/>
  4314. <xsl:variable name="temp-str">
  4315. <xsl:call-template name="condition-str">
  4316. <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current-pos-str)"/>
  4317. </xsl:call-template>
  4318. </xsl:variable>
  4319. <xsl:variable name="style-name">
  4320. <xsl:choose>
  4321. <xsl:when test="contains($condition-pos-str, $current-pos-str) and starts-with($temp-str, 'c')">
  4322. <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
  4323. </xsl:when>
  4324. <xsl:otherwise>
  4325. <xsl:choose>
  4326. <xsl:when test="@表:式样引用">
  4327. <xsl:value-of select="@表:式样引用"/>
  4328. </xsl:when>
  4329. <xsl:when test="../@表:式样引用">
  4330. <xsl:value-of select="../@表:式样引用"/>
  4331. </xsl:when>
  4332. <xsl:otherwise>
  4333. <xsl:value-of select="'Default'"/>
  4334. </xsl:otherwise>
  4335. </xsl:choose>
  4336. </xsl:otherwise>
  4337. </xsl:choose>
  4338. </xsl:variable>
  4339. <xsl:if test="not( contains($style-name, 'Default'))">
  4340. <xsl:choose>
  4341. <xsl:when test="starts-with($style-name, 'val')">
  4342. <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
  4343. </xsl:when>
  4344. <xsl:otherwise>
  4345. <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
  4346. </xsl:otherwise>
  4347. </xsl:choose>
  4348. </xsl:if>
  4349. <xsl:if test="contains($style-name, 'Default')">
  4350. <xsl:variable name="style-nametemp">
  4351. <xsl:choose>
  4352. <xsl:when test="@表:式样引用">
  4353. <xsl:value-of select="@表:式样引用"/>
  4354. </xsl:when>
  4355. <xsl:when test="../@表:式样引用">
  4356. <xsl:value-of select="../@表:式样引用"/>
  4357. </xsl:when>
  4358. <xsl:otherwise>
  4359. <xsl:value-of select="'Default'"/>
  4360. </xsl:otherwise>
  4361. </xsl:choose>
  4362. </xsl:variable>
  4363. <xsl:attribute name="table:style-name"><xsl:value-of select="$style-nametemp"/></xsl:attribute>
  4364. <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="N104" /></xsl:attribute-->
  4365. </xsl:if>
  4366. <!--chengxz-->
  4367. <xsl:if test="contains($condition-pos-str, $current-pos-str)">
  4368. <xsl:choose>
  4369. <xsl:when test="starts-with($temp-str, 'v')">
  4370. <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/></xsl:attribute>
  4371. </xsl:when>
  4372. <xsl:otherwise>
  4373. <xsl:variable name="after-str" select="substring-after($condition-pos-str, $current-pos-str)"/>
  4374. <xsl:if test="contains( $after-str, $current-pos-str)">
  4375. <xsl:variable name="temp-str-2">
  4376. <xsl:call-template name="condition-str">
  4377. <xsl:with-param name="param-str" select="substring-before( $after-str,$current-pos-str)"/>
  4378. </xsl:call-template>
  4379. </xsl:variable>
  4380. <xsl:if test="starts-with( $temp-str-2, 'v')">
  4381. <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str-2, 'v'))"/></xsl:attribute>
  4382. </xsl:if>
  4383. </xsl:if>
  4384. </xsl:otherwise>
  4385. </xsl:choose>
  4386. </xsl:if>
  4387. </xsl:template>
  4388. <xsl:template match="表:工作表内容">
  4389. <xsl:variable name="default-column-width">
  4390. <xsl:choose>
  4391. <xsl:when test="@表:缺省列宽">
  4392. <xsl:call-template name="convert2cm">
  4393. <xsl:with-param name="value" select="concat(@表:缺省列宽,'pt')"/>
  4394. </xsl:call-template>
  4395. <xsl:text>cm</xsl:text>
  4396. </xsl:when>
  4397. <xsl:otherwise>2.096cm</xsl:otherwise>
  4398. </xsl:choose>
  4399. </xsl:variable>
  4400. <xsl:variable name="table-pos">
  4401. <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
  4402. </xsl:variable>
  4403. <xsl:choose>
  4404. <xsl:when test="表:列">
  4405. <xsl:call-template name="get-column-style-name">
  4406. <xsl:with-param name="finishedColumns" select="0"/>
  4407. <xsl:with-param name="columnCount" select="count(./表:列)"/>
  4408. <xsl:with-param name="currentCount" select="1"/>
  4409. <xsl:with-param name="table-pos" select="$table-pos"/>
  4410. <xsl:with-param name="default-column-width" select="$default-column-width"/>
  4411. </xsl:call-template>
  4412. </xsl:when>
  4413. </xsl:choose>
  4414. <xsl:if test="../表:分页符集/表:分页符[@表:列号]">
  4415. <style:style style:name="{concat('cob',$table-pos)}" style:family="table-column">
  4416. <xsl:element name="style:table-column-properties">
  4417. <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
  4418. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  4419. </xsl:element>
  4420. </style:style>
  4421. </xsl:if>
  4422. <xsl:variable name="default-row-height">
  4423. <xsl:choose>
  4424. <xsl:when test="@表:缺省行高">
  4425. <xsl:call-template name="convert2cm">
  4426. <xsl:with-param name="value" select="concat(@表:缺省行高,'pt')"/>
  4427. </xsl:call-template>
  4428. <xsl:text>cm</xsl:text>
  4429. </xsl:when>
  4430. <xsl:otherwise>0.503cm</xsl:otherwise>
  4431. </xsl:choose>
  4432. </xsl:variable>
  4433. <style:style style:family="table-row" style:name="{concat('ro', $table-pos)}">
  4434. <style:table-row-properties style:row-height="{$default-row-height}" style:use-optimal-row-height="false"/>
  4435. </style:style>
  4436. <xsl:if test="表:行">
  4437. <xsl:call-template name="get-row-style-name">
  4438. <xsl:with-param name="lastrowpos" select="0"/>
  4439. <xsl:with-param name="row-count" select="count(./表:行)"/>
  4440. <xsl:with-param name="currentRow" select="1"/>
  4441. <xsl:with-param name="table-pos" select="$table-pos"/>
  4442. <xsl:with-param name="default-row-height" select="$default-row-height"/>
  4443. </xsl:call-template>
  4444. </xsl:if>
  4445. <!--RedOffice Comment from Zengjh:UOF0020 2006-06-11 charts-->
  4446. <xsl:for-each select="//表:图表">
  4447. <xsl:variable name="chart-current">
  4448. <xsl:number level="any" count="表:图表" format="1"/>
  4449. </xsl:variable>
  4450. <style:style style:family="graphics" style:name="{concat('chart', $chart-current)}">
  4451. <style:graphic-properties>
  4452. <xsl:choose>
  4453. <xsl:when test="@表:随动方式='none'">
  4454. <xsl:attribute name="draw:move-protect">true</xsl:attribute>
  4455. <xsl:attribute name="draw:size-protect">true</xsl:attribute>
  4456. </xsl:when>
  4457. <xsl:when test="@表:随动方式='move'">
  4458. <xsl:attribute name="draw:size-protect">true</xsl:attribute>
  4459. </xsl:when>
  4460. <xsl:otherwise/>
  4461. </xsl:choose>
  4462. </style:graphic-properties>
  4463. </style:style>
  4464. </xsl:for-each>
  4465. <!--RedOffice comment (Zengjh) end charts-->
  4466. <xsl:if test="../表:分页符集/表:分页符[@行号]">
  4467. <style:style style:name="{concat('rob',$table-pos)}" style:family="table-row">
  4468. <xsl:element name="style:table-row-properties">
  4469. <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
  4470. <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
  4471. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  4472. </xsl:element>
  4473. </style:style>
  4474. </xsl:if>
  4475. <xsl:element name="style:style">
  4476. <xsl:attribute name="style:name"><xsl:value-of select="concat( 'ta', $table-pos)"/></xsl:attribute>
  4477. <xsl:attribute name="style:family">table</xsl:attribute>
  4478. <xsl:attribute name="style:master-page-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_',../@表:名称)"/></xsl:call-template></xsl:attribute>
  4479. <xsl:element name="style:properties">
  4480. <xsl:choose>
  4481. <xsl:when test="../@表:隐藏 = 'true'">
  4482. <xsl:attribute name="table:display">false</xsl:attribute>
  4483. </xsl:when>
  4484. <xsl:otherwise>
  4485. <xsl:attribute name="table:display">true</xsl:attribute>
  4486. </xsl:otherwise>
  4487. </xsl:choose>
  4488. </xsl:element>
  4489. </xsl:element>
  4490. </xsl:template>
  4491. <xsl:template name="get-column-style-name">
  4492. <xsl:param name="finishedColumns"/>
  4493. <xsl:param name="columnCount"/>
  4494. <xsl:param name="currentCount"/>
  4495. <xsl:param name="table-pos"/>
  4496. <xsl:param name="default-column-width"/>
  4497. <xsl:if test="$currentCount &lt; ($columnCount + 1)">
  4498. <xsl:variable name="span-value">
  4499. <xsl:choose>
  4500. <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
  4501. <xsl:value-of select="./表:跨度[position() = $currentCount]/@表:跨度 + 1"/>
  4502. </xsl:when>
  4503. <xsl:otherwise>
  4504. <xsl:value-of select="0"/>
  4505. </xsl:otherwise>
  4506. </xsl:choose>
  4507. </xsl:variable>
  4508. <xsl:variable name="current-index">
  4509. <xsl:choose>
  4510. <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
  4511. <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号 - 1"/>
  4512. </xsl:when>
  4513. <xsl:otherwise>
  4514. <xsl:value-of select="$finishedColumns"/>
  4515. </xsl:otherwise>
  4516. </xsl:choose>
  4517. </xsl:variable>
  4518. <xsl:variable name="column-break">
  4519. <xsl:choose>
  4520. <xsl:when test="$span-value = 0">
  4521. <xsl:if test="../表:分页符集/表:分页符/表:列 = $current-index">
  4522. <xsl:value-of select="1"/>
  4523. </xsl:if>
  4524. </xsl:when>
  4525. <xsl:otherwise>
  4526. <xsl:if test="../表:分页符集/表:分页符[(@表:列号 &gt; $finishedColumns) and (@表:列号 &lt; ($finishedColumns + $span-value))]">
  4527. <xsl:value-of select="1"/>
  4528. </xsl:if>
  4529. </xsl:otherwise>
  4530. </xsl:choose>
  4531. </xsl:variable>
  4532. <xsl:if test="$column-break = 1">
  4533. <xsl:element name="style:style">
  4534. <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('cob', $table-pos, '-',$currentCount)"/></xsl:call-template></xsl:attribute>
  4535. <xsl:attribute name="style:family">table-column</xsl:attribute>
  4536. <xsl:element name="style:table-column-properties">
  4537. <xsl:choose>
  4538. <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
  4539. <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  4540. </xsl:when>
  4541. <xsl:otherwise>
  4542. <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
  4543. </xsl:otherwise>
  4544. </xsl:choose>
  4545. <xsl:choose>
  4546. <xsl:when test="./表:列[position() = $currentCount]/@表:列宽 &gt; 0">
  4547. <xsl:attribute name="style:use-optimal-column-width">false</xsl:attribute>
  4548. </xsl:when>
  4549. <xsl:otherwise>
  4550. <xsl:attribute name="style:use-optimal-column-width">true</xsl:attribute>
  4551. </xsl:otherwise>
  4552. </xsl:choose>
  4553. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  4554. </xsl:element>
  4555. </xsl:element>
  4556. </xsl:if>
  4557. <style:style style:name="{concat('co', $table-pos, '-',$currentCount)}" style:family="table-column">
  4558. <xsl:element name="style:table-column-properties">
  4559. <xsl:choose>
  4560. <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
  4561. <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  4562. </xsl:when>
  4563. <xsl:otherwise>
  4564. <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
  4565. </xsl:otherwise>
  4566. </xsl:choose>
  4567. <xsl:attribute name="fo:break-before">auto</xsl:attribute>
  4568. </xsl:element>
  4569. </style:style>
  4570. <xsl:if test="$currentCount &lt; $columnCount">
  4571. <xsl:call-template name="get-column-style-name">
  4572. <xsl:with-param name="finishedColumns">
  4573. <xsl:choose>
  4574. <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
  4575. <xsl:choose>
  4576. <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
  4577. <xsl:value-of select="./表:列[position() = $currentCount]/@表:列宽 + ./表:列[position() = $currentCount]/@表:跨度"/>
  4578. </xsl:when>
  4579. <xsl:otherwise>
  4580. <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号"/>
  4581. </xsl:otherwise>
  4582. </xsl:choose>
  4583. </xsl:when>
  4584. <xsl:otherwise>
  4585. <xsl:choose>
  4586. <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
  4587. <xsl:value-of select="$finishedColumns + ./表:列[position() = $currentCount]/@表:跨度 + 1"/>
  4588. </xsl:when>
  4589. <xsl:otherwise>
  4590. <xsl:value-of select="$finishedColumns + 1"/>
  4591. </xsl:otherwise>
  4592. </xsl:choose>
  4593. </xsl:otherwise>
  4594. </xsl:choose>
  4595. </xsl:with-param>
  4596. <xsl:with-param name="columnCount" select="$columnCount"/>
  4597. <xsl:with-param name="currentCount" select="$currentCount + 1"/>
  4598. <xsl:with-param name="table-pos" select="$table-pos"/>
  4599. <xsl:with-param name="default-column-width" select="$default-column-width"/>
  4600. </xsl:call-template>
  4601. </xsl:if>
  4602. </xsl:if>
  4603. </xsl:template>
  4604. <xsl:template name="get-row-style-name">
  4605. <xsl:param name="lastrowpos"/>
  4606. <xsl:param name="row-count"/>
  4607. <xsl:param name="currentRow"/>
  4608. <xsl:param name="table-pos"/>
  4609. <xsl:param name="default-row-height"/>
  4610. <xsl:if test="$currentRow &lt; ($row-count + 1)">
  4611. <xsl:variable name="span-value">
  4612. <xsl:choose>
  4613. <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
  4614. <xsl:choose>
  4615. <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
  4616. <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - $lastrowpos+ ./表:行[position() = $currentRow]/@表:跨度"/>
  4617. </xsl:when>
  4618. <xsl:otherwise>
  4619. <xsl:value-of select="0"/>
  4620. </xsl:otherwise>
  4621. </xsl:choose>
  4622. </xsl:when>
  4623. <xsl:otherwise>
  4624. <xsl:choose>
  4625. <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
  4626. <xsl:value-of select="./表:行[position() = $currentRow]/@表:跨度 + 1"/>
  4627. </xsl:when>
  4628. <xsl:otherwise>
  4629. <xsl:value-of select="0"/>
  4630. </xsl:otherwise>
  4631. </xsl:choose>
  4632. </xsl:otherwise>
  4633. </xsl:choose>
  4634. </xsl:variable>
  4635. <xsl:variable name="current-index">
  4636. <xsl:choose>
  4637. <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
  4638. <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - 1"/>
  4639. </xsl:when>
  4640. <xsl:otherwise>
  4641. <xsl:value-of select="$lastrowpos"/>
  4642. </xsl:otherwise>
  4643. </xsl:choose>
  4644. </xsl:variable>
  4645. <xsl:variable name="row-break">
  4646. <xsl:choose>
  4647. <xsl:when test="$span-value = 0">
  4648. <xsl:if test="../表:分页符集/表:分页符/@表:行号 = $current-index">
  4649. <xsl:value-of select="1"/>
  4650. </xsl:if>
  4651. </xsl:when>
  4652. <xsl:otherwise>
  4653. <xsl:if test="../表:分页符集/表:分页符[(@表:行号 &gt; $lastrowpos) and (@表:行号 &lt; ($lastrowpos + $span-value))]">
  4654. <xsl:value-of select="1"/>
  4655. </xsl:if>
  4656. </xsl:otherwise>
  4657. </xsl:choose>
  4658. </xsl:variable>
  4659. <xsl:if test="$row-break = 1">
  4660. <style:style style:name="{concat('rob', $table-pos, '-',$currentRow)}" style:family="table-row">
  4661. <xsl:element name="style:table-row-properties">
  4662. <xsl:choose>
  4663. <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
  4664. <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  4665. </xsl:when>
  4666. <xsl:otherwise>
  4667. <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
  4668. </xsl:otherwise>
  4669. </xsl:choose>
  4670. <xsl:choose>
  4671. <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
  4672. <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
  4673. </xsl:when>
  4674. <xsl:otherwise>
  4675. <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
  4676. </xsl:otherwise>
  4677. </xsl:choose>
  4678. <xsl:attribute name="fo:break-before">page</xsl:attribute>
  4679. </xsl:element>
  4680. </style:style>
  4681. </xsl:if>
  4682. <style:style style:name="{concat('ro', $table-pos, '-',$currentRow)}" style:family="table-row">
  4683. <xsl:element name="style:table-row-properties">
  4684. <xsl:choose>
  4685. <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
  4686. <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  4687. </xsl:when>
  4688. <xsl:otherwise>
  4689. <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
  4690. </xsl:otherwise>
  4691. </xsl:choose>
  4692. <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
  4693. <xsl:choose>
  4694. <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
  4695. <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
  4696. </xsl:when>
  4697. <xsl:otherwise>
  4698. <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
  4699. </xsl:otherwise>
  4700. </xsl:choose>
  4701. <xsl:attribute name="fo:break-before">auto</xsl:attribute>
  4702. </xsl:element>
  4703. </style:style>
  4704. <xsl:if test="$currentRow &lt; $row-count">
  4705. <xsl:call-template name="get-row-style-name">
  4706. <xsl:with-param name="lastrowpos">
  4707. <xsl:choose>
  4708. <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
  4709. <xsl:choose>
  4710. <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
  4711. <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 + ./表:行[position() = $currentRow]/@表:跨度"/>
  4712. </xsl:when>
  4713. <xsl:otherwise>
  4714. <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号"/>
  4715. </xsl:otherwise>
  4716. </xsl:choose>
  4717. </xsl:when>
  4718. <xsl:otherwise>
  4719. <xsl:choose>
  4720. <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
  4721. <xsl:value-of select="$lastrowpos + ./表:行[position() = $currentRow]/@表:跨度 + 1"/>
  4722. </xsl:when>
  4723. <xsl:otherwise>
  4724. <xsl:value-of select="$lastrowpos + 1"/>
  4725. </xsl:otherwise>
  4726. </xsl:choose>
  4727. </xsl:otherwise>
  4728. </xsl:choose>
  4729. </xsl:with-param>
  4730. <xsl:with-param name="row-count" select="$row-count"/>
  4731. <xsl:with-param name="currentRow" select="$currentRow + 1"/>
  4732. <xsl:with-param name="table-pos" select="$table-pos"/>
  4733. <xsl:with-param name="default-row-height" select="$default-row-height"/>
  4734. </xsl:call-template>
  4735. </xsl:if>
  4736. </xsl:if>
  4737. </xsl:template>
  4738. <xsl:template name="encode-as-nc-name">
  4739. <xsl:param name="string"/>
  4740. <xsl:value-of select="translate($string, '. %()/\+', '')"/>
  4741. </xsl:template>
  4742. <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格" name="cells" use="@表:式样引用"/>
  4743. <xsl:template match="表:数字格式">
  4744. <xsl:variable name="unit-count" select="string-length(@表:格式码) - string-length(translate(@表:格式码,';','')) + 1"/>
  4745. <xsl:variable name="style-id" select="../@表:标识符"/>
  4746. <xsl:variable name="number-format-name">
  4747. <xsl:choose>
  4748. <xsl:when test="@表:分类名称='fraction' or @表:分类名称='scientific'">number</xsl:when>
  4749. <xsl:otherwise>
  4750. <xsl:value-of select="@表:分类名称"/>
  4751. </xsl:otherwise>
  4752. </xsl:choose>
  4753. </xsl:variable>
  4754. <xsl:call-template name="process-number-format">
  4755. <xsl:with-param name="number-format-name" select="$number-format-name"/>
  4756. <xsl:with-param name="number-format-unit" select="@表:格式码"/>
  4757. <xsl:with-param name="style-id" select="concat($style-id,'F')"/>
  4758. <xsl:with-param name="format-type" select="key('cells', $style-id)/表:数据/@表:数据类型"/>
  4759. <xsl:with-param name="total-unit" select="$unit-count"/>
  4760. <xsl:with-param name="current-unit" select="0"/>
  4761. </xsl:call-template>
  4762. </xsl:template>
  4763. <xsl:template name="process-number-format">
  4764. <xsl:param name="number-format-name"/>
  4765. <xsl:param name="number-format-unit"/>
  4766. <xsl:param name="style-id"/>
  4767. <xsl:param name="format-type"/>
  4768. <xsl:param name="total-unit"/>
  4769. <xsl:param name="current-unit"/>
  4770. <xsl:choose>
  4771. <xsl:when test="$current-unit &lt; ($total-unit -1)">
  4772. <xsl:variable name="style-name">
  4773. <xsl:choose>
  4774. <xsl:when test="contains(substring-before($number-format-unit,';'),'[$')">currency</xsl:when>
  4775. <xsl:when test="contains(substring-before($number-format-unit,';'),'%')">percentage</xsl:when>
  4776. <xsl:otherwise>number</xsl:otherwise>
  4777. </xsl:choose>
  4778. </xsl:variable>
  4779. <xsl:element name="{concat('number:',$style-name,'-style')}">
  4780. <xsl:attribute name="style:name"><xsl:value-of select="concat( $style-id, 'P',$current-unit)"/></xsl:attribute>
  4781. <xsl:attribute name="style:volatile">true</xsl:attribute>
  4782. <xsl:call-template name="general-number">
  4783. <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
  4784. </xsl:call-template>
  4785. </xsl:element>
  4786. <xsl:call-template name="process-number-format">
  4787. <xsl:with-param name="number-format-name" select="$number-format-name"/>
  4788. <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
  4789. <xsl:with-param name="style-id" select="$style-id"/>
  4790. <xsl:with-param name="format-type" select="$format-type"/>
  4791. <xsl:with-param name="total-unit" select="$total-unit"/>
  4792. <xsl:with-param name="current-unit" select="$current-unit +1"/>
  4793. </xsl:call-template>
  4794. </xsl:when>
  4795. <xsl:otherwise>
  4796. <xsl:element name="{concat('number:',$number-format-name,'-style')}">
  4797. <xsl:attribute name="style:name"><xsl:value-of select="$style-id"/></xsl:attribute>
  4798. <xsl:call-template name="element-attribute">
  4799. <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
  4800. </xsl:call-template>
  4801. <xsl:call-template name="general-number">
  4802. <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
  4803. </xsl:call-template>
  4804. <xsl:call-template name="style-map">
  4805. <xsl:with-param name="number-format-name" select="@表:分类名称"/>
  4806. <xsl:with-param name="number-format-unit" select="@表:格式码"/>
  4807. <xsl:with-param name="style-id" select="$style-id"/>
  4808. <xsl:with-param name="format-type" select="$format-type"/>
  4809. <xsl:with-param name="total-unit" select="$total-unit"/>
  4810. <xsl:with-param name="current-unit" select="0"/>
  4811. </xsl:call-template>
  4812. </xsl:element>
  4813. </xsl:otherwise>
  4814. </xsl:choose>
  4815. </xsl:template>
  4816. <xsl:template name="style-map">
  4817. <xsl:param name="number-format-name"/>
  4818. <xsl:param name="number-format-unit"/>
  4819. <xsl:param name="style-id"/>
  4820. <xsl:param name="format-type"/>
  4821. <xsl:param name="total-unit"/>
  4822. <xsl:param name="current-unit"/>
  4823. <xsl:if test="$current-unit &lt; ($total-unit -1)">
  4824. <xsl:variable name="stylecondition" select="substring-after(substring-before($number-format-unit,']'),'[')"/>
  4825. <style:map style:condition="{$stylecondition}" style:apply-style-name="{concat( $style-id, 'P',$current-unit)}"/>
  4826. <xsl:call-template name="style-map">
  4827. <xsl:with-param name="number-format-name" select="$number-format-name"/>
  4828. <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
  4829. <xsl:with-param name="style-id" select="$style-id"/>
  4830. <xsl:with-param name="format-type" select="$format-type"/>
  4831. <xsl:with-param name="total-unit" select="$total-unit"/>
  4832. <xsl:with-param name="current-unit" select="$current-unit +1"/>
  4833. </xsl:call-template>
  4834. </xsl:if>
  4835. </xsl:template>
  4836. <xsl:template name="general-number">
  4837. <xsl:param name="number-format-unit"/>
  4838. <xsl:call-template name="number-format-color">
  4839. <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
  4840. </xsl:call-template>
  4841. <xsl:call-template name="number-format-currency">
  4842. <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
  4843. </xsl:call-template>
  4844. <xsl:choose>
  4845. <xsl:when test="starts-with($number-format-unit,'&quot;')">
  4846. <number:text>
  4847. <xsl:value-of select="substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')"/>
  4848. </number:text>
  4849. </xsl:when>
  4850. <xsl:when test="starts-with($number-format-unit,'@')">
  4851. <number:text-content/>
  4852. </xsl:when>
  4853. <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">
  4854. <number:text>
  4855. <xsl:value-of select="substring($number-format-unit,1,1)"/>
  4856. </number:text>
  4857. </xsl:when>
  4858. <xsl:when test="starts-with($number-format-unit,'YYYY')">
  4859. <number:year number:style="long"/>
  4860. </xsl:when>
  4861. <xsl:when test="starts-with($number-format-unit,'YY')">
  4862. <number:year number:style="rolong"/>
  4863. </xsl:when>
  4864. <xsl:when test="starts-with($number-format-unit,'MMMM')">
  4865. <number:month number:style="long" number:textual="true"/>
  4866. </xsl:when>
  4867. <xsl:when test="starts-with($number-format-unit,'MMM')">
  4868. <number:month number:style="rolong" number:textual="true"/>
  4869. </xsl:when>
  4870. <xsl:when test="starts-with($number-format-unit,'DD')">
  4871. <number:day number:style="long"/>
  4872. </xsl:when>
  4873. <xsl:when test="starts-with($number-format-unit,'D')">
  4874. <number:day number:style="rolong"/>
  4875. </xsl:when>
  4876. <xsl:when test="starts-with($number-format-unit,'[HH]')">
  4877. <number:hours number:style="long"/>
  4878. </xsl:when>
  4879. <xsl:when test="starts-with($number-format-unit,'HH')">
  4880. <number:hours number:style="long"/>
  4881. </xsl:when>
  4882. <xsl:when test="starts-with($number-format-unit,'H')">
  4883. <number:hours/>
  4884. </xsl:when>
  4885. <xsl:when test="starts-with($number-format-unit,'SS.00')">
  4886. <number:seconds number:style="long" number:decimal-places="2"/>
  4887. </xsl:when>
  4888. <xsl:when test="starts-with($number-format-unit,'SS')">
  4889. <number:seconds number:style="long"/>
  4890. </xsl:when>
  4891. <xsl:when test="starts-with($number-format-unit,'S')">
  4892. <number:seconds/>
  4893. </xsl:when>
  4894. <xsl:when test="starts-with($number-format-unit,'AM/PM')">
  4895. <number:am-pm/>
  4896. </xsl:when>
  4897. <xsl:when test="starts-with($number-format-unit,'NNNN')">
  4898. <number:day-of-week number:style="long"/>
  4899. </xsl:when>
  4900. <xsl:when test="starts-with($number-format-unit,'NNN')">
  4901. <number:day-of-week/>
  4902. </xsl:when>
  4903. <xsl:when test="starts-with($number-format-unit,'QQ')">
  4904. <number:quarter number:style="long"/>
  4905. </xsl:when>
  4906. <xsl:when test="starts-with($number-format-unit,'Q')">
  4907. <number:quarter/>
  4908. </xsl:when>
  4909. <xsl:when test="starts-with($number-format-unit,'WW')">
  4910. <number:week-of-year/>
  4911. </xsl:when>
  4912. <xsl:when test="starts-with($number-format-unit,'MM')">
  4913. <xsl:choose>
  4914. <xsl:when test="starts-with(substring($number-format-unit,3),'S') or (starts-with(substring($number-format-unit,3),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
  4915. <number:minutes number:style="long"/>
  4916. </xsl:when>
  4917. <xsl:otherwise>
  4918. <number:month number:style="long"/>
  4919. </xsl:otherwise>
  4920. </xsl:choose>
  4921. </xsl:when>
  4922. <xsl:when test="starts-with($number-format-unit,'M')">
  4923. <xsl:choose>
  4924. <xsl:when test="starts-with(substring($number-format-unit,2),'S') or (starts-with(substring($number-format-unit,2),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
  4925. <number:minutes/>
  4926. </xsl:when>
  4927. <xsl:otherwise>
  4928. <number:month/>
  4929. </xsl:otherwise>
  4930. </xsl:choose>
  4931. </xsl:when>
  4932. <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
  4933. <xsl:variable name="digits-part">
  4934. <xsl:choose>
  4935. <xsl:when test="contains($number-format-unit,'&quot;')">
  4936. <xsl:value-of select="substring-before($number-format-unit,'&quot;')"/>
  4937. </xsl:when>
  4938. <xsl:otherwise>
  4939. <xsl:value-of select="$number-format-unit"/>
  4940. </xsl:otherwise>
  4941. </xsl:choose>
  4942. </xsl:variable>
  4943. <xsl:call-template name="decimal-integer-exponent-fraction">
  4944. <xsl:with-param name="digits-part" select="$digits-part"/>
  4945. </xsl:call-template>
  4946. </xsl:when>
  4947. </xsl:choose>
  4948. <xsl:variable name="unit-length">
  4949. <xsl:choose>
  4950. <xsl:when test="starts-with($number-format-unit,'[value()')">
  4951. <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
  4952. </xsl:when>
  4953. <xsl:when test="starts-with($number-format-unit,'[NatNum')">
  4954. <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
  4955. </xsl:when>
  4956. <xsl:when test="starts-with($number-format-unit,'[$-804]')">8</xsl:when>
  4957. <xsl:when test="starts-with($number-format-unit,'&quot;')">
  4958. <xsl:value-of select="string-length(substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')) +3"/>
  4959. </xsl:when>
  4960. <xsl:when test="starts-with($number-format-unit,'@')">2</xsl:when>
  4961. <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">2</xsl:when>
  4962. <xsl:when test="starts-with($number-format-unit,'YYYY')">5</xsl:when>
  4963. <xsl:when test="starts-with($number-format-unit,'YY')">3</xsl:when>
  4964. <xsl:when test="starts-with($number-format-unit,'MMMM')">5</xsl:when>
  4965. <xsl:when test="starts-with($number-format-unit,'MMM')">4</xsl:when>
  4966. <xsl:when test="starts-with($number-format-unit,'MM')">3</xsl:when>
  4967. <xsl:when test="starts-with($number-format-unit,'M')">2</xsl:when>
  4968. <xsl:when test="starts-with($number-format-unit,'DD')">3</xsl:when>
  4969. <xsl:when test="starts-with($number-format-unit,'D')">2</xsl:when>
  4970. <xsl:when test="starts-with($number-format-unit,'[HH]')">5</xsl:when>
  4971. <xsl:when test="starts-with($number-format-unit,'HH')">3</xsl:when>
  4972. <xsl:when test="starts-with($number-format-unit,'H')">2</xsl:when>
  4973. <xsl:when test="starts-with($number-format-unit,'SS.00')">6</xsl:when>
  4974. <xsl:when test="starts-with($number-format-unit,'SS')">3</xsl:when>
  4975. <xsl:when test="starts-with($number-format-unit,'S')">2</xsl:when>
  4976. <xsl:when test="starts-with($number-format-unit,'AM/PM')">6</xsl:when>
  4977. <xsl:when test="starts-with($number-format-unit,'NNNN')">5</xsl:when>
  4978. <xsl:when test="starts-with($number-format-unit,'NNN')">4</xsl:when>
  4979. <xsl:when test="starts-with($number-format-unit,'QQ')">3</xsl:when>
  4980. <xsl:when test="starts-with($number-format-unit,'Q')">2</xsl:when>
  4981. <xsl:when test="starts-with($number-format-unit,'WW')">3</xsl:when>
  4982. <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
  4983. <xsl:choose>
  4984. <xsl:when test="contains($number-format-unit,'&quot;')">
  4985. <xsl:value-of select="string-length(substring-before($number-format-unit,'&quot;')) +1"/>
  4986. </xsl:when>
  4987. <xsl:otherwise>
  4988. <xsl:value-of select="string-length($number-format-unit) +1"/>
  4989. </xsl:otherwise>
  4990. </xsl:choose>
  4991. </xsl:when>
  4992. <xsl:otherwise>1</xsl:otherwise>
  4993. </xsl:choose>
  4994. </xsl:variable>
  4995. <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
  4996. <xsl:call-template name="general-number">
  4997. <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
  4998. </xsl:call-template>
  4999. </xsl:if>
  5000. </xsl:template>
  5001. <xsl:template name="decimal-integer-exponent-fraction">
  5002. <xsl:param name="digits-part"/>
  5003. <xsl:variable name="decimal-digits">
  5004. <xsl:choose>
  5005. <xsl:when test="contains($digits-part,'.')">
  5006. <xsl:choose>
  5007. <xsl:when test="contains($digits-part,' ')">
  5008. <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),' '))"/>
  5009. </xsl:when>
  5010. <xsl:when test="contains(substring-after($digits-part,'.'),',')">
  5011. <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),','))"/>
  5012. </xsl:when>
  5013. <xsl:when test="contains($digits-part,'E')">
  5014. <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'E'))"/>
  5015. </xsl:when>
  5016. <xsl:when test="contains($digits-part,'e')">
  5017. <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'e'))"/>
  5018. </xsl:when>
  5019. <xsl:otherwise>
  5020. <xsl:value-of select="string-length(substring-after($digits-part,'.'))"/>
  5021. </xsl:otherwise>
  5022. </xsl:choose>
  5023. </xsl:when>
  5024. <xsl:otherwise>0</xsl:otherwise>
  5025. </xsl:choose>
  5026. </xsl:variable>
  5027. <xsl:variable name="decimal-replacement">
  5028. <xsl:choose>
  5029. <xsl:when test="contains($digits-part,'.')">
  5030. <xsl:choose>
  5031. <xsl:when test="contains($digits-part,' ') and contains(substring-before(substring-after($digits-part,'.'),' '),'#')">true</xsl:when>
  5032. <xsl:when test="contains($digits-part,'E') and contains(substring-before(substring-after($digits-part,'.'),'E'),'#')">true</xsl:when>
  5033. <xsl:when test="contains($digits-part,'e') and contains(substring-before(substring-after($digits-part,'.'),'e'),'#')">true</xsl:when>
  5034. <xsl:otherwise>
  5035. <xsl:choose>
  5036. <xsl:when test="contains(substring-after($digits-part,'.'),'#')">true</xsl:when>
  5037. <xsl:otherwise>false</xsl:otherwise>
  5038. </xsl:choose>
  5039. </xsl:otherwise>
  5040. </xsl:choose>
  5041. </xsl:when>
  5042. <xsl:otherwise>false</xsl:otherwise>
  5043. </xsl:choose>
  5044. </xsl:variable>
  5045. <xsl:variable name="integer-digits">
  5046. <xsl:choose>
  5047. <xsl:when test="contains($digits-part,'.')">
  5048. <xsl:value-of select="string-length(substring-before($digits-part,'.')) - string-length(translate(substring-before($digits-part,'.'),'0',''))"/>
  5049. </xsl:when>
  5050. <xsl:otherwise>
  5051. <xsl:value-of select="string-length($digits-part) - string-length(translate($digits-part,'0',''))"/>
  5052. </xsl:otherwise>
  5053. </xsl:choose>
  5054. </xsl:variable>
  5055. <xsl:variable name="factor-digits">
  5056. <xsl:call-template name="display-factor-digits">
  5057. <xsl:with-param name="digits-part" select="$digits-part"/>
  5058. <xsl:with-param name="count" select="0"/>
  5059. </xsl:call-template>
  5060. </xsl:variable>
  5061. <xsl:variable name="grouping">
  5062. <xsl:choose>
  5063. <xsl:when test="(string-length($digits-part) - string-length(translate($digits-part,',',''))) &gt;$factor-digits">true</xsl:when>
  5064. <xsl:otherwise>false</xsl:otherwise>
  5065. </xsl:choose>
  5066. </xsl:variable>
  5067. <xsl:variable name="exponent-digits">
  5068. <xsl:choose>
  5069. <xsl:when test="contains($digits-part,'E')">
  5070. <xsl:value-of select="string-length(substring-after($digits-part,'E')) -1"/>
  5071. </xsl:when>
  5072. <xsl:when test="contains($digits-part,'e')">
  5073. <xsl:value-of select="string-length(substring-after($digits-part,'e')) -1"/>
  5074. </xsl:when>
  5075. <xsl:otherwise>0</xsl:otherwise>
  5076. </xsl:choose>
  5077. </xsl:variable>
  5078. <xsl:variable name="numerator-digits">
  5079. <xsl:choose>
  5080. <xsl:when test="contains($digits-part,' ')">
  5081. <xsl:value-of select="string-length(substring-before(substring-after($digits-part,' '),'/'))"/>
  5082. </xsl:when>
  5083. <xsl:otherwise>0</xsl:otherwise>
  5084. </xsl:choose>
  5085. </xsl:variable>
  5086. <xsl:variable name="denominator-digits">
  5087. <xsl:choose>
  5088. <xsl:when test="contains($digits-part,' ')">
  5089. <xsl:value-of select="string-length(substring-after(substring-after($digits-part,' '),'/'))"/>
  5090. </xsl:when>
  5091. <xsl:otherwise>0</xsl:otherwise>
  5092. </xsl:choose>
  5093. </xsl:variable>
  5094. <xsl:variable name="number-type">
  5095. <xsl:choose>
  5096. <xsl:when test="$exponent-digits &gt;0">number:scientific-number</xsl:when>
  5097. <xsl:when test="($numerator-digits &gt;0) or ($denominator-digits &gt;0)">number:fraction</xsl:when>
  5098. <xsl:otherwise>number:number</xsl:otherwise>
  5099. </xsl:choose>
  5100. </xsl:variable>
  5101. <xsl:element name="{$number-type}">
  5102. <xsl:if test="$decimal-digits &gt;=0">
  5103. <xsl:attribute name="number:decimal-places"><xsl:value-of select="$decimal-digits"/></xsl:attribute>
  5104. </xsl:if>
  5105. <xsl:if test="$decimal-replacement='true'">
  5106. <xsl:attribute name="number:decimal-replacement"/>
  5107. </xsl:if>
  5108. <xsl:if test="$integer-digits &gt;=0">
  5109. <xsl:attribute name="number:min-integer-digits"><xsl:value-of select="$integer-digits"/></xsl:attribute>
  5110. </xsl:if>
  5111. <xsl:if test="$grouping='true'">
  5112. <xsl:attribute name="number:grouping"><xsl:value-of select="$grouping"/></xsl:attribute>
  5113. </xsl:if>
  5114. <xsl:if test="$factor-digits &gt;0">
  5115. <xsl:attribute name="number:display-factor"><xsl:choose><xsl:when test="$factor-digits=1">1000</xsl:when><xsl:when test="$factor-digits=2">1000000</xsl:when><xsl:when test="$factor-digits=3">1000000000</xsl:when><xsl:when test="$factor-digits=4">1000000000000</xsl:when><xsl:when test="$factor-digits=5">1000000000000000</xsl:when><xsl:when test="$factor-digits=6">1000000000000000000</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
  5116. </xsl:if>
  5117. <xsl:if test="$exponent-digits &gt;0">
  5118. <xsl:attribute name="number:min-exponent-digits"><xsl:value-of select="$exponent-digits"/></xsl:attribute>
  5119. </xsl:if>
  5120. <xsl:if test="$numerator-digits &gt;0">
  5121. <xsl:attribute name="number:min-numerator-digits"><xsl:value-of select="$numerator-digits"/></xsl:attribute>
  5122. </xsl:if>
  5123. <xsl:if test="$denominator-digits &gt;0">
  5124. <xsl:attribute name="number:min-denominator-digits"><xsl:value-of select="$denominator-digits"/></xsl:attribute>
  5125. </xsl:if>
  5126. </xsl:element>
  5127. </xsl:template>
  5128. <xsl:template name="number-format-color">
  5129. <xsl:param name="number-format-unit"/>
  5130. <xsl:choose>
  5131. <xsl:when test="starts-with($number-format-unit,'[Black]')">
  5132. <style:text-properties fo:color="#000000"/>
  5133. </xsl:when>
  5134. <xsl:when test="starts-with($number-format-unit,'[Blue]')">
  5135. <style:text-properties fo:color="#0000ff"/>
  5136. </xsl:when>
  5137. <xsl:when test="starts-with($number-format-unit,'[Cyan]')">
  5138. <style:text-properties fo:color="#00ffff"/>
  5139. </xsl:when>
  5140. <xsl:when test="starts-with($number-format-unit,'[Green]')">
  5141. <style:text-properties fo:color="#00ff00"/>
  5142. </xsl:when>
  5143. <xsl:when test="starts-with($number-format-unit,'[Magenta]')">
  5144. <style:text-properties fo:color="#ff00ff"/>
  5145. </xsl:when>
  5146. <xsl:when test="starts-with($number-format-unit,'[Red]')">
  5147. <style:text-properties fo:color="#ff0000"/>
  5148. </xsl:when>
  5149. <xsl:when test="starts-with($number-format-unit,'[White]')">
  5150. <style:text-properties fo:color="#ffffff"/>
  5151. </xsl:when>
  5152. <xsl:when test="starts-with($number-format-unit,'[Yellow]')">
  5153. <style:text-properties fo:color="#ffff00"/>
  5154. </xsl:when>
  5155. </xsl:choose>
  5156. <xsl:variable name="unit-length">
  5157. <xsl:choose>
  5158. <xsl:when test="starts-with($number-format-unit,'[Black]')">8</xsl:when>
  5159. <xsl:when test="starts-with($number-format-unit,'[Blue]')">7</xsl:when>
  5160. <xsl:when test="starts-with($number-format-unit,'[Cyan]')">7</xsl:when>
  5161. <xsl:when test="starts-with($number-format-unit,'[Green]')">8</xsl:when>
  5162. <xsl:when test="starts-with($number-format-unit,'[Magenta]')">10</xsl:when>
  5163. <xsl:when test="starts-with($number-format-unit,'[Red]')">6</xsl:when>
  5164. <xsl:when test="starts-with($number-format-unit,'[White]')">8</xsl:when>
  5165. <xsl:when test="starts-with($number-format-unit,'[Yellow]')">9</xsl:when>
  5166. <xsl:otherwise>1</xsl:otherwise>
  5167. </xsl:choose>
  5168. </xsl:variable>
  5169. <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
  5170. <xsl:call-template name="general-number">
  5171. <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
  5172. </xsl:call-template>
  5173. </xsl:if>
  5174. </xsl:template>
  5175. <xsl:template name="number-format-currency">
  5176. <xsl:param name="number-format-unit"/>
  5177. <xsl:choose>
  5178. <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">
  5179. <number:currency-symbol number:language="zh" number:country="CN">¥</number:currency-symbol>
  5180. </xsl:when>
  5181. <xsl:when test="starts-with($number-format-unit,'[$$-409]')">
  5182. <number:currency-symbol number:language="en" number:country="US">$</number:currency-symbol>
  5183. </xsl:when>
  5184. <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">
  5185. <number:currency-symbol number:language="es" number:country="AR">$</number:currency-symbol>
  5186. </xsl:when>
  5187. <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">
  5188. <number:currency-symbol number:language="fr" number:country="CA">$</number:currency-symbol>
  5189. </xsl:when>
  5190. <xsl:when test="starts-with($number-format-unit,'[$CNY]')">
  5191. <number:currency-symbol>CNY</number:currency-symbol>
  5192. </xsl:when>
  5193. <xsl:when test="starts-with($number-format-unit,'[$AFA]')">
  5194. <number:currency-symbol>AFA</number:currency-symbol>
  5195. </xsl:when>
  5196. <xsl:when test="starts-with($number-format-unit,'CNY')">
  5197. <number:currency-symbol>CNY</number:currency-symbol>
  5198. </xsl:when>
  5199. <xsl:when test="starts-with($number-format-unit,'CCC')">
  5200. <number:currency-symbol>CCC</number:currency-symbol>
  5201. </xsl:when>
  5202. </xsl:choose>
  5203. <xsl:variable name="unit-length">
  5204. <xsl:choose>
  5205. <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">9</xsl:when>
  5206. <xsl:when test="starts-with($number-format-unit,'[$$-409]')">9</xsl:when>
  5207. <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">10</xsl:when>
  5208. <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">9</xsl:when>
  5209. <xsl:when test="starts-with($number-format-unit,'[$CNY]')">7</xsl:when>
  5210. <xsl:when test="starts-with($number-format-unit,'[$AFA]')">7</xsl:when>
  5211. <xsl:when test="starts-with($number-format-unit,'CNY')">4</xsl:when>
  5212. <xsl:when test="starts-with($number-format-unit,'CCC')">4</xsl:when>
  5213. <xsl:otherwise>1</xsl:otherwise>
  5214. </xsl:choose>
  5215. </xsl:variable>
  5216. <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
  5217. <xsl:call-template name="general-number">
  5218. <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
  5219. </xsl:call-template>
  5220. </xsl:if>
  5221. </xsl:template>
  5222. <xsl:template name="display-factor-digits">
  5223. <xsl:param name="digits-part"/>
  5224. <xsl:param name="count"/>
  5225. <xsl:choose>
  5226. <xsl:when test="not(substring($digits-part,string-length($digits-part),1) =',')">
  5227. <xsl:value-of select="$count"/>
  5228. </xsl:when>
  5229. <xsl:otherwise>
  5230. <xsl:call-template name="display-factor-digits">
  5231. <xsl:with-param name="digits-part" select="substring($digits-part,1,string-length($digits-part) -1)"/>
  5232. <xsl:with-param name="count" select="$count +1"/>
  5233. </xsl:call-template>
  5234. </xsl:otherwise>
  5235. </xsl:choose>
  5236. </xsl:template>
  5237. <xsl:template name="element-attribute">
  5238. <xsl:param name="number-format-unit"/>
  5239. <xsl:if test="contains($number-format-unit,'[HH]')">
  5240. <xsl:attribute name="number:truncate-on-overflow">false</xsl:attribute>
  5241. </xsl:if>
  5242. <xsl:if test="starts-with($number-format-unit,'[NatNum1]')">
  5243. <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
  5244. <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
  5245. </xsl:if>
  5246. <xsl:if test="starts-with($number-format-unit,'[NatNum2]')">
  5247. <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
  5248. <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
  5249. </xsl:if>
  5250. <xsl:if test="starts-with($number-format-unit,'[NatNum3]')">
  5251. <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
  5252. <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
  5253. </xsl:if>
  5254. <xsl:if test="starts-with($number-format-unit,'[NatNum4]')">
  5255. <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
  5256. <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
  5257. </xsl:if>
  5258. <xsl:if test="starts-with($number-format-unit,'[NatNum5]')">
  5259. <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
  5260. <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
  5261. </xsl:if>
  5262. <xsl:if test="starts-with($number-format-unit,'[NatNum6]')">
  5263. <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
  5264. <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
  5265. </xsl:if>
  5266. <xsl:if test="starts-with($number-format-unit,'[NatNum7]')">
  5267. <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
  5268. <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
  5269. </xsl:if>
  5270. <xsl:if test="starts-with($number-format-unit,'[NatNum8]')">
  5271. <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
  5272. <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
  5273. </xsl:if>
  5274. <xsl:if test="starts-with($number-format-unit,'[NatNum0]')">
  5275. <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
  5276. <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
  5277. </xsl:if>
  5278. <xsl:if test="contains($number-format-unit,'[$-804]')">
  5279. <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
  5280. <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
  5281. </xsl:if>
  5282. </xsl:template>
  5283. <xsl:key name="pz" match="/uof:UOF/uof:对象集/图:图形" use="@图:标识符"/>
  5284. <xsl:template match="表:批注" mode="body">
  5285. <xsl:element name="office:annotation">
  5286. <xsl:if test="@表:是否显示 = 'true'">
  5287. <xsl:attribute name="office:display">true</xsl:attribute>
  5288. </xsl:if>
  5289. <xsl:attribute name="draw:style-name"><xsl:value-of select="uof:锚点/@uof:图形引用"/></xsl:attribute>
  5290. <xsl:attribute name="svg:height"><xsl:value-of select="concat(uof:锚点/@uof:高度,$uofUnit)"/></xsl:attribute>
  5291. <xsl:attribute name="svg:x"><xsl:value-of select="concat(uof:锚点/@uof:x坐标,$uofUnit)"/></xsl:attribute>
  5292. <xsl:attribute name="svg:y"><xsl:value-of select="concat(uof:锚点/@uof:y坐标,$uofUnit)"/></xsl:attribute>
  5293. <xsl:attribute name="svg:width"><xsl:value-of select="concat(uof:锚点/@uof:宽度,$uofUnit)"/></xsl:attribute>
  5294. <xsl:variable name="w">
  5295. <xsl:value-of select="./uof:锚点/@uof:图形引用"/>
  5296. </xsl:variable>
  5297. <xsl:choose>
  5298. <xsl:when test="key('pz',$w)/图:文本内容/字:句/字:文本串">
  5299. <text:p>
  5300. <xsl:for-each select="key('pz',$w)/图:文本内容/字:句">
  5301. <text:span>
  5302. <xsl:if test="字:句属性/@字:式样引用">
  5303. <xsl:attribute name="text:style-name"><xsl:value-of select="字:句属性/@字:式样引用"/></xsl:attribute>
  5304. </xsl:if>
  5305. <xsl:value-of select="字:文本串"/>
  5306. </text:span>
  5307. </xsl:for-each>
  5308. </text:p>
  5309. </xsl:when>
  5310. </xsl:choose>
  5311. <!--xsl:if test="图:文本内容/字:段落/字:句/字:文本串">
  5312. <text:p>
  5313. <xsl:call-template name="create-comment-data-content">
  5314. <xsl:with-param name="style-id" select="../@表:式样引用"/>
  5315. </xsl:call-template>
  5316. </text:p>
  5317. </xsl:if-->
  5318. </xsl:element>
  5319. </xsl:template>
  5320. <xsl:template name="auto-filter-condition">
  5321. <xsl:param name="condition-set"/>
  5322. <xsl:param name="zone-left-column-num"/>
  5323. <xsl:if test="$condition-set">
  5324. <xsl:variable name="first-condition" select="$condition-set[1]"/>
  5325. <xsl:element name="table:filter-condition">
  5326. <xsl:attribute name="table:field-number"><xsl:value-of select="$first-condition/@表:列号 - $zone-left-column-num"/></xsl:attribute>
  5327. <xsl:attribute name="office:value"><xsl:choose><xsl:when test="$first-condition/表:普通"><xsl:value-of select="$first-condition/表:普通/@表:值"/></xsl:when><xsl:when test="$first-condition/表:自定义"><xsl:value-of select="$first-condition/表:自定义/表:操作条件/表:值"/></xsl:when></xsl:choose></xsl:attribute>
  5328. <xsl:variable name="operator">
  5329. <xsl:choose>
  5330. <xsl:when test="$first-condition/表:普通">
  5331. <xsl:variable name="general" select="$first-condition/表:普通/@表:类型"/>
  5332. <xsl:choose>
  5333. <xsl:when test="$general ='topitem'">top values</xsl:when>
  5334. </xsl:choose>
  5335. </xsl:when>
  5336. <xsl:when test="$first-condition/表:自定义">
  5337. <xsl:variable name="operator-text" select="$first-condition/表:自定义/表:操作条件/表:操作码/text()"/>
  5338. <xsl:choose>
  5339. <xsl:when test="$operator-text ='less than'">&lt;</xsl:when>
  5340. <xsl:when test="$operator-text ='greater than'">&gt;</xsl:when>
  5341. <xsl:when test="$operator-text ='equal to'">
  5342. <xsl:value-of select="'='"/>
  5343. </xsl:when>
  5344. <xsl:when test="$operator-text ='greater than or equal to'">
  5345. <xsl:value-of select="'&gt;='"/>
  5346. </xsl:when>
  5347. <xsl:when test="$operator-text ='less than or equal to'">
  5348. <xsl:value-of select="'&lt;='"/>
  5349. </xsl:when>
  5350. <xsl:when test="$operator-text ='not equal to'">
  5351. <xsl:value-of select="'!='"/>
  5352. </xsl:when>
  5353. </xsl:choose>
  5354. </xsl:when>
  5355. </xsl:choose>
  5356. </xsl:variable>
  5357. <xsl:attribute name="table:operator"><xsl:value-of select="$operator"/></xsl:attribute>
  5358. </xsl:element>
  5359. <xsl:call-template name="auto-filter-condition">
  5360. <xsl:with-param name="condition-set" select="$condition-set[position()!=1]"/>
  5361. <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
  5362. </xsl:call-template>
  5363. </xsl:if>
  5364. </xsl:template>
  5365. <xsl:template name="translate-column-char-to-number">
  5366. <xsl:param name="string"/>
  5367. <xsl:choose>
  5368. <xsl:when test="string-length($string)=1">
  5369. <xsl:call-template name="char-to-number">
  5370. <xsl:with-param name="char" select="$string"/>
  5371. </xsl:call-template>
  5372. </xsl:when>
  5373. <xsl:otherwise>
  5374. <xsl:variable name="tens-place">
  5375. <xsl:call-template name="char-to-number">
  5376. <xsl:with-param name="char" select="substring($string,1,1)"/>
  5377. </xsl:call-template>
  5378. </xsl:variable>
  5379. <xsl:variable name="units-place">
  5380. <xsl:call-template name="char-to-number">
  5381. <xsl:with-param name="char" select="substring($string,2,1)"/>
  5382. </xsl:call-template>
  5383. </xsl:variable>
  5384. <xsl:value-of select="$tens-place * 26 + $units-place"/>
  5385. </xsl:otherwise>
  5386. </xsl:choose>
  5387. </xsl:template>
  5388. <xsl:template name="char-to-number">
  5389. <xsl:param name="char"/>
  5390. <xsl:choose>
  5391. <xsl:when test="$char='A'">1</xsl:when>
  5392. <xsl:when test="$char='B'">2</xsl:when>
  5393. <xsl:when test="$char='C'">3</xsl:when>
  5394. <xsl:when test="$char='D'">4</xsl:when>
  5395. <xsl:when test="$char='E'">5</xsl:when>
  5396. <xsl:when test="$char='F'">6</xsl:when>
  5397. <xsl:when test="$char='G'">7</xsl:when>
  5398. <xsl:when test="$char='H'">8</xsl:when>
  5399. <xsl:when test="$char='I'">9</xsl:when>
  5400. <xsl:when test="$char='J'">10</xsl:when>
  5401. <xsl:when test="$char='K'">11</xsl:when>
  5402. <xsl:when test="$char='L'">12</xsl:when>
  5403. <xsl:when test="$char='M'">13</xsl:when>
  5404. <xsl:when test="$char='N'">14</xsl:when>
  5405. <xsl:when test="$char='O'">15</xsl:when>
  5406. <xsl:when test="$char='P'">16</xsl:when>
  5407. <xsl:when test="$char='Q'">17</xsl:when>
  5408. <xsl:when test="$char='R'">18</xsl:when>
  5409. <xsl:when test="$char='S'">19</xsl:when>
  5410. <xsl:when test="$char='T'">20</xsl:when>
  5411. <xsl:when test="$char='U'">21</xsl:when>
  5412. <xsl:when test="$char='V'">22</xsl:when>
  5413. <xsl:when test="$char='W'">23</xsl:when>
  5414. <xsl:when test="$char='X'">24</xsl:when>
  5415. <xsl:when test="$char='Y'">25</xsl:when>
  5416. <xsl:when test="$char='Z'">26</xsl:when>
  5417. </xsl:choose>
  5418. </xsl:template>
  5419. <xsl:template name="translate-expression2">
  5420. <xsl:param name="expression2"/>
  5421. <xsl:choose>
  5422. <xsl:when test="contains($expression2,':')">
  5423. <xsl:variable name="column-one">
  5424. <xsl:value-of select="substring(substring-before($expression2,':'),1,1)"/>
  5425. </xsl:variable>
  5426. <xsl:variable name="row-one">
  5427. <xsl:value-of select="substring(substring-before($expression2,':'),2)"/>
  5428. </xsl:variable>
  5429. <xsl:variable name="column-two">
  5430. <xsl:value-of select="substring(substring-after($expression2,':'),1,1)"/>
  5431. </xsl:variable>
  5432. <xsl:variable name="row-two">
  5433. <xsl:value-of select="substring(substring-after($expression2,':'),2)"/>
  5434. </xsl:variable>
  5435. <xsl:variable name="column-value1">
  5436. <xsl:call-template name="character-to-column">
  5437. <xsl:with-param name="column-value" select="$column-one"/>
  5438. </xsl:call-template>
  5439. </xsl:variable>
  5440. <xsl:variable name="column-value2">
  5441. <xsl:call-template name="character-to-column">
  5442. <xsl:with-param name="column-value" select="$column-two"/>
  5443. </xsl:call-template>
  5444. </xsl:variable>
  5445. <xsl:value-of select="concat('R',$row-one,'C',$column-value1,':','R',$row-two,'C',$column-value2)"/>
  5446. </xsl:when>
  5447. <xsl:otherwise>
  5448. <xsl:variable name="column-one">
  5449. <xsl:value-of select="substring($expression2,1,1)"/>
  5450. </xsl:variable>
  5451. <xsl:variable name="row-one">
  5452. <xsl:value-of select="substring($expression2,2)"/>
  5453. </xsl:variable>
  5454. <xsl:variable name="column-value1">
  5455. <xsl:call-template name="character-to-column">
  5456. <xsl:with-param name="column-value" select="$column-one"/>
  5457. </xsl:call-template>
  5458. </xsl:variable>
  5459. <xsl:value-of select="concat('R',$row-one,'C',$column-value1)"/>
  5460. </xsl:otherwise>
  5461. </xsl:choose>
  5462. </xsl:template>
  5463. <xsl:template name="character-to-column">
  5464. <xsl:param name="column-value"/>
  5465. <xsl:choose>
  5466. <xsl:when test="$column-value= 'A'">1</xsl:when>
  5467. <xsl:when test="$column-value= 'B'">2</xsl:when>
  5468. <xsl:when test="$column-value= 'C'">3</xsl:when>
  5469. <xsl:when test="$column-value= 'D'">4</xsl:when>
  5470. <xsl:when test="$column-value= 'E'">5</xsl:when>
  5471. <xsl:when test="$column-value= 'F'">6</xsl:when>
  5472. <xsl:when test="$column-value= 'G'">7</xsl:when>
  5473. <xsl:when test="$column-value= 'H'">8</xsl:when>
  5474. <xsl:when test="$column-value= 'I'">9</xsl:when>
  5475. <xsl:when test="$column-value= 'J'">10</xsl:when>
  5476. <xsl:when test="$column-value= 'K'">11</xsl:when>
  5477. <xsl:when test="$column-value= 'L'">12</xsl:when>
  5478. <xsl:when test="$column-value= 'M'">13</xsl:when>
  5479. <xsl:when test="$column-value= 'N'">14</xsl:when>
  5480. <xsl:when test="$column-value= 'O'">15</xsl:when>
  5481. <xsl:when test="$column-value= 'P'">16</xsl:when>
  5482. <xsl:when test="$column-value= 'Q'">17</xsl:when>
  5483. <xsl:when test="$column-value= 'R'">18</xsl:when>
  5484. <xsl:when test="$column-value= 'S'">19</xsl:when>
  5485. <xsl:when test="$column-value= 'T'">20</xsl:when>
  5486. <xsl:when test="$column-value= 'U'">21</xsl:when>
  5487. <xsl:when test="$column-value= 'V'">22</xsl:when>
  5488. <xsl:when test="$column-value= 'W'">23</xsl:when>
  5489. <xsl:when test="$column-value= 'X'">24</xsl:when>
  5490. <xsl:when test="$column-value= 'Y'">25</xsl:when>
  5491. <xsl:when test="$column-value= 'Z'">26</xsl:when>
  5492. <xsl:otherwise/>
  5493. </xsl:choose>
  5494. </xsl:template>
  5495. <!--chenjh end 20050611-->
  5496. <xsl:template name="工作表属性">
  5497. <!--office:settings-->
  5498. <xsl:variable name="sheetprop" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
  5499. <config:config-item-set config:name="ooo:view-settings">
  5500. <xsl:variable name="ratio" select="15"/>
  5501. <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/表:数据/字:句/字:修订开始">
  5502. <config:config-item-set config:name="TrackedChangesViewSettings">
  5503. <config:config-item config:name="ShowChanges" config:type="boolean">true</config:config-item>
  5504. <config:config-item config:name="ShowAcceptedChanges" config:type="boolean">false</config:config-item>
  5505. <config:config-item config:name="ShowRejectedChanges" config:type="boolean">false</config:config-item>
  5506. <config:config-item config:name="ShowChangesByDatetime" config:type="boolean">false</config:config-item>
  5507. <config:config-item config:name="ShowChangesByDatetimeMode" config:type="short">0</config:config-item>
  5508. <config:config-item config:name="ShowChangesByDatetimeFirstDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
  5509. <config:config-item config:name="ShowChangesByDatetimeSecondDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
  5510. <config:config-item config:name="ShowChangesByAuthor" config:type="boolean">false</config:config-item>
  5511. <config:config-item config:name="ShowChangesByAuthorName" config:type="string"/>
  5512. <config:config-item config:name="ShowChangesByComment" config:type="boolean">false</config:config-item>
  5513. <config:config-item config:name="ShowChangesByCommentText" config:type="string"/>
  5514. <config:config-item config:name="ShowChangesByRanges" config:type="boolean">false</config:config-item>
  5515. <config:config-item config:name="ShowChangesByRangesList" config:type="string"/>
  5516. </config:config-item-set>
  5517. </xsl:if>
  5518. <config:config-item-map-indexed config:name="Views">
  5519. <config:config-item-map-entry>
  5520. <config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
  5521. <config:config-item-map-named config:name="Tables">
  5522. <xsl:for-each select="$sheetprop/表:工作表属性/表:视图">
  5523. <xsl:element name="config:config-item-map-entry">
  5524. <xsl:attribute name="config:name"><xsl:value-of select="ancestor::表:工作表/@表:名称"/></xsl:attribute>
  5525. <xsl:element name="config:config-item">
  5526. <xsl:attribute name="config:name">HorizontalSplitMode</xsl:attribute>
  5527. <xsl:attribute name="config:type">short</xsl:attribute>
  5528. <xsl:choose>
  5529. <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">2</xsl:when>
  5530. <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
  5531. <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">1</xsl:when>
  5532. <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
  5533. </xsl:choose>
  5534. </xsl:element>
  5535. <xsl:element name="config:config-item">
  5536. <xsl:attribute name="config:name">VerticalSplitMode</xsl:attribute>
  5537. <xsl:attribute name="config:type">short</xsl:attribute>
  5538. <xsl:choose>
  5539. <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">2</xsl:when>
  5540. <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
  5541. <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">1</xsl:when>
  5542. <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
  5543. </xsl:choose>
  5544. </xsl:element>
  5545. <xsl:element name="config:config-item">
  5546. <xsl:attribute name="config:name">HorizontalSplitPosition</xsl:attribute>
  5547. <xsl:attribute name="config:type">int</xsl:attribute>
  5548. <xsl:choose>
  5549. <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
  5550. <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">
  5551. <xsl:value-of select="表:冻结/@表:列号"/>
  5552. </xsl:when>
  5553. <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
  5554. <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">
  5555. <xsl:value-of select="表:拆分/@表:宽度"/>
  5556. </xsl:when>
  5557. </xsl:choose>
  5558. </xsl:element>
  5559. <xsl:element name="config:config-item">
  5560. <xsl:attribute name="config:name">VerticalSplitPosition</xsl:attribute>
  5561. <xsl:attribute name="config:type">int</xsl:attribute>
  5562. <xsl:choose>
  5563. <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
  5564. <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">
  5565. <xsl:value-of select="表:冻结/@表:行号"/>
  5566. </xsl:when>
  5567. <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
  5568. <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">
  5569. <xsl:value-of select="表:拆分/@表:高度"/>
  5570. </xsl:when>
  5571. </xsl:choose>
  5572. </xsl:element>
  5573. <xsl:variable name="position-top">
  5574. <xsl:choose>
  5575. <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最上行">
  5576. <xsl:value-of select="//表:工作表属性/表:视图/表:最上行"/>
  5577. </xsl:when>
  5578. <xsl:otherwise>0</xsl:otherwise>
  5579. </xsl:choose>
  5580. </xsl:variable>
  5581. <xsl:variable name="position-left">
  5582. <xsl:choose>
  5583. <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最左列">
  5584. <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:最左列"/>
  5585. </xsl:when>
  5586. <xsl:otherwise>0</xsl:otherwise>
  5587. </xsl:choose>
  5588. </xsl:variable>
  5589. <config:config-item config:name="PositionRight" config:type="int">
  5590. <xsl:value-of select="$position-left"/>
  5591. </config:config-item>
  5592. <config:config-item config:name="PositionBottom" config:type="int">
  5593. <xsl:value-of select="$position-top"/>
  5594. </config:config-item>
  5595. </xsl:element>
  5596. </xsl:for-each>
  5597. </config:config-item-map-named>
  5598. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:当前视图">
  5599. <xsl:element name="config:config-item">
  5600. <xsl:attribute name="config:name">ShowPageBreakPreview</xsl:attribute>
  5601. <xsl:attribute name="config:type">boolean</xsl:attribute>
  5602. <xsl:choose>
  5603. <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:当前视图/@表:类型='normal'">false</xsl:when>
  5604. <xsl:otherwise>true</xsl:otherwise>
  5605. </xsl:choose>
  5606. </xsl:element>
  5607. </xsl:if>
  5608. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格">
  5609. <xsl:element name="config:config-item">
  5610. <xsl:attribute name="config:name">ShowGrid</xsl:attribute>
  5611. <xsl:attribute name="config:type">boolean</xsl:attribute>
  5612. <xsl:choose>
  5613. <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:网格/@表:值=1 or $sheetprop/表:工作表属性/表:视图/表:网格/@表:值='true'">true</xsl:when>
  5614. <xsl:otherwise>false</xsl:otherwise>
  5615. </xsl:choose>
  5616. </xsl:element>
  5617. </xsl:if>
  5618. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格颜色">
  5619. <xsl:element name="config:config-item">
  5620. <xsl:attribute name="config:name">GridColor</xsl:attribute>
  5621. <xsl:attribute name="config:type">long</xsl:attribute>
  5622. <xsl:call-template name="transform-hex-to-decimal">
  5623. <xsl:with-param name="number" select="//表:视图/表:网格颜色/text()"/>
  5624. </xsl:call-template>
  5625. </xsl:element>
  5626. </xsl:if>
  5627. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:选中">
  5628. <xsl:element name="config:config-item">
  5629. <xsl:attribute name="config:name">ActiveTable</xsl:attribute>
  5630. <xsl:attribute name="config:type">string</xsl:attribute>
  5631. <xsl:value-of select="$sheetprop/表:工作表属性/表:视图[表:选中]/ancestor::表:工作表/@表:名称"/>
  5632. </xsl:element>
  5633. </xsl:if>
  5634. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:缩放">
  5635. <config:config-item config:name="ZoomValue" config:type="int">
  5636. <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:缩放/text()"/>
  5637. </config:config-item>
  5638. </xsl:if>
  5639. <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:分页缩放">
  5640. <config:config-item config:name="PageViewZoomValue" config:type="int">
  5641. <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:分页缩放/text()"/>
  5642. </config:config-item>
  5643. </xsl:if>
  5644. </config:config-item-map-entry>
  5645. </config:config-item-map-indexed>
  5646. </config:config-item-set>
  5647. </xsl:template>
  5648. <xsl:template name="create-page-master">
  5649. <xsl:param name="worksheetoptions"/>
  5650. <xsl:for-each select="$worksheetoptions">
  5651. <xsl:element name="style:page-layout">
  5652. <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
  5653. <xsl:element name="style:page-layout-properties">
  5654. <xsl:if test="表:页面设置/表:纸张/@uof:宽度">
  5655. <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
  5656. </xsl:if>
  5657. <xsl:if test="表:页面设置/表:纸张/@uof:高度">
  5658. <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
  5659. </xsl:if>
  5660. <xsl:if test="表:页面设置/表:纸张方向">
  5661. <xsl:attribute name="style:print-orientation"><xsl:value-of select="表:页面设置/表:纸张方向"/></xsl:attribute>
  5662. </xsl:if>
  5663. <xsl:if test="表:页面设置/表:缩放">
  5664. <xsl:attribute name="style:scale-to"><xsl:value-of select="concat(表:页面设置/表:缩放,'%')"/></xsl:attribute>
  5665. </xsl:if>
  5666. <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景">
  5667. <xsl:attribute name="fo:background-color"><xsl:value-of select="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景"/></xsl:attribute>
  5668. </xsl:if>
  5669. <xsl:attribute name="style:first-page-number">continue</xsl:attribute>
  5670. <xsl:if test="表:页面设置/表:页边距">
  5671. <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
  5672. <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
  5673. <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
  5674. <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
  5675. </xsl:if>
  5676. <xsl:if test="表:页面设置/表:打印/@表:先列后行='true'">
  5677. <xsl:attribute name="style:print-page-order">ltr</xsl:attribute>
  5678. </xsl:if>
  5679. <xsl:if test="表:页面设置/表:垂直对齐/@表:对齐方式">
  5680. <xsl:attribute name="style:table-centering">vertical</xsl:attribute>
  5681. </xsl:if>
  5682. <xsl:if test="表:页面设置/表:水平对齐/@表:对齐方式">
  5683. <xsl:attribute name="style:table-centering">horizontal</xsl:attribute>
  5684. </xsl:if>
  5685. </xsl:element>
  5686. <xsl:element name="style:header-style">
  5687. <xsl:element name="style:header-footer-properties">
  5688. <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
  5689. <xsl:choose>
  5690. <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
  5691. <xsl:attribute name="fo:margin-bottom"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  5692. </xsl:when>
  5693. <xsl:otherwise>
  5694. <xsl:attribute name="fo:margin-bottom">0.25cm</xsl:attribute>
  5695. </xsl:otherwise>
  5696. </xsl:choose>
  5697. </xsl:element>
  5698. </xsl:element>
  5699. <xsl:element name="style:footer-style">
  5700. <xsl:element name="style:header-footer-properties">
  5701. <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
  5702. <xsl:choose>
  5703. <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
  5704. <xsl:attribute name="fo:margin-top"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
  5705. </xsl:when>
  5706. <xsl:otherwise>
  5707. <xsl:attribute name="fo:margin-top">0.25cm</xsl:attribute>
  5708. </xsl:otherwise>
  5709. </xsl:choose>
  5710. </xsl:element>
  5711. </xsl:element>
  5712. </xsl:element>
  5713. </xsl:for-each>
  5714. </xsl:template>
  5715. <xsl:template match="字:文本串">
  5716. <xsl:value-of select="text()"/>
  5717. </xsl:template>
  5718. <xsl:template match="字:换行符">
  5719. <xsl:element name="text:line-break"/>
  5720. </xsl:template>
  5721. <xsl:template match="字:制表符">
  5722. <xsl:element name="text:tab-stop"/>
  5723. </xsl:template>
  5724. <xsl:template match="字:区域开始">
  5725. <xsl:if test="@字:类型='hyperlink'">
  5726. <xsl:variable name="superlink" select="//uof:超级链接[@uof:标识符=current()/@字:标识符]"/>
  5727. <xsl:element name="text:a">
  5728. <xsl:attribute name="xlink:href"><xsl:value-of select="$superlink/@uof:目标"/></xsl:attribute>
  5729. <xsl:value-of select="$superlink/@uof:提示"/>
  5730. </xsl:element>
  5731. </xsl:if>
  5732. </xsl:template>
  5733. <xsl:template match="字:空格符">
  5734. <xsl:element name="text:s">
  5735. <xsl:if test="@字:个数">
  5736. <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
  5737. </xsl:if>
  5738. </xsl:element>
  5739. </xsl:template>
  5740. <xsl:template name="create-page-header-footer-text-p">
  5741. <xsl:param name="paragragh-set"/>
  5742. <xsl:choose>
  5743. <xsl:when test="$paragragh-set">
  5744. <xsl:element name="text:p">
  5745. <xsl:for-each select="$paragragh-set[1]/字:句">
  5746. <xsl:choose>
  5747. <xsl:when test="not(字:句属性)">
  5748. <xsl:apply-templates select="字:文本串 | 字:空格符 | 字:换行符"/>
  5749. </xsl:when>
  5750. <xsl:when test="字:句属性">
  5751. <xsl:element name="text:span">
  5752. <xsl:attribute name="text:style-name"><xsl:value-of select="//uof:句式样[@字:标识符=current()/字:句属性/@字:式样引用]/@字:名称"/></xsl:attribute>
  5753. <xsl:apply-templates select="字:空格符 | 字:文本串 | 字:换行符 | 字:制表符"/>
  5754. </xsl:element>
  5755. </xsl:when>
  5756. </xsl:choose>
  5757. </xsl:for-each>
  5758. </xsl:element>
  5759. <xsl:call-template name="create-page-header-footer-text-p">
  5760. <xsl:with-param name="paragragh-set" select="$paragragh-set[position()!=1]"/>
  5761. </xsl:call-template>
  5762. </xsl:when>
  5763. <xsl:otherwise/>
  5764. </xsl:choose>
  5765. </xsl:template>
  5766. <!--Redoffice comment lilliang SC0016 06.02.16 -->
  5767. <!--新增内容-->
  5768. <xsl:template match="字:段落">
  5769. <xsl:element name="text:p">
  5770. <xsl:choose>
  5771. <xsl:when test="字:段落属性">
  5772. <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/></xsl:attribute>
  5773. </xsl:when>
  5774. <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
  5775. <!-- create the leading paragraph style name in one section for master page style application, glu -->
  5776. <xsl:variable name="paragraph-number">
  5777. <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
  5778. </xsl:variable>
  5779. <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
  5780. </xsl:when>
  5781. <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
  5782. <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
  5783. </xsl:when>
  5784. <xsl:when test="字:句">
  5785. <xsl:apply-templates select="字:句/字:文本串"/>
  5786. </xsl:when>
  5787. </xsl:choose>
  5788. </xsl:element>
  5789. </xsl:template>
  5790. <!--Redoffice comment liliang end 06.02.16-->
  5791. <xsl:template name="create-master-styles">
  5792. <xsl:param name="worksheetoptions"/>
  5793. <xsl:for-each select="$worksheetoptions">
  5794. <xsl:element name="style:master-page">
  5795. <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
  5796. <!--xsl:attribute name="style:page-layout-name"-->
  5797. <xsl:attribute name="style:page-layout-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
  5798. <xsl:attribute name="style:display-name"><xsl:value-of select="concat( 'PageStyle_', ../@表:名称)"/></xsl:attribute>
  5799. <style:header>
  5800. <xsl:for-each select="表:页面设置/表:页眉页脚">
  5801. <xsl:variable name="temp" select="@表:位置"/>
  5802. <xsl:choose>
  5803. <xsl:when test="contains($temp,'header')">
  5804. <xsl:if test="字:段落">
  5805. <xsl:choose>
  5806. <xsl:when test="@表:位置='headerleft'">
  5807. <xsl:element name="style:region-left">
  5808. <xsl:call-template name="create-page-header-footer-text-p">
  5809. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5810. </xsl:call-template>
  5811. </xsl:element>
  5812. </xsl:when>
  5813. <xsl:when test="@表:位置='headercenter'">
  5814. <xsl:element name="style:region-center">
  5815. <xsl:call-template name="create-page-header-footer-text-p">
  5816. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5817. </xsl:call-template>
  5818. </xsl:element>
  5819. </xsl:when>
  5820. <xsl:when test="@表:位置='headerright'">
  5821. <xsl:element name="style:region-right">
  5822. <xsl:call-template name="create-page-header-footer-text-p">
  5823. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5824. </xsl:call-template>
  5825. </xsl:element>
  5826. </xsl:when>
  5827. <xsl:otherwise/>
  5828. </xsl:choose>
  5829. </xsl:if>
  5830. </xsl:when>
  5831. <xsl:otherwise/>
  5832. </xsl:choose>
  5833. </xsl:for-each>
  5834. </style:header>
  5835. <style:footer>
  5836. <xsl:for-each select="表:页面设置/表:页眉页脚">
  5837. <xsl:variable name="temp" select="@表:位置"/>
  5838. <xsl:choose>
  5839. <xsl:when test="contains($temp,'footer')">
  5840. <xsl:if test="字:段落">
  5841. <xsl:choose>
  5842. <xsl:when test="@表:位置='footerleft'">
  5843. <xsl:element name="style:region-left">
  5844. <xsl:call-template name="create-page-header-footer-text-p">
  5845. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5846. </xsl:call-template>
  5847. </xsl:element>
  5848. </xsl:when>
  5849. <xsl:when test="@表:位置='footercenter'">
  5850. <xsl:element name="style:region-center">
  5851. <xsl:call-template name="create-page-header-footer-text-p">
  5852. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5853. </xsl:call-template>
  5854. </xsl:element>
  5855. </xsl:when>
  5856. <xsl:when test="@表:位置='footerright'">
  5857. <xsl:element name="style:region-right">
  5858. <xsl:call-template name="create-page-header-footer-text-p">
  5859. <xsl:with-param name="paragragh-set" select="字:段落"/>
  5860. </xsl:call-template>
  5861. </xsl:element>
  5862. </xsl:when>
  5863. <xsl:otherwise/>
  5864. </xsl:choose>
  5865. </xsl:if>
  5866. </xsl:when>
  5867. <xsl:otherwise/>
  5868. </xsl:choose>
  5869. </xsl:for-each>
  5870. </style:footer>
  5871. </xsl:element>
  5872. </xsl:for-each>
  5873. </xsl:template>
  5874. <!--xsl:template name="create-page-master">
  5875. </xsl:template>
  5876. <xsl:template match="表:页面设置">
  5877. </xsl:template>
  5878. <xsl:template name="create-master-styles">
  5879. </xsl:template>
  5880. <xsl:template name="表:工作表属性">
  5881. </xsl:template-->
  5882. <!--00000000000-->
  5883. <xsl:template match="uof:元数据">
  5884. <office:meta>
  5885. <xsl:if test="uof:创建应用程序">
  5886. <meta:generator>
  5887. <xsl:value-of select="uof:创建应用程序"/>
  5888. </meta:generator>
  5889. </xsl:if>
  5890. <xsl:if test="uof:标题">
  5891. <dc:title>
  5892. <xsl:value-of select="uof:标题"/>
  5893. </dc:title>
  5894. </xsl:if>
  5895. <xsl:if test="uof:摘要">
  5896. <dc:description>
  5897. <xsl:value-of select="uof:摘要"/>
  5898. </dc:description>
  5899. </xsl:if>
  5900. <xsl:if test="uof:主题">
  5901. <dc:subject>
  5902. <xsl:value-of select="uof:主题"/>
  5903. </dc:subject>
  5904. </xsl:if>
  5905. <xsl:if test="uof:作者">
  5906. <meta:initial-creator>
  5907. <xsl:value-of select="uof:作者"/>
  5908. </meta:initial-creator>
  5909. </xsl:if>
  5910. <xsl:if test="uof:创建日期">
  5911. <meta:creation-date>
  5912. <xsl:value-of select="uof:创建日期"/>
  5913. </meta:creation-date>
  5914. </xsl:if>
  5915. <xsl:if test="uof:最后作者">
  5916. <dc:creator>
  5917. <xsl:value-of select="uof:最后作者"/>
  5918. </dc:creator>
  5919. </xsl:if>
  5920. <xsl:if test="uof:编辑时间">
  5921. <meta:editing-duration>
  5922. <xsl:value-of select="uof:编辑时间"/>
  5923. </meta:editing-duration>
  5924. </xsl:if>
  5925. <dc:language/>
  5926. <meta:keyword>
  5927. <xsl:value-of select="uof:关键字集/uof:关键字"/>
  5928. </meta:keyword>
  5929. <xsl:if test="uof:编辑次数">
  5930. <meta:editing-cycles>
  5931. <xsl:value-of select="uof:编辑次数"/>
  5932. </meta:editing-cycles>
  5933. </xsl:if>
  5934. <xsl:if test="uof:分类">
  5935. <meta:user-defined meta:name="Category">
  5936. <xsl:value-of select="uof:分类"/>
  5937. </meta:user-defined>
  5938. </xsl:if>
  5939. <xsl:if test="uof:经理名称">
  5940. <meta:user-defined meta:name="Manager">
  5941. <xsl:value-of select="uof:经理名称"/>
  5942. </meta:user-defined>
  5943. </xsl:if>
  5944. <xsl:if test="uof:公司名称">
  5945. <meta:user-defined meta:name="Company">
  5946. <xsl:value-of select="uof:公司名称"/>
  5947. </meta:user-defined>
  5948. </xsl:if>
  5949. <xsl:apply-templates select="uof:用户自定义元数据集"/>
  5950. </office:meta>
  5951. </xsl:template>
  5952. <xsl:template match="uof:用户自定义元数据集">
  5953. <xsl:for-each select="uof:用户自定义元数据">
  5954. <meta:user-defined meta:name="{@uof:名称}">
  5955. <xsl:value-of select="."/>
  5956. </meta:user-defined>
  5957. </xsl:for-each>
  5958. </xsl:template>
  5959. <xsl:template name="parse-range">
  5960. <xsl:param name="range-value"/>
  5961. <xsl:param name="last"/>
  5962. <xsl:variable name="first-pit">
  5963. <xsl:choose>
  5964. <xsl:when test="contains($range-value,',')">
  5965. <xsl:value-of select="substring-before($range-value,',')"/>
  5966. </xsl:when>
  5967. <xsl:otherwise>
  5968. <xsl:value-of select="$range-value"/>
  5969. </xsl:otherwise>
  5970. </xsl:choose>
  5971. </xsl:variable>
  5972. <xsl:variable name="current">
  5973. <xsl:choose>
  5974. <xsl:when test="contains($first-pit,':')">
  5975. <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
  5976. <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
  5977. <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
  5978. <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
  5979. <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
  5980. <xsl:variable name="the-str">
  5981. <xsl:call-template name="condition-rc-str">
  5982. <xsl:with-param name="r-start" select="$R-start"/>
  5983. <xsl:with-param name="r-end" select="$R-end"/>
  5984. <xsl:with-param name="c-start" select="$C-start"/>
  5985. <xsl:with-param name="c-end" select="$C-end"/>
  5986. <xsl:with-param name="last" select="''"/>
  5987. </xsl:call-template>
  5988. </xsl:variable>
  5989. <xsl:value-of select="$the-str"/>
  5990. </xsl:when>
  5991. <xsl:otherwise>
  5992. <xsl:value-of select="concat($first-pit,',')"/>
  5993. </xsl:otherwise>
  5994. </xsl:choose>
  5995. </xsl:variable>
  5996. <xsl:choose>
  5997. <xsl:when test="contains($range-value,',')">
  5998. <xsl:call-template name="parse-range">
  5999. <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
  6000. <xsl:with-param name="last" select="concat($last,$current)"/>
  6001. </xsl:call-template>
  6002. </xsl:when>
  6003. <xsl:otherwise>
  6004. <xsl:value-of select="concat($last,$current)"/>
  6005. </xsl:otherwise>
  6006. </xsl:choose>
  6007. </xsl:template>
  6008. <xsl:template name="condition-rc-str">
  6009. <!-- dealing the range of row\column -->
  6010. <xsl:param name="r-start"/>
  6011. <xsl:param name="r-end"/>
  6012. <xsl:param name="c-start"/>
  6013. <xsl:param name="c-end"/>
  6014. <xsl:param name="last"/>
  6015. <xsl:variable name="current">
  6016. <xsl:call-template name="condition-c-str">
  6017. <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
  6018. <xsl:with-param name="start" select="$c-start"/>
  6019. <xsl:with-param name="end" select="$c-end"/>
  6020. <xsl:with-param name="last" select="''"/>
  6021. </xsl:call-template>
  6022. </xsl:variable>
  6023. <xsl:if test="$r-start &lt; $r-end">
  6024. <xsl:call-template name="condition-rc-str">
  6025. <xsl:with-param name="r-start" select="$r-start + 1"/>
  6026. <xsl:with-param name="r-end" select="$r-end"/>
  6027. <xsl:with-param name="c-start" select="$c-start"/>
  6028. <xsl:with-param name="c-end" select="$c-end"/>
  6029. <xsl:with-param name="last" select="concat($last,$current)"/>
  6030. </xsl:call-template>
  6031. </xsl:if>
  6032. <xsl:if test="$r-start = $r-end">
  6033. <xsl:value-of select="concat($last,$current)"/>
  6034. </xsl:if>
  6035. </xsl:template>
  6036. <xsl:template name="condition-c-str">
  6037. <!-- return value for the template condition-rc-str -->
  6038. <xsl:param name="rc-str"/>
  6039. <xsl:param name="start"/>
  6040. <xsl:param name="end"/>
  6041. <xsl:param name="last"/>
  6042. <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
  6043. <xsl:if test="$start &lt; $end">
  6044. <xsl:call-template name="condition-c-str">
  6045. <xsl:with-param name="rc-str" select="$rc-str"/>
  6046. <xsl:with-param name="start" select="$start + 1"/>
  6047. <xsl:with-param name="end" select="$end"/>
  6048. <xsl:with-param name="last" select="concat($last,$current)"/>
  6049. </xsl:call-template>
  6050. </xsl:if>
  6051. <xsl:if test="$start = $end">
  6052. <xsl:value-of select="concat($last,$current)"/>
  6053. </xsl:if>
  6054. </xsl:template>
  6055. <xsl:template name="condition-str">
  6056. <xsl:param name="param-str"/>
  6057. <xsl:choose>
  6058. <xsl:when test="contains($param-str,'(')">
  6059. <xsl:call-template name="condition-str">
  6060. <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
  6061. </xsl:call-template>
  6062. </xsl:when>
  6063. <xsl:otherwise>
  6064. <xsl:value-of select="substring-before($param-str,':')"/>
  6065. </xsl:otherwise>
  6066. </xsl:choose>
  6067. </xsl:template>
  6068. <xsl:template name="encode-as-cell-range-address">
  6069. <xsl:param name="string"/>
  6070. <xsl:value-of select="$string"/>
  6071. </xsl:template>
  6072. <xsl:template name="encode-as-cell-address">
  6073. <xsl:param name="string"/>
  6074. <xsl:value-of select="$string"/>
  6075. </xsl:template>
  6076. <!--chengxiuzhi 111111111111111111111111111111111111111111111111111111111111111-->
  6077. <!-- measure_conversion.xsl Begin-->
  6078. <xsl:param name="dpi" select="111"/>
  6079. <xsl:param name="centimeter-in-mm" select="10"/>
  6080. <xsl:param name="inch-in-mm" select="25.4"/>
  6081. <xsl:param name="didot-point-in-mm" select="0.376065"/>
  6082. <xsl:param name="pica-in-mm" select="4.2333333"/>
  6083. <xsl:param name="point-in-mm" select="0.3527778"/>
  6084. <xsl:param name="twip-in-mm" select="0.017636684"/>
  6085. <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
  6086. <!-- ***** MEASUREMENT CONVERSIONS *****
  6087. PARAM 'value'
  6088. The measure to be converted.
  6089. The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
  6090. directly added to the number.
  6091. PARAM 'rounding-factor'
  6092. Is used for the rounding of decimal places.
  6093. The parameter number is the product of 1 and some '10', where
  6094. every zero represents a decimal place.
  6095. For example, providing as parameter:
  6096. <xsl:param name="rounding-factor" select="10000" />
  6097. Gives by default four decimal places.
  6098. To round two decimal places, basically the following is done:
  6099. <xsl:value-of select="round(100 * value) div 100"/>
  6100. RETURN The converted number, by default rounded to four decimal places.
  6101. In case the input measure could not be matched the same value is
  6102. returned and a warning message is written out.
  6103. MEASURE LIST:
  6104. * 1 millimeter (mm), the basic measure
  6105. * 1 centimeter (cm) = 10 mm
  6106. * 1 inch (in) = 25.4 mm
  6107. While the English have already seen the light (read: the metric system), the US
  6108. remains loyal to this medieval system.
  6109. * 1 point (pt) = 0.35277777.. mm
  6110. Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
  6111. There are exactly 72 PostScript points in 1 inch.
  6112. * 1 twip = twentieth of a (PostScript) point
  6113. A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
  6114. * 1 didot point (dpt) = 0.376065 mm
  6115. Didot point after the French typographer Firmin Didot (1764-1836).
  6116. More details under
  6117. http://www.unc.edu/~rowlett/units/dictP.html:
  6118. "A unit of length used by typographers and printers. When printing was done
  6119. from hand-set metal type, one point represented the smallest element of type
  6120. that could be handled, roughly 1/64 inch. Eventually, the point was standardized
  6121. in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
  6122. about 0.35 mm (351.46 micrometers). In continental Europe, typographers
  6123. traditionally used a slightly larger point of 0.014 83 inch (about
  6124. 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
  6125. after the French typographer Firmin Didot (1764-1836). In the U.S.,
  6126. Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
  6127. or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
  6128. of 0.351 459 8035 mm. The German standards agency DIN has proposed that
  6129. all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
  6130. * 1 pica = 4.233333 mm
  6131. 1/6 inch or 12 points
  6132. * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
  6133. Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
  6134. -->
  6135. <!-- changing measure to mm -->
  6136. <xsl:template name="convert2mm">
  6137. <xsl:param name="value"/>
  6138. <xsl:param name="rounding-factor" select="10000"/>
  6139. <xsl:choose>
  6140. <xsl:when test="contains($value, 'mm')">
  6141. <xsl:value-of select="substring-before($value, 'mm')"/>
  6142. </xsl:when>
  6143. <xsl:when test="contains($value, 'cm')">
  6144. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
  6145. </xsl:when>
  6146. <xsl:when test="contains($value, 'in')">
  6147. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
  6148. </xsl:when>
  6149. <xsl:when test="contains($value, 'pt')">
  6150. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
  6151. </xsl:when>
  6152. <xsl:when test="contains($value, 'twip')">
  6153. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
  6154. </xsl:when>
  6155. <xsl:when test="contains($value, 'dpt')">
  6156. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
  6157. </xsl:when>
  6158. <xsl:when test="contains($value, 'pica')">
  6159. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
  6160. </xsl:when>
  6161. <xsl:when test="contains($value, 'px')">
  6162. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
  6163. </xsl:when>
  6164. <xsl:otherwise>
  6165. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
  6166. <xsl:value-of select="$value"/>
  6167. </xsl:otherwise>
  6168. </xsl:choose>
  6169. </xsl:template>
  6170. <!-- changing measure to cm -->
  6171. <xsl:template name="convert2cm">
  6172. <xsl:param name="value"/>
  6173. <xsl:param name="rounding-factor" select="10000"/>
  6174. <xsl:choose>
  6175. <xsl:when test="contains($value, 'mm')">
  6176. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
  6177. </xsl:when>
  6178. <xsl:when test="contains($value, 'cm')">
  6179. <xsl:value-of select="substring-before($value, 'cm')"/>
  6180. </xsl:when>
  6181. <xsl:when test="contains($value, 'in')">
  6182. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
  6183. </xsl:when>
  6184. <xsl:when test="contains($value, 'pt')">
  6185. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
  6186. </xsl:when>
  6187. <xsl:when test="contains($value, 'dpt')">
  6188. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  6189. </xsl:when>
  6190. <xsl:when test="contains($value, 'pica')">
  6191. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
  6192. </xsl:when>
  6193. <xsl:when test="contains($value, 'twip')">
  6194. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
  6195. </xsl:when>
  6196. <xsl:when test="contains($value, 'px')">
  6197. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6198. </xsl:when>
  6199. <xsl:otherwise>
  6200. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
  6201. <xsl:value-of select="$value"/>
  6202. </xsl:otherwise>
  6203. </xsl:choose>
  6204. </xsl:template>
  6205. <!-- changing measure to inch (cp. section comment) -->
  6206. <xsl:template name="convert2in">
  6207. <xsl:param name="value"/>
  6208. <xsl:param name="rounding-factor" select="10000"/>
  6209. <xsl:choose>
  6210. <xsl:when test="contains($value, 'mm')">
  6211. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
  6212. </xsl:when>
  6213. <xsl:when test="contains($value, 'cm')">
  6214. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
  6215. </xsl:when>
  6216. <xsl:when test="contains($value, 'in')">
  6217. <xsl:value-of select="substring-before($value, 'in')"/>
  6218. </xsl:when>
  6219. <xsl:when test="contains($value, 'pt')">
  6220. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
  6221. </xsl:when>
  6222. <xsl:when test="contains($value, 'dpt')">
  6223. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  6224. </xsl:when>
  6225. <xsl:when test="contains($value, 'pica')">
  6226. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
  6227. </xsl:when>
  6228. <xsl:when test="contains($value, 'twip')">
  6229. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
  6230. </xsl:when>
  6231. <xsl:when test="contains($value, 'px')">
  6232. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6233. </xsl:when>
  6234. <xsl:otherwise>
  6235. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
  6236. <xsl:value-of select="$value"/>
  6237. </xsl:otherwise>
  6238. </xsl:choose>
  6239. </xsl:template>
  6240. <!-- changing measure to dpt (cp. section comment) -->
  6241. <xsl:template name="convert2dpt">
  6242. <xsl:param name="value"/>
  6243. <xsl:param name="rounding-factor" select="10000"/>
  6244. <xsl:choose>
  6245. <xsl:when test="contains($value, 'mm')">
  6246. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
  6247. </xsl:when>
  6248. <xsl:when test="contains($value, 'cm')">
  6249. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
  6250. </xsl:when>
  6251. <xsl:when test="contains($value, 'in')">
  6252. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
  6253. </xsl:when>
  6254. <xsl:when test="contains($value, 'pt')">
  6255. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
  6256. </xsl:when>
  6257. <xsl:when test="contains($value, 'dpt')">
  6258. <xsl:value-of select="substring-before($value, 'dpt')"/>
  6259. </xsl:when>
  6260. <xsl:when test="contains($value, 'pica')">
  6261. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
  6262. </xsl:when>
  6263. <xsl:when test="contains($value, 'twip')">
  6264. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
  6265. </xsl:when>
  6266. <xsl:when test="contains($value, 'px')">
  6267. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6268. </xsl:when>
  6269. <xsl:otherwise>
  6270. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
  6271. <xsl:value-of select="$value"/>
  6272. </xsl:otherwise>
  6273. </xsl:choose>
  6274. </xsl:template>
  6275. <!-- changing measure to pica (cp. section comment) -->
  6276. <xsl:template name="convert2pica">
  6277. <xsl:param name="value"/>
  6278. <xsl:param name="rounding-factor" select="10000"/>
  6279. <xsl:choose>
  6280. <xsl:when test="contains($value, 'mm')">
  6281. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
  6282. </xsl:when>
  6283. <xsl:when test="contains($value, 'cm')">
  6284. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
  6285. </xsl:when>
  6286. <xsl:when test="contains($value, 'in')">
  6287. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
  6288. </xsl:when>
  6289. <xsl:when test="contains($value, 'pt')">
  6290. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
  6291. </xsl:when>
  6292. <xsl:when test="contains($value, 'dpt')">
  6293. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  6294. </xsl:when>
  6295. <xsl:when test="contains($value, 'pica')">
  6296. <xsl:value-of select="substring-before($value, 'pica')"/>
  6297. </xsl:when>
  6298. <xsl:when test="contains($value, 'twip')">
  6299. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
  6300. </xsl:when>
  6301. <xsl:when test="contains($value, 'px')">
  6302. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6303. </xsl:when>
  6304. <xsl:otherwise>
  6305. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
  6306. <xsl:value-of select="$value"/>
  6307. </xsl:otherwise>
  6308. </xsl:choose>
  6309. </xsl:template>
  6310. <!-- changing measure to pt (cp. section comment) -->
  6311. <xsl:template name="convert2pt">
  6312. <xsl:param name="value"/>
  6313. <xsl:param name="rounding-factor" select="10000"/>
  6314. <xsl:choose>
  6315. <xsl:when test="contains($value, 'mm')">
  6316. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
  6317. </xsl:when>
  6318. <xsl:when test="contains($value, 'cm')">
  6319. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
  6320. </xsl:when>
  6321. <xsl:when test="contains($value, 'in')">
  6322. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
  6323. </xsl:when>
  6324. <xsl:when test="contains($value, 'pt')">
  6325. <xsl:value-of select="substring-before($value, 'pt')"/>
  6326. </xsl:when>
  6327. <xsl:when test="contains($value, 'dpt')">
  6328. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  6329. </xsl:when>
  6330. <xsl:when test="contains($value, 'pica')">
  6331. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
  6332. </xsl:when>
  6333. <xsl:when test="contains($value, 'twip')">
  6334. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
  6335. </xsl:when>
  6336. <xsl:when test="contains($value, 'px')">
  6337. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6338. </xsl:when>
  6339. <xsl:otherwise>
  6340. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
  6341. <xsl:value-of select="$value"/>
  6342. </xsl:otherwise>
  6343. </xsl:choose>
  6344. </xsl:template>
  6345. <!-- changing measure to pt (cp. section comment) -->
  6346. <xsl:template name="convert2twip">
  6347. <xsl:param name="value"/>
  6348. <xsl:param name="rounding-factor" select="10000"/>
  6349. <xsl:choose>
  6350. <xsl:when test="contains($value, 'mm')">
  6351. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
  6352. </xsl:when>
  6353. <xsl:when test="contains($value, 'cm')">
  6354. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
  6355. </xsl:when>
  6356. <xsl:when test="contains($value, 'in')">
  6357. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
  6358. </xsl:when>
  6359. <xsl:when test="contains($value, 'pt')">
  6360. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
  6361. </xsl:when>
  6362. <xsl:when test="contains($value, 'dpt')">
  6363. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
  6364. </xsl:when>
  6365. <xsl:when test="contains($value, 'pica')">
  6366. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
  6367. </xsl:when>
  6368. <xsl:when test="contains($value, 'twip')">
  6369. <xsl:value-of select="substring-before($value, 'twip')"/>
  6370. </xsl:when>
  6371. <xsl:when test="contains($value, 'px')">
  6372. <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
  6373. </xsl:when>
  6374. <xsl:otherwise>
  6375. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
  6376. <xsl:value-of select="$value"/>
  6377. </xsl:otherwise>
  6378. </xsl:choose>
  6379. </xsl:template>
  6380. <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
  6381. <xsl:template name="convert2px">
  6382. <xsl:param name="value"/>
  6383. <xsl:choose>
  6384. <xsl:when test="contains($value, 'mm')">
  6385. <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
  6386. </xsl:when>
  6387. <xsl:when test="contains($value, 'cm')">
  6388. <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
  6389. </xsl:when>
  6390. <xsl:when test="contains($value, 'in')">
  6391. <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
  6392. </xsl:when>
  6393. <xsl:when test="contains($value, 'pt')">
  6394. <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
  6395. </xsl:when>
  6396. <xsl:when test="contains($value, 'dpt')">
  6397. <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
  6398. </xsl:when>
  6399. <xsl:when test="contains($value, 'pica')">
  6400. <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
  6401. </xsl:when>
  6402. <xsl:when test="contains($value, 'twip')">
  6403. <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
  6404. </xsl:when>
  6405. <xsl:when test="contains($value, 'px')">
  6406. <xsl:value-of select="$value"/>
  6407. </xsl:when>
  6408. <xsl:otherwise>
  6409. <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
  6410. <xsl:value-of select="$value"/>
  6411. </xsl:otherwise>
  6412. </xsl:choose>
  6413. </xsl:template>
  6414. <!-- chenjh zhangying-->
  6415. <xsl:template name="create-content-validations">
  6416. <xsl:param name="validation-set"/>
  6417. <xsl:if test="$validation-set">
  6418. <xsl:variable name="first-validation" select="$validation-set[1]"/>
  6419. <xsl:variable name="condition-text">
  6420. <xsl:choose>
  6421. <xsl:when test="$first-validation/表:校验类型/text()='whole number'">
  6422. <xsl:choose>
  6423. <xsl:when test="$first-validation/表:操作码/text()='between' ">
  6424. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6425. </xsl:when>
  6426. <xsl:when test="$first-validation/表:操作码/text()='not between'">
  6427. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6428. </xsl:when>
  6429. <xsl:when test="$first-validation/表:操作码/text()='equal to'">
  6430. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
  6431. </xsl:when>
  6432. <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
  6433. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
  6434. </xsl:when>
  6435. <xsl:when test="$first-validation/表:操作码/text()='greater than'">
  6436. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
  6437. </xsl:when>
  6438. <xsl:when test="$first-validation/表:操作码/text()='less than'">
  6439. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
  6440. </xsl:when>
  6441. <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
  6442. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
  6443. </xsl:when>
  6444. <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
  6445. <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
  6446. </xsl:when>
  6447. </xsl:choose>
  6448. </xsl:when>
  6449. <xsl:when test="$first-validation/表:校验类型/text()='decimal'">
  6450. <xsl:choose>
  6451. <xsl:when test="$first-validation/表:操作码/text()='between' ">
  6452. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6453. </xsl:when>
  6454. <xsl:when test="$first-validation/表:操作码/text()='not between'">
  6455. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6456. </xsl:when>
  6457. <xsl:when test="$first-validation/表:操作码/text()='equal to'">
  6458. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
  6459. </xsl:when>
  6460. <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
  6461. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
  6462. </xsl:when>
  6463. <xsl:when test="$first-validation/表:操作码/text()='greater than'">
  6464. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
  6465. </xsl:when>
  6466. <xsl:when test="$first-validation/表:操作码/text()='less than'">
  6467. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
  6468. </xsl:when>
  6469. <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
  6470. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
  6471. </xsl:when>
  6472. <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
  6473. <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
  6474. </xsl:when>
  6475. </xsl:choose>
  6476. </xsl:when>
  6477. <xsl:when test="$first-validation/表:校验类型/text()='date'">
  6478. <xsl:choose>
  6479. <xsl:when test="$first-validation/表:操作码/text()='between' ">
  6480. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6481. </xsl:when>
  6482. <xsl:when test="$first-validation/表:操作码/text()='not between'">
  6483. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6484. </xsl:when>
  6485. <xsl:when test="$first-validation/表:操作码/text()='equal to'">
  6486. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()=',$first-validation/表:第一操作数/text())"/>
  6487. </xsl:when>
  6488. <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
  6489. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
  6490. </xsl:when>
  6491. <xsl:when test="$first-validation/表:操作码/text()='greater than'">
  6492. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
  6493. </xsl:when>
  6494. <xsl:when test="$first-validation/表:操作码/text()='less than'">
  6495. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
  6496. </xsl:when>
  6497. <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
  6498. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
  6499. </xsl:when>
  6500. <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
  6501. <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
  6502. </xsl:when>
  6503. </xsl:choose>
  6504. </xsl:when>
  6505. <xsl:when test="$first-validation/表:校验类型/text()='time'">
  6506. <xsl:choose>
  6507. <xsl:when test="$first-validation/表:操作码/text()='between' ">
  6508. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6509. </xsl:when>
  6510. <xsl:when test="$first-validation/表:操作码/text()='not between'">
  6511. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6512. </xsl:when>
  6513. <xsl:when test="$first-validation/表:操作码/text()='equal to'">
  6514. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()=',$first-validation/表:第一操作数/text())"/>
  6515. </xsl:when>
  6516. <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
  6517. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
  6518. </xsl:when>
  6519. <xsl:when test="$first-validation/表:操作码/text()='greater than'">
  6520. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
  6521. </xsl:when>
  6522. <xsl:when test="$first-validation/表:操作码/text()='less than'">
  6523. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
  6524. </xsl:when>
  6525. <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
  6526. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
  6527. </xsl:when>
  6528. <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
  6529. <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
  6530. </xsl:when>
  6531. </xsl:choose>
  6532. </xsl:when>
  6533. <!-- add 20060317 -->
  6534. <xsl:when test="$first-validation/表:校验类型/text()='cell range'">
  6535. <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
  6536. </xsl:when>
  6537. <xsl:when test="$first-validation/表:校验类型/text()='list'">
  6538. <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
  6539. </xsl:when>
  6540. <!-- add 20060317 end -->
  6541. <xsl:when test="$first-validation/表:校验类型/text()='text length'">
  6542. <xsl:choose>
  6543. <xsl:when test="$first-validation/表:操作码/text()='between' ">
  6544. <xsl:value-of select="concat('oooc:cell-content-text-length-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6545. </xsl:when>
  6546. <xsl:when test="$first-validation/表:操作码/text()='not between'">
  6547. <xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
  6548. </xsl:when>
  6549. <xsl:when test="$first-validation/表:操作码/text()='equal to'">
  6550. <xsl:value-of select="concat('oooc:cell-content-text-length()=',$first-validation/表:第一操作数/text())"/>
  6551. </xsl:when>
  6552. <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
  6553. <xsl:value-of select="concat('oooc:cell-content-text-length()!=',$first-validation/表:第一操作数/text())"/>
  6554. </xsl:when>
  6555. <xsl:when test="$first-validation/表:操作码/text()='greater than'">
  6556. <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;',$first-validation/表:第一操作数/text())"/>
  6557. </xsl:when>
  6558. <xsl:when test="$first-validation/表:操作码/text()='less than'">
  6559. <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;',$first-validation/表:第一操作数/text())"/>
  6560. </xsl:when>
  6561. <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
  6562. <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;=',$first-validation/表:第一操作数/text())"/>
  6563. </xsl:when>
  6564. <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
  6565. <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;=',$first-validation/表:第一操作数/text())"/>
  6566. </xsl:when>
  6567. </xsl:choose>
  6568. </xsl:when>
  6569. </xsl:choose>
  6570. </xsl:variable>
  6571. <xsl:element name="table:content-validation">
  6572. <xsl:attribute name="table:name"><xsl:value-of select="concat('val',count($first-validation/preceding-sibling::表:数据有效性)+1)"/></xsl:attribute>
  6573. <xsl:attribute name="table:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
  6574. <xsl:attribute name="table:allow-empty-cell"><xsl:value-of select="$first-validation/表:忽略空格/@表:值"/></xsl:attribute>
  6575. <xsl:attribute name="table:base-cell-address"><xsl:value-of select="translate(substring-after($first-validation/表:区域/text(),':'),'$','')"/></xsl:attribute>
  6576. <xsl:if test="$first-validation/表:输入提示">
  6577. <xsl:element name="table:help-message">
  6578. <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:输入提示/@表:标题"/></xsl:attribute>
  6579. <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:输入提示/@表:显示"/></xsl:attribute>
  6580. <xsl:element name="text:p">
  6581. <xsl:value-of select="$first-validation/表:输入提示/@表:内容"/>
  6582. </xsl:element>
  6583. </xsl:element>
  6584. </xsl:if>
  6585. <xsl:if test="$first-validation/表:错误提示">
  6586. <xsl:element name="table:error-message">
  6587. <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:错误提示/@表:标题"/></xsl:attribute>
  6588. <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:错误提示/@表:显示"/></xsl:attribute>
  6589. <xsl:attribute name="table:message-type"><xsl:value-of select="$first-validation/表:错误提示/@表:类型"/></xsl:attribute>
  6590. <xsl:element name="text:p">
  6591. <xsl:value-of select="$first-validation/表:错误提示/@表:内容"/>
  6592. </xsl:element>
  6593. </xsl:element>
  6594. </xsl:if>
  6595. </xsl:element>
  6596. <xsl:call-template name="create-content-validations">
  6597. <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
  6598. </xsl:call-template>
  6599. </xsl:if>
  6600. </xsl:template>
  6601. <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
  6602. <xsl:template match="表:图表">
  6603. <xsl:param name="table-name"/>
  6604. <xsl:element name="draw:frame">
  6605. <xsl:attribute name="draw:z-index"><xsl:value-of select="'0'"/></xsl:attribute>
  6606. <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
  6607. <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
  6608. <xsl:attribute name="svg:x"><xsl:value-of select="concat(@表:x坐标,$uofUnit)"/></xsl:attribute>
  6609. <xsl:attribute name="svg:y"><xsl:value-of select="concat(@表:y坐标,$uofUnit)"/></xsl:attribute>
  6610. <xsl:variable name="chart-current">
  6611. <xsl:number level="any" count="表:图表" format="1"/>
  6612. </xsl:variable>
  6613. <xsl:attribute name="draw:style-name"><xsl:value-of select="concat('chart', $chart-current)"/></xsl:attribute>
  6614. <xsl:variable name="series-value-start">
  6615. <xsl:for-each select="表:数据源/表:系列[position()='1']">
  6616. <xsl:value-of select="@表:系列值"/>
  6617. </xsl:for-each>
  6618. </xsl:variable>
  6619. <xsl:variable name="series-value-end">
  6620. <xsl:for-each select="表:数据源/表:系列[position()=last()]">
  6621. <xsl:value-of select="@表:系列值"/>
  6622. </xsl:for-each>
  6623. </xsl:variable>
  6624. <xsl:variable name="series-generate-type">
  6625. <xsl:choose>
  6626. <xsl:when test="表:数据源/@表序号产生">
  6627. <xsl:value-of select="表:数据源/@表序号产生"/>
  6628. </xsl:when>
  6629. <xsl:when test="substring(substring-after($series-value-start,'!'),2,1)=substring(substring-after($series-value-start,':'),2,1)">row</xsl:when>
  6630. <xsl:otherwise>col</xsl:otherwise>
  6631. </xsl:choose>
  6632. </xsl:variable>
  6633. <xsl:element name="draw:object">
  6634. <xsl:attribute name="draw:notify-on-update-of-ranges"><xsl:value-of select="表:数据源/@表:数据区域"/></xsl:attribute>
  6635. <office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" 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: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" office:version="1.0" office:mimetype="application/vnd.oasis.opendocument.chart">
  6636. <xsl:call-template name="表:元数据">
  6637. <xsl:with-param name="table-name" select="$table-name"/>
  6638. <xsl:with-param name="table-type" select="@表:类型"/>
  6639. <xsl:with-param name="table-subtype" select="@表:子类型"/>
  6640. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6641. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6642. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6643. </xsl:call-template>
  6644. <xsl:call-template name="表:式样集">
  6645. <xsl:with-param name="table-name" select="$table-name"/>
  6646. <xsl:with-param name="table-type" select="@表:类型"/>
  6647. <xsl:with-param name="table-subtype" select="@表:子类型"/>
  6648. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6649. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6650. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6651. </xsl:call-template>
  6652. <xsl:call-template name="表:主体">
  6653. <xsl:with-param name="table-name" select="$table-name"/>
  6654. <xsl:with-param name="table-type" select="@表:类型"/>
  6655. <xsl:with-param name="table-subtype" select="@表:子类型"/>
  6656. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6657. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6658. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6659. </xsl:call-template>
  6660. </office:document>
  6661. </xsl:element>
  6662. <xsl:element name="draw:image">
  6663. <office:binary-data>
  6664. <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象/uof:数据"/>
  6665. </office:binary-data>
  6666. </xsl:element>
  6667. </xsl:element>
  6668. </xsl:template>
  6669. <xsl:template name="表:元数据">
  6670. <xsl:param name="table-name"/>
  6671. <xsl:param name="table-type"/>
  6672. <xsl:param name="table-subtype"/>
  6673. <xsl:param name="series-value-start"/>
  6674. <xsl:param name="series-value-end"/>
  6675. <xsl:param name="series-generate-type"/>
  6676. <xsl:for-each select="/uof:UOF/uof:元数据">
  6677. <office:meta>
  6678. <meta:generator>OpenOffice.org 1.1.3 (Win32)</meta:generator>
  6679. <xsl:if test="uof:标题">
  6680. <dc:title>
  6681. <xsl:value-of select="uof:标题"/>
  6682. </dc:title>
  6683. </xsl:if>
  6684. <xsl:if test="uof:摘要">
  6685. <dc:description>
  6686. <xsl:value-of select="uof:摘要"/>
  6687. </dc:description>
  6688. </xsl:if>
  6689. <xsl:if test="uof:主题">
  6690. <dc:subject>
  6691. <xsl:value-of select="uof:主题"/>
  6692. </dc:subject>
  6693. </xsl:if>
  6694. <xsl:if test="uof:作者">
  6695. <meta:initial-creator>
  6696. <xsl:value-of select="uof:作者"/>
  6697. </meta:initial-creator>
  6698. </xsl:if>
  6699. <xsl:if test="uof:创建日期">
  6700. <meta:creation-date>
  6701. <xsl:value-of select="uof:创建日期"/>
  6702. </meta:creation-date>
  6703. </xsl:if>
  6704. <xsl:if test="uof:最后作者">
  6705. <dc:creator>
  6706. <xsl:value-of select="uof:最后作者"/>
  6707. </dc:creator>
  6708. </xsl:if>
  6709. <xsl:if test="uof:编辑时间">
  6710. <meta:editing-duration>
  6711. <xsl:value-of select="uof:编辑时间"/>
  6712. </meta:editing-duration>
  6713. </xsl:if>
  6714. <dc:language/>
  6715. <meta:keywords>
  6716. <meta:keyword>
  6717. <xsl:value-of select="uof:关键字集/uof:关键字"/>
  6718. </meta:keyword>
  6719. </meta:keywords>
  6720. <xsl:if test="uof:编辑次数">
  6721. <meta:editing-cycles>
  6722. <xsl:value-of select="uof:编辑次数"/>
  6723. </meta:editing-cycles>
  6724. </xsl:if>
  6725. <xsl:if test="uof:分类">
  6726. <meta:user-defined meta:name="Category">
  6727. <xsl:value-of select="uof:分类"/>
  6728. </meta:user-defined>
  6729. </xsl:if>
  6730. <xsl:if test="uof:经理名称">
  6731. <meta:user-defined meta:name="Manager">
  6732. <xsl:value-of select="uof:经理名称"/>
  6733. </meta:user-defined>
  6734. </xsl:if>
  6735. <xsl:if test="uof:公司名称">
  6736. <meta:user-defined meta:name="Company">
  6737. <xsl:value-of select="uof:公司名称"/>
  6738. </meta:user-defined>
  6739. </xsl:if>
  6740. <xsl:if test="uof:创建应用程序">
  6741. <meta:user-defined meta:name="Version">
  6742. <xsl:value-of select="uof:创建应用程序"/>
  6743. </meta:user-defined>
  6744. </xsl:if>
  6745. </office:meta>
  6746. </xsl:for-each>
  6747. </xsl:template>
  6748. <xsl:template name="表:式样集">
  6749. <xsl:param name="table-name"/>
  6750. <xsl:param name="table-type"/>
  6751. <xsl:param name="table-subtype"/>
  6752. <xsl:param name="series-value-start"/>
  6753. <xsl:param name="series-value-end"/>
  6754. <xsl:param name="series-generate-type"/>
  6755. <office:styles>
  6756. <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
  6757. <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
  6758. <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
  6759. <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
  6760. <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
  6761. <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
  6762. <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
  6763. <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
  6764. <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
  6765. <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
  6766. <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
  6767. <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
  6768. <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
  6769. <xsl:for-each select="//图:图片">
  6770. <xsl:variable name="chart-image-name" select="@图:名称"/>
  6771. <draw:fill-image>
  6772. <xsl:attribute name="draw:name"><xsl:value-of select="@图:名称"/></xsl:attribute>
  6773. <office:binary-data>
  6774. <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$chart-image-name]">
  6775. <xsl:value-of select="uof:数据"/>
  6776. </xsl:for-each>
  6777. </office:binary-data>
  6778. </draw:fill-image>
  6779. </xsl:for-each>
  6780. <xsl:for-each select="//图:图案">
  6781. <xsl:variable name="chart-hatch-name" select="@图:图形引用"/>
  6782. <draw:hatch>
  6783. <xsl:if test="@图:图形引用">
  6784. <xsl:attribute name="draw:name"><xsl:value-of select="$chart-hatch-name"/></xsl:attribute>
  6785. </xsl:if>
  6786. <xsl:if test="@图:类型">
  6787. <xsl:attribute name="draw:style"><xsl:value-of select="@图:类型"/></xsl:attribute>
  6788. </xsl:if>
  6789. <xsl:if test="@图:前景色">
  6790. <xsl:attribute name="draw:color"><xsl:value-of select="@图:前景色"/></xsl:attribute>
  6791. </xsl:if>
  6792. <xsl:if test="@图:距离">
  6793. <xsl:attribute name="draw:distance"><xsl:value-of select="@图:距离"/></xsl:attribute>
  6794. </xsl:if>
  6795. <xsl:if test="@图:旋转度">
  6796. <xsl:attribute name="draw:rotation"><xsl:value-of select="@图:旋转度"/></xsl:attribute>
  6797. </xsl:if>
  6798. </draw:hatch>
  6799. </xsl:for-each>
  6800. <xsl:for-each select="//图:渐变">
  6801. <draw:gradient>
  6802. <xsl:if test="@图:图形引用">
  6803. <xsl:attribute name="draw:name"><xsl:value-of select="@图:图形引用"/></xsl:attribute>
  6804. </xsl:if>
  6805. <xsl:if test="@图:起始色">
  6806. <xsl:attribute name="draw:start-color"><xsl:value-of select="@图:起始色"/></xsl:attribute>
  6807. </xsl:if>
  6808. <xsl:if test="@图:终止色">
  6809. <xsl:attribute name="draw:end-color"><xsl:value-of select="@图:终止色"/></xsl:attribute>
  6810. </xsl:if>
  6811. <xsl:if test="@图:种子类型">
  6812. <xsl:attribute name="draw:style"><xsl:value-of select="@图:种子类型"/></xsl:attribute>
  6813. </xsl:if>
  6814. <xsl:if test="@图:起始浓度">
  6815. <xsl:attribute name="draw:start-intensity"><xsl:value-of select="@图:起始浓度"/></xsl:attribute>
  6816. </xsl:if>
  6817. <xsl:if test="@图:终止浓度">
  6818. <xsl:attribute name="draw:end-intensity"><xsl:value-of select="@图:终止浓度"/></xsl:attribute>
  6819. </xsl:if>
  6820. <xsl:if test="@图:渐变方向">
  6821. <xsl:attribute name="draw:angle"><xsl:value-of select="@图:渐变方向"/></xsl:attribute>
  6822. </xsl:if>
  6823. <xsl:if test="@图:边界">
  6824. <xsl:attribute name="draw:border"><xsl:value-of select="@图:边界"/></xsl:attribute>
  6825. </xsl:if>
  6826. <xsl:if test="@图:种子X位置">
  6827. <xsl:attribute name="draw:cx"><xsl:value-of select="@图:种子X位置"/></xsl:attribute>
  6828. </xsl:if>
  6829. <xsl:if test="@图:种子Y位置">
  6830. <xsl:attribute name="draw:cy"><xsl:value-of select="@图:种子Y位置"/></xsl:attribute>
  6831. </xsl:if>
  6832. </draw:gradient>
  6833. </xsl:for-each>
  6834. </office:styles>
  6835. <office:automatic-styles>
  6836. <xsl:for-each select="node( )">
  6837. <xsl:choose>
  6838. <xsl:when test="name(.)='表:图表区'">
  6839. <xsl:call-template name="表:图表区式样">
  6840. <xsl:with-param name="table-name" select="$table-name"/>
  6841. <xsl:with-param name="table-type" select="$table-type"/>
  6842. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6843. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6844. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6845. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6846. </xsl:call-template>
  6847. </xsl:when>
  6848. <xsl:when test="name(.)='表:绘图区'">
  6849. <xsl:call-template name="表:绘图区式样">
  6850. <xsl:with-param name="table-name" select="$table-name"/>
  6851. <xsl:with-param name="table-type" select="$table-type"/>
  6852. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6853. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6854. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6855. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6856. </xsl:call-template>
  6857. <xsl:call-template name="表:图表背景墙式样">
  6858. <xsl:with-param name="table-name" select="$table-name"/>
  6859. <xsl:with-param name="table-type" select="$table-type"/>
  6860. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6861. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6862. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6863. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6864. </xsl:call-template>
  6865. </xsl:when>
  6866. <xsl:when test="name(.)='表:分类轴'">
  6867. <xsl:call-template name="表:分类轴式样">
  6868. <xsl:with-param name="table-name" select="$table-name"/>
  6869. <xsl:with-param name="table-type" select="$table-type"/>
  6870. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6871. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6872. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6873. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6874. </xsl:call-template>
  6875. </xsl:when>
  6876. <xsl:when test="name(.)='表:数值轴'">
  6877. <xsl:call-template name="表:数值轴式样">
  6878. <xsl:with-param name="table-name" select="$table-name"/>
  6879. <xsl:with-param name="table-type" select="$table-type"/>
  6880. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6881. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6882. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6883. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6884. </xsl:call-template>
  6885. </xsl:when>
  6886. <xsl:when test="name(.)='表:图例'">
  6887. <xsl:call-template name="表:图例式样">
  6888. <xsl:with-param name="table-name" select="$table-name"/>
  6889. <xsl:with-param name="table-type" select="$table-type"/>
  6890. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6891. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6892. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6893. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6894. </xsl:call-template>
  6895. </xsl:when>
  6896. <xsl:when test="name(.)='表:数据表'">
  6897. <xsl:call-template name="表:数据表式样">
  6898. <xsl:with-param name="table-name" select="$table-name"/>
  6899. <xsl:with-param name="table-type" select="$table-type"/>
  6900. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6901. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6902. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6903. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6904. </xsl:call-template>
  6905. </xsl:when>
  6906. <xsl:when test="name(.)='表:数据系列集'">
  6907. <xsl:call-template name="表:数据系列集式样">
  6908. <xsl:with-param name="table-name" select="$table-name"/>
  6909. <xsl:with-param name="table-type" select="$table-type"/>
  6910. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6911. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6912. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6913. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6914. </xsl:call-template>
  6915. </xsl:when>
  6916. <xsl:when test="name(.)='表:数据点集'">
  6917. <xsl:call-template name="表:数据点集式样">
  6918. <xsl:with-param name="table-name" select="$table-name"/>
  6919. <xsl:with-param name="table-type" select="$table-type"/>
  6920. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6921. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6922. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6923. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6924. </xsl:call-template>
  6925. </xsl:when>
  6926. <xsl:when test="name(.)='表:网格线集'">
  6927. <xsl:call-template name="表:网格线集式样">
  6928. <xsl:with-param name="table-name" select="$table-name"/>
  6929. <xsl:with-param name="table-type" select="$table-type"/>
  6930. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6931. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6932. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6933. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6934. </xsl:call-template>
  6935. </xsl:when>
  6936. <xsl:when test="name(.)='表:数据源'">
  6937. <xsl:call-template name="表:数据源式样">
  6938. <xsl:with-param name="table-name" select="$table-name"/>
  6939. <xsl:with-param name="table-type" select="$table-type"/>
  6940. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6941. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6942. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6943. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6944. </xsl:call-template>
  6945. </xsl:when>
  6946. <xsl:when test="name(.)='表:标题集'">
  6947. <xsl:call-template name="表:标题集式样">
  6948. <xsl:with-param name="table-name" select="$table-name"/>
  6949. <xsl:with-param name="table-type" select="$table-type"/>
  6950. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6951. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6952. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6953. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6954. </xsl:call-template>
  6955. </xsl:when>
  6956. <xsl:otherwise/>
  6957. </xsl:choose>
  6958. </xsl:for-each>
  6959. </office:automatic-styles>
  6960. </xsl:template>
  6961. <xsl:template name="表:主体">
  6962. <xsl:param name="table-name"/>
  6963. <xsl:param name="table-type"/>
  6964. <xsl:param name="table-subtype"/>
  6965. <xsl:param name="series-value-start"/>
  6966. <xsl:param name="series-value-end"/>
  6967. <xsl:param name="series-generate-type"/>
  6968. <office:body>
  6969. <office:chart>
  6970. <chart:chart>
  6971. <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
  6972. <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
  6973. <xsl:attribute name="chart:class"><xsl:choose><xsl:when test="$table-type='column'">chart:bar</xsl:when><xsl:when test="$table-type='line'">chart:line</xsl:when><xsl:when test="$table-type='pie'"><xsl:choose><xsl:when test="$table-subtype='pie_ring'">chart:ring</xsl:when><xsl:otherwise>chart:circle</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="$table-type"/></xsl:otherwise></xsl:choose></xsl:attribute>
  6974. <xsl:attribute name="chart:style-name">chart-area</xsl:attribute>
  6975. <xsl:for-each select="表:标题集/表:标题[@表:位置='chart']">
  6976. <chart:title chart:style-name="chart-title">
  6977. <text:p>
  6978. <xsl:value-of select="@表:名称"/>
  6979. </text:p>
  6980. </chart:title>
  6981. </xsl:for-each>
  6982. <xsl:call-template name="表:图例区域">
  6983. <xsl:with-param name="table-name" select="$table-name"/>
  6984. <xsl:with-param name="table-type" select="$table-type"/>
  6985. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6986. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6987. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6988. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6989. </xsl:call-template>
  6990. <xsl:call-template name="表:绘图区域">
  6991. <xsl:with-param name="table-name" select="$table-name"/>
  6992. <xsl:with-param name="table-type" select="$table-type"/>
  6993. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  6994. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  6995. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  6996. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  6997. </xsl:call-template>
  6998. <xsl:call-template name="表:本地表">
  6999. <xsl:with-param name="table-name" select="$table-name"/>
  7000. <xsl:with-param name="table-type" select="$table-type"/>
  7001. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7002. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7003. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7004. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7005. </xsl:call-template>
  7006. </chart:chart>
  7007. </office:chart>
  7008. </office:body>
  7009. </xsl:template>
  7010. <xsl:template name="表:图例区域">
  7011. <xsl:param name="table-name"/>
  7012. <xsl:param name="table-type"/>
  7013. <xsl:param name="table-subtype"/>
  7014. <xsl:param name="series-value-start"/>
  7015. <xsl:param name="series-value-end"/>
  7016. <xsl:param name="series-generate-type"/>
  7017. <chart:legend>
  7018. <xsl:attribute name="chart:legend-position"><xsl:choose><xsl:when test="表:图例/@表:位置"><xsl:value-of select="表:图例/@表:位置"/></xsl:when><xsl:otherwise>right</xsl:otherwise></xsl:choose></xsl:attribute>
  7019. <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:图例/@表:x坐标,$uofUnit)"/></xsl:attribute>
  7020. <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:图例/@表:y坐标,$uofUnit)"/></xsl:attribute>
  7021. <xsl:attribute name="chart:style-name">legend</xsl:attribute>
  7022. </chart:legend>
  7023. </xsl:template>
  7024. <xsl:template name="表:绘图区域">
  7025. <xsl:param name="table-name"/>
  7026. <xsl:param name="table-type"/>
  7027. <xsl:param name="table-subtype"/>
  7028. <xsl:param name="series-value-start"/>
  7029. <xsl:param name="series-value-end"/>
  7030. <xsl:param name="series-generate-type"/>
  7031. <chart:plot-area>
  7032. <xsl:variable name="start-range">
  7033. <xsl:value-of select="concat('.$',substring(substring-after($series-value-start,'!'),1,1),'$',substring-before(substring(substring-after($series-value-start,'!'),2),':'))"/>
  7034. </xsl:variable>
  7035. <xsl:variable name="end-range">
  7036. <xsl:value-of select="concat(':.$',substring(substring-after($series-value-end,':'),1,1),'$',substring(substring-after($series-value-end,':'),2))"/>
  7037. </xsl:variable>
  7038. <xsl:attribute name="chart:style-name">plot-area</xsl:attribute>
  7039. <xsl:attribute name="table:cell-range-address"><xsl:value-of select="concat($table-name,$start-range,$end-range)"/></xsl:attribute>
  7040. <!--xsl:value-of select="表:数据源/@表:数据区域"/-->
  7041. <xsl:attribute name="chart:table-number-list">0</xsl:attribute>
  7042. <xsl:attribute name="svg:width"><xsl:value-of select="concat(表:绘图区/@表:宽度,$uofUnit)"/></xsl:attribute>
  7043. <xsl:attribute name="svg:height"><xsl:value-of select="concat(表:绘图区/@表:高度,$uofUnit)"/></xsl:attribute>
  7044. <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:绘图区/@表:x坐标,$uofUnit)"/></xsl:attribute>
  7045. <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:绘图区/@表:y坐标,$uofUnit)"/></xsl:attribute>
  7046. <xsl:if test="表:分类轴">
  7047. <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="category-axis">
  7048. <xsl:for-each select="表:标题集/表:标题[@表:位置='category axis']">
  7049. <chart:title chart:style-name="category-axis-title">
  7050. <text:p>
  7051. <xsl:value-of select="@表:名称"/>
  7052. </text:p>
  7053. </chart:title>
  7054. </xsl:for-each>
  7055. <chart:categories/>
  7056. <xsl:if test="表:网格线集/表:网格线[@表:位置='category axis']">
  7057. <chart:grid chart:style-name="category-axis-grid" chart:class="major"/>
  7058. </xsl:if>
  7059. </chart:axis>
  7060. </xsl:if>
  7061. <xsl:if test="表:数值轴">
  7062. <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="value-axis">
  7063. <xsl:for-each select="表:标题集/表:标题[@表:位置='value axis']">
  7064. <chart:title chart:style-name="value-axis-title">
  7065. <text:p>
  7066. <xsl:value-of select="@表:名称"/>
  7067. </text:p>
  7068. </chart:title>
  7069. </xsl:for-each>
  7070. <chart:grid chart:style-name="value-axis-grid" chart:class="major"/>
  7071. </chart:axis>
  7072. </xsl:if>
  7073. <xsl:call-template name="表:数据组">
  7074. <xsl:with-param name="table-name" select="$table-name"/>
  7075. <xsl:with-param name="table-type" select="$table-type"/>
  7076. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7077. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7078. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7079. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7080. </xsl:call-template>
  7081. <chart:wall>
  7082. <xsl:attribute name="chart:style-name">chart-wall</xsl:attribute>
  7083. </chart:wall>
  7084. <chart:floor>
  7085. <xsl:attribute name="chart:style-name">chart-floor</xsl:attribute>
  7086. </chart:floor>
  7087. </chart:plot-area>
  7088. </xsl:template>
  7089. <xsl:template name="表:本地表">
  7090. <xsl:param name="table-name"/>
  7091. <xsl:param name="table-type"/>
  7092. <xsl:param name="table-subtype"/>
  7093. <xsl:param name="series-value-start"/>
  7094. <xsl:param name="series-value-end"/>
  7095. <xsl:param name="series-generate-type"/>
  7096. <table:table table:name="local-table">
  7097. <table:table-header-columns>
  7098. <xsl:call-template name="表:本地表_表头列">
  7099. <xsl:with-param name="table-name" select="$table-name"/>
  7100. <xsl:with-param name="table-type" select="$table-type"/>
  7101. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7102. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7103. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7104. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7105. <xsl:with-param name="sum" select="1"/>
  7106. </xsl:call-template>
  7107. </table:table-header-columns>
  7108. <table:table-columns>
  7109. <xsl:variable name="column-sum">
  7110. <xsl:value-of select="count(表:数据源/表:系列)"/>
  7111. </xsl:variable>
  7112. <xsl:call-template name="表:本地表_列">
  7113. <xsl:with-param name="table-name" select="$table-name"/>
  7114. <xsl:with-param name="table-type" select="$table-type"/>
  7115. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7116. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7117. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7118. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7119. <xsl:with-param name="column-sum" select="$column-sum"/>
  7120. </xsl:call-template>
  7121. </table:table-columns>
  7122. <table:table-header-rows>
  7123. <xsl:call-template name="表:本地表_表头行">
  7124. <xsl:with-param name="table-name" select="$table-name"/>
  7125. <xsl:with-param name="table-type" select="$table-type"/>
  7126. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7127. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7128. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7129. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7130. <xsl:with-param name="row-current" select="1"/>
  7131. <xsl:with-param name="fixed-row-sum" select="'1'"/>
  7132. </xsl:call-template>
  7133. </table:table-header-rows>
  7134. <table:table-rows>
  7135. <xsl:variable name="row-start">
  7136. <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
  7137. </xsl:variable>
  7138. <xsl:variable name="row-end">
  7139. <xsl:value-of select="substring(substring-after($series-value-end,':'),2)"/>
  7140. </xsl:variable>
  7141. <xsl:variable name="fixed-row-sum">
  7142. <xsl:value-of select="$row-end -$row-start +1"/>
  7143. </xsl:variable>
  7144. <xsl:call-template name="表:本地表_行">
  7145. <xsl:with-param name="table-name" select="$table-name"/>
  7146. <xsl:with-param name="table-type" select="$table-type"/>
  7147. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7148. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7149. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7150. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7151. <xsl:with-param name="row-current" select="'1'"/>
  7152. <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
  7153. </xsl:call-template>
  7154. </table:table-rows>
  7155. </table:table>
  7156. </xsl:template>
  7157. <xsl:template name="表:本地表_表头列">
  7158. <xsl:param name="table-name"/>
  7159. <xsl:param name="table-type"/>
  7160. <xsl:param name="table-subtype"/>
  7161. <xsl:param name="series-value-start"/>
  7162. <xsl:param name="series-value-end"/>
  7163. <xsl:param name="series-generate-type"/>
  7164. <xsl:param name="sum"/>
  7165. <xsl:choose>
  7166. <xsl:when test="$sum=0"/>
  7167. <xsl:otherwise>
  7168. <table:table-column/>
  7169. <xsl:call-template name="表:本地表_表头列">
  7170. <xsl:with-param name="sum" select="$sum -1"/>
  7171. </xsl:call-template>
  7172. </xsl:otherwise>
  7173. </xsl:choose>
  7174. </xsl:template>
  7175. <xsl:template name="表:本地表_列">
  7176. <xsl:param name="table-name"/>
  7177. <xsl:param name="table-type"/>
  7178. <xsl:param name="table-subtype"/>
  7179. <xsl:param name="series-value-start"/>
  7180. <xsl:param name="series-value-end"/>
  7181. <xsl:param name="series-generate-type"/>
  7182. <xsl:param name="column-sum"/>
  7183. <xsl:choose>
  7184. <xsl:when test="$column-sum=0"/>
  7185. <xsl:otherwise>
  7186. <table:table-column/>
  7187. <xsl:call-template name="表:本地表_列">
  7188. <xsl:with-param name="column-sum" select="$column-sum -1"/>
  7189. </xsl:call-template>
  7190. </xsl:otherwise>
  7191. </xsl:choose>
  7192. </xsl:template>
  7193. <xsl:template name="表:本地表_表头行">
  7194. <xsl:param name="table-name"/>
  7195. <xsl:param name="table-type"/>
  7196. <xsl:param name="table-subtype"/>
  7197. <xsl:param name="series-value-start"/>
  7198. <xsl:param name="series-value-end"/>
  7199. <xsl:param name="series-generate-type"/>
  7200. <xsl:param name="row-current"/>
  7201. <xsl:param name="fixed-row-sum"/>
  7202. <xsl:choose>
  7203. <xsl:when test="$row-current >$fixed-row-sum"/>
  7204. <xsl:otherwise>
  7205. <table:table-row>
  7206. <xsl:variable name="series-value-current">
  7207. <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
  7208. <xsl:value-of select="@表:系列值"/>
  7209. </xsl:for-each>
  7210. </xsl:variable>
  7211. <xsl:variable name="cell-start">
  7212. <xsl:call-template name="General-Char-Transition">
  7213. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
  7214. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7215. </xsl:call-template>
  7216. </xsl:variable>
  7217. <xsl:variable name="cell-end">
  7218. <xsl:choose>
  7219. <xsl:when test="$series-generate-type='row'">
  7220. <xsl:call-template name="General-Char-Transition">
  7221. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
  7222. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7223. </xsl:call-template>
  7224. </xsl:when>
  7225. <xsl:otherwise>
  7226. <xsl:call-template name="General-Char-Transition">
  7227. <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
  7228. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7229. </xsl:call-template>
  7230. </xsl:otherwise>
  7231. </xsl:choose>
  7232. </xsl:variable>
  7233. <xsl:variable name="cell-sum">
  7234. <xsl:value-of select="$cell-end -$cell-start +2"/>
  7235. </xsl:variable>
  7236. <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
  7237. <xsl:call-template name="表:本地表_表头行_单元格">
  7238. <xsl:with-param name="table-name" select="$table-name"/>
  7239. <xsl:with-param name="table-type" select="$table-type"/>
  7240. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7241. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7242. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7243. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7244. <xsl:with-param name="series-value-current" select="$series-value-current"/>
  7245. <xsl:with-param name="row-current" select="$row-current"/>
  7246. <xsl:with-param name="cell-sum" select="$cell-sum"/>
  7247. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7248. </xsl:call-template>
  7249. </table:table-row>
  7250. <xsl:call-template name="表:本地表_表头行">
  7251. <xsl:with-param name="table-name" select="$table-name"/>
  7252. <xsl:with-param name="table-type" select="$table-type"/>
  7253. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7254. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7255. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7256. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7257. <xsl:with-param name="row-current" select="$row-current +1"/>
  7258. <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
  7259. </xsl:call-template>
  7260. </xsl:otherwise>
  7261. </xsl:choose>
  7262. </xsl:template>
  7263. <xsl:template name="表:本地表_表头行_单元格">
  7264. <xsl:param name="table-name"/>
  7265. <xsl:param name="table-type"/>
  7266. <xsl:param name="table-subtype"/>
  7267. <xsl:param name="series-value-start"/>
  7268. <xsl:param name="series-value-end"/>
  7269. <xsl:param name="series-generate-type"/>
  7270. <xsl:param name="series-value-current"/>
  7271. <xsl:param name="row-current"/>
  7272. <xsl:param name="cell-sum"/>
  7273. <xsl:param name="fixed-cell-sum"/>
  7274. <xsl:choose>
  7275. <xsl:when test="$cell-sum=0"/>
  7276. <xsl:otherwise>
  7277. <xsl:choose>
  7278. <xsl:when test="$fixed-cell-sum=$cell-sum">
  7279. <table:table-cell>
  7280. <text:p/>
  7281. </table:table-cell>
  7282. </xsl:when>
  7283. <xsl:otherwise>
  7284. <table:table-cell office:value-type="string">
  7285. <xsl:variable name="cell-no">
  7286. <xsl:value-of select="$fixed-cell-sum -$cell-sum +1"/>
  7287. </xsl:variable>
  7288. <xsl:variable name="cell-start">
  7289. <xsl:call-template name="General-Char-Transition">
  7290. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
  7291. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7292. </xsl:call-template>
  7293. </xsl:variable>
  7294. <xsl:variable name="char">
  7295. <xsl:call-template name="General-Char-Transition">
  7296. <xsl:with-param name="input-char" select="$cell-start +$cell-no -2"/>
  7297. <xsl:with-param name="output-type" select="'CHARS_UPPER_LETTER'"/>
  7298. </xsl:call-template>
  7299. </xsl:variable>
  7300. <text:p>
  7301. <xsl:value-of select="concat('列 ',$char)"/>
  7302. </text:p>
  7303. </table:table-cell>
  7304. </xsl:otherwise>
  7305. </xsl:choose>
  7306. <xsl:call-template name="表:本地表_表头行_单元格">
  7307. <xsl:with-param name="table-name" select="$table-name"/>
  7308. <xsl:with-param name="table-type" select="$table-type"/>
  7309. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7310. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7311. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7312. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7313. <xsl:with-param name="series-value-current" select="$series-value-current"/>
  7314. <xsl:with-param name="row-current" select="$row-current"/>
  7315. <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
  7316. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7317. </xsl:call-template>
  7318. </xsl:otherwise>
  7319. </xsl:choose>
  7320. </xsl:template>
  7321. <xsl:template name="表:本地表_行">
  7322. <xsl:param name="table-name"/>
  7323. <xsl:param name="table-type"/>
  7324. <xsl:param name="table-subtype"/>
  7325. <xsl:param name="series-value-start"/>
  7326. <xsl:param name="series-value-end"/>
  7327. <xsl:param name="series-generate-type"/>
  7328. <xsl:param name="row-current"/>
  7329. <xsl:param name="fixed-row-sum"/>
  7330. <xsl:choose>
  7331. <xsl:when test="$row-current >$fixed-row-sum"/>
  7332. <xsl:otherwise>
  7333. <xsl:variable name="series-value-current">
  7334. <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
  7335. <xsl:value-of select="@表:系列值"/>
  7336. </xsl:for-each>
  7337. </xsl:variable>
  7338. <table:table-row>
  7339. <xsl:variable name="cell-start">
  7340. <xsl:call-template name="General-Char-Transition">
  7341. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
  7342. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7343. </xsl:call-template>
  7344. </xsl:variable>
  7345. <xsl:variable name="cell-end">
  7346. <xsl:choose>
  7347. <xsl:when test="$series-generate-type='row'">
  7348. <xsl:call-template name="General-Char-Transition">
  7349. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
  7350. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7351. </xsl:call-template>
  7352. </xsl:when>
  7353. <xsl:otherwise>
  7354. <xsl:call-template name="General-Char-Transition">
  7355. <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
  7356. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7357. </xsl:call-template>
  7358. </xsl:otherwise>
  7359. </xsl:choose>
  7360. </xsl:variable>
  7361. <xsl:variable name="cell-sum">
  7362. <xsl:value-of select="$cell-end -$cell-start +2"/>
  7363. </xsl:variable>
  7364. <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
  7365. <xsl:call-template name="表:本地表_行_单元格">
  7366. <xsl:with-param name="table-name" select="$table-name"/>
  7367. <xsl:with-param name="table-type" select="$table-type"/>
  7368. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7369. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7370. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7371. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7372. <xsl:with-param name="series-value-current" select="$series-value-current"/>
  7373. <xsl:with-param name="row-current" select="$row-current"/>
  7374. <xsl:with-param name="cell-sum" select="$cell-sum"/>
  7375. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7376. </xsl:call-template>
  7377. </table:table-row>
  7378. <xsl:call-template name="表:本地表_行">
  7379. <xsl:with-param name="table-name" select="$table-name"/>
  7380. <xsl:with-param name="table-type" select="$table-type"/>
  7381. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7382. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7383. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7384. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7385. <xsl:with-param name="row-current" select="$row-current +1"/>
  7386. <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
  7387. </xsl:call-template>
  7388. </xsl:otherwise>
  7389. </xsl:choose>
  7390. </xsl:template>
  7391. <xsl:template name="表:本地表_行_单元格">
  7392. <xsl:param name="table-name"/>
  7393. <xsl:param name="table-type"/>
  7394. <xsl:param name="table-subtype"/>
  7395. <xsl:param name="series-value-start"/>
  7396. <xsl:param name="series-value-end"/>
  7397. <xsl:param name="series-generate-type"/>
  7398. <xsl:param name="series-value-current"/>
  7399. <xsl:param name="row-current"/>
  7400. <xsl:param name="cell-sum"/>
  7401. <xsl:param name="fixed-cell-sum"/>
  7402. <xsl:choose>
  7403. <xsl:when test="$cell-sum=0"/>
  7404. <xsl:otherwise>
  7405. <xsl:variable name="cell-start">
  7406. <xsl:call-template name="General-Char-Transition">
  7407. <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
  7408. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7409. </xsl:call-template>
  7410. </xsl:variable>
  7411. <xsl:variable name="cell-no">
  7412. <xsl:value-of select="$cell-start +$fixed-cell-sum -$cell-sum -1"/>
  7413. </xsl:variable>
  7414. <xsl:variable name="row-start">
  7415. <xsl:value-of select="substring(substring-after($series-value-start,'!'),2,1)"/>
  7416. </xsl:variable>
  7417. <xsl:variable name="row-no">
  7418. <xsl:value-of select="$row-start +$row-current -1"/>
  7419. </xsl:variable>
  7420. <xsl:choose>
  7421. <xsl:when test="$fixed-cell-sum=$cell-sum">
  7422. <table:table-cell office:value-type="string">
  7423. <text:p>
  7424. <xsl:value-of select="concat('行 ',$row-no)"/>
  7425. </text:p>
  7426. </table:table-cell>
  7427. </xsl:when>
  7428. <xsl:otherwise>
  7429. <table:table-cell office:value-type="float">
  7430. <xsl:variable name="cell-content">
  7431. <xsl:choose>
  7432. <xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/@表:行号">
  7433. <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[@表:行号=$row-no]">
  7434. <xsl:for-each select="表:单元格[@表:列号=$cell-no]">
  7435. <xsl:value-of select="表:数据/字:句/字:文本串"/>
  7436. </xsl:for-each>
  7437. </xsl:for-each>
  7438. </xsl:when>
  7439. <xsl:otherwise>
  7440. <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[position()=$row-no]">
  7441. <xsl:for-each select="表:单元格[position()=$cell-no]">
  7442. <xsl:value-of select="表:数据/字:句/字:文本串"/>
  7443. </xsl:for-each>
  7444. </xsl:for-each>
  7445. </xsl:otherwise>
  7446. </xsl:choose>
  7447. </xsl:variable>
  7448. <xsl:attribute name="office:value"><xsl:value-of select="$cell-content"/></xsl:attribute>
  7449. <text:p>
  7450. <xsl:value-of select="$cell-content"/>
  7451. </text:p>
  7452. </table:table-cell>
  7453. </xsl:otherwise>
  7454. </xsl:choose>
  7455. <xsl:call-template name="表:本地表_行_单元格">
  7456. <xsl:with-param name="table-name" select="$table-name"/>
  7457. <xsl:with-param name="table-type" select="$table-type"/>
  7458. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7459. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7460. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7461. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7462. <xsl:with-param name="series-value-current" select="$series-value-current"/>
  7463. <xsl:with-param name="row-current" select="$row-current"/>
  7464. <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
  7465. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7466. </xsl:call-template>
  7467. </xsl:otherwise>
  7468. </xsl:choose>
  7469. </xsl:template>
  7470. <xsl:template name="表:数据组">
  7471. <xsl:param name="table-name"/>
  7472. <xsl:param name="table-type"/>
  7473. <xsl:param name="table-subtype"/>
  7474. <xsl:param name="series-value-start"/>
  7475. <xsl:param name="series-value-end"/>
  7476. <xsl:param name="series-generate-type"/>
  7477. <xsl:variable name="input-char-start">
  7478. <xsl:choose>
  7479. <xsl:when test="$series-generate-type='row'">
  7480. <xsl:value-of select="substring(substring-after($series-value-start,'!'),1,1)"/>
  7481. </xsl:when>
  7482. <xsl:otherwise>
  7483. <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
  7484. </xsl:otherwise>
  7485. </xsl:choose>
  7486. </xsl:variable>
  7487. <xsl:variable name="input-char-end">
  7488. <xsl:choose>
  7489. <xsl:when test="$series-generate-type='row'">
  7490. <xsl:value-of select="substring(substring-after($series-value-start,':'),1,1)"/>
  7491. </xsl:when>
  7492. <xsl:otherwise>
  7493. <xsl:value-of select="substring(substring-after($series-value-start,':'),2)"/>
  7494. </xsl:otherwise>
  7495. </xsl:choose>
  7496. </xsl:variable>
  7497. <xsl:variable name="cell-start">
  7498. <xsl:call-template name="General-Char-Transition">
  7499. <xsl:with-param name="input-char" select="$input-char-start"/>
  7500. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7501. </xsl:call-template>
  7502. </xsl:variable>
  7503. <xsl:variable name="cell-end">
  7504. <xsl:call-template name="General-Char-Transition">
  7505. <xsl:with-param name="input-char" select="$input-char-end"/>
  7506. <xsl:with-param name="output-type" select="'ARABIC'"/>
  7507. </xsl:call-template>
  7508. </xsl:variable>
  7509. <xsl:variable name="fixed-cell-sum">
  7510. <xsl:value-of select="$cell-end -$cell-start +1"/>
  7511. </xsl:variable>
  7512. <xsl:for-each select="表:数据系列集/表:数据系列">
  7513. <chart:series>
  7514. <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-series',position())"/></xsl:attribute>
  7515. <xsl:call-template name="表:数据点">
  7516. <xsl:with-param name="table-name" select="$table-name"/>
  7517. <xsl:with-param name="table-type" select="$table-type"/>
  7518. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7519. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7520. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7521. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7522. <xsl:with-param name="data-series-current" select="position()"/>
  7523. <xsl:with-param name="cell-current" select="'1'"/>
  7524. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7525. </xsl:call-template>
  7526. </chart:series>
  7527. </xsl:for-each>
  7528. </xsl:template>
  7529. <xsl:template name="表:数据点">
  7530. <xsl:param name="table-name"/>
  7531. <xsl:param name="table-type"/>
  7532. <xsl:param name="table-subtype"/>
  7533. <xsl:param name="series-value-start"/>
  7534. <xsl:param name="series-value-end"/>
  7535. <xsl:param name="series-generate-type"/>
  7536. <xsl:param name="data-series-current"/>
  7537. <xsl:param name="cell-current"/>
  7538. <xsl:param name="fixed-cell-sum"/>
  7539. <xsl:choose>
  7540. <xsl:when test="$cell-current>$fixed-cell-sum"/>
  7541. <xsl:otherwise>
  7542. <chart:data-point>
  7543. <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-point',$data-series-current,$cell-current)"/></xsl:attribute>
  7544. </chart:data-point>
  7545. <xsl:call-template name="表:数据点">
  7546. <xsl:with-param name="table-name" select="$table-name"/>
  7547. <xsl:with-param name="table-type" select="$table-type"/>
  7548. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7549. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7550. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7551. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7552. <xsl:with-param name="data-series-current" select="$data-series-current"/>
  7553. <xsl:with-param name="cell-current" select="$cell-current +1"/>
  7554. <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
  7555. </xsl:call-template>
  7556. </xsl:otherwise>
  7557. </xsl:choose>
  7558. </xsl:template>
  7559. <xsl:template name="表:图表区式样">
  7560. <xsl:param name="table-name"/>
  7561. <xsl:param name="table-type"/>
  7562. <xsl:param name="table-subtype"/>
  7563. <xsl:param name="series-value-start"/>
  7564. <xsl:param name="series-value-end"/>
  7565. <xsl:param name="series-generate-type"/>
  7566. <style:style style:name="chart-area" style:family="chart">
  7567. <xsl:for-each select="node()">
  7568. <xsl:choose>
  7569. <xsl:when test="name(.)='表:边框'">
  7570. <style:graphic-properties>
  7571. <xsl:call-template name="uof:边框"/>
  7572. </style:graphic-properties>
  7573. </xsl:when>
  7574. <xsl:when test="name(.)='表:填充'">
  7575. <style:graphic-properties>
  7576. <xsl:call-template name="图:填充类型"/>
  7577. </style:graphic-properties>
  7578. </xsl:when>
  7579. <xsl:when test="name(.)='表:字体'">
  7580. <style:text-properties>
  7581. <xsl:call-template name="字:句属性类型"/>
  7582. </style:text-properties>
  7583. </xsl:when>
  7584. </xsl:choose>
  7585. </xsl:for-each>
  7586. </style:style>
  7587. </xsl:template>
  7588. <xsl:template name="表:绘图区式样">
  7589. <xsl:param name="table-name"/>
  7590. <xsl:param name="table-type"/>
  7591. <xsl:param name="table-subtype"/>
  7592. <xsl:param name="series-value-start"/>
  7593. <xsl:param name="series-value-end"/>
  7594. <xsl:param name="series-generate-type"/>
  7595. <style:style style:name="plot-area" style:family="chart">
  7596. <style:chart-properties>
  7597. <xsl:choose>
  7598. <xsl:when test="$table-subtype='bar_stacked' or $table-subtype='column_stacked' or $table-subtype='line_stacked'">
  7599. <xsl:attribute name="chart:stacked">true</xsl:attribute>
  7600. </xsl:when>
  7601. <xsl:when test="$table-subtype='bar_percent' or $table-subtype='column_percent' or $table-subtype='line_percent'">
  7602. <xsl:attribute name="chart:percentage">true</xsl:attribute>
  7603. </xsl:when>
  7604. </xsl:choose>
  7605. <xsl:attribute name="chart:vertical"><xsl:choose><xsl:when test="$table-type='bar'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
  7606. <xsl:attribute name="chart:series-source"><xsl:choose><xsl:when test="$series-generate-type='row'">rows</xsl:when><xsl:otherwise>columns</xsl:otherwise></xsl:choose></xsl:attribute>
  7607. </style:chart-properties>
  7608. </style:style>
  7609. </xsl:template>
  7610. <xsl:template name="表:图表背景墙式样">
  7611. <xsl:param name="table-name"/>
  7612. <xsl:param name="table-type"/>
  7613. <xsl:param name="table-subtype"/>
  7614. <xsl:param name="series-value-start"/>
  7615. <xsl:param name="series-value-end"/>
  7616. <xsl:param name="series-generate-type"/>
  7617. <style:style style:name="chart-wall" style:family="chart">
  7618. <style:graphic-properties>
  7619. <xsl:for-each select="node()">
  7620. <xsl:choose>
  7621. <xsl:when test="name(.)='表:边框'">
  7622. <xsl:call-template name="uof:边框"/>
  7623. </xsl:when>
  7624. <xsl:when test="name(.)='表:填充'">
  7625. <xsl:call-template name="图:填充类型"/>
  7626. </xsl:when>
  7627. </xsl:choose>
  7628. </xsl:for-each>
  7629. </style:graphic-properties>
  7630. </style:style>
  7631. </xsl:template>
  7632. <xsl:template name="表:分类轴式样">
  7633. <xsl:param name="table-name"/>
  7634. <xsl:param name="table-type"/>
  7635. <xsl:param name="table-subtype"/>
  7636. <xsl:param name="series-value-start"/>
  7637. <xsl:param name="series-value-end"/>
  7638. <xsl:param name="series-generate-type"/>
  7639. <style:style style:name="category-axis" style:family="chart">
  7640. <xsl:call-template name="表:坐标轴类型">
  7641. <xsl:with-param name="table-name" select="$table-name"/>
  7642. <xsl:with-param name="table-type" select="$table-type"/>
  7643. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7644. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7645. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7646. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7647. <xsl:with-param name="axis-type" select="'category axis'"/>
  7648. </xsl:call-template>
  7649. </style:style>
  7650. </xsl:template>
  7651. <xsl:template name="表:数值轴式样">
  7652. <xsl:param name="table-name"/>
  7653. <xsl:param name="table-type"/>
  7654. <xsl:param name="table-subtype"/>
  7655. <xsl:param name="series-value-start"/>
  7656. <xsl:param name="series-value-end"/>
  7657. <xsl:param name="series-generate-type"/>
  7658. <style:style style:name="value-axis" style:family="chart">
  7659. <xsl:call-template name="表:坐标轴类型">
  7660. <xsl:with-param name="table-name" select="$table-name"/>
  7661. <xsl:with-param name="table-type" select="$table-type"/>
  7662. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7663. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7664. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7665. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7666. <xsl:with-param name="axis-type" select="'value axis'"/>
  7667. </xsl:call-template>
  7668. </style:style>
  7669. </xsl:template>
  7670. <xsl:template name="表:图例式样">
  7671. <xsl:param name="table-name"/>
  7672. <xsl:param name="table-type"/>
  7673. <xsl:param name="table-subtype"/>
  7674. <xsl:param name="series-value-start"/>
  7675. <xsl:param name="series-value-end"/>
  7676. <xsl:param name="series-generate-type"/>
  7677. <style:style style:name="legend" style:family="chart">
  7678. <xsl:for-each select="node()">
  7679. <xsl:choose>
  7680. <xsl:when test="name(.)='表:边框'">
  7681. <style:graphic-properties>
  7682. <xsl:call-template name="uof:边框"/>
  7683. </style:graphic-properties>
  7684. </xsl:when>
  7685. <xsl:when test="name(.)='表:填充'">
  7686. <style:graphic-properties>
  7687. <xsl:call-template name="图:填充类型"/>
  7688. </style:graphic-properties>
  7689. </xsl:when>
  7690. <xsl:when test="name(.)='表:字体'">
  7691. <style:text-properties>
  7692. <xsl:call-template name="字:句属性类型"/>
  7693. </style:text-properties>
  7694. </xsl:when>
  7695. </xsl:choose>
  7696. </xsl:for-each>
  7697. </style:style>
  7698. </xsl:template>
  7699. <xsl:template name="表:数据表式样">
  7700. <xsl:param name="table-name"/>
  7701. <xsl:param name="table-type"/>
  7702. <xsl:param name="table-subtype"/>
  7703. <xsl:param name="series-value-start"/>
  7704. <xsl:param name="series-value-end"/>
  7705. <xsl:param name="series-generate-type"/>
  7706. <style:style style:name="data-table" style:family="chart">
  7707. <xsl:for-each select="node()">
  7708. <xsl:choose>
  7709. <xsl:when test="name(.)='表:边框'">
  7710. <style:graphic-properties>
  7711. <xsl:call-template name="uof:边框"/>
  7712. </style:graphic-properties>
  7713. </xsl:when>
  7714. <xsl:when test="name(.)='表:填充'">
  7715. <style:graphic-properties>
  7716. <xsl:call-template name="图:填充类型"/>
  7717. </style:graphic-properties>
  7718. </xsl:when>
  7719. <xsl:when test="name(.)='表:字体'">
  7720. <style:text-properties>
  7721. <xsl:call-template name="字:句属性类型"/>
  7722. </style:text-properties>
  7723. </xsl:when>
  7724. </xsl:choose>
  7725. </xsl:for-each>
  7726. </style:style>
  7727. </xsl:template>
  7728. <xsl:template name="表:数据系列集式样">
  7729. <xsl:param name="table-name"/>
  7730. <xsl:param name="table-type"/>
  7731. <xsl:param name="table-subtype"/>
  7732. <xsl:param name="series-value-start"/>
  7733. <xsl:param name="series-value-end"/>
  7734. <xsl:param name="series-generate-type"/>
  7735. <xsl:for-each select="表:数据系列">
  7736. <style:style style:family="chart">
  7737. <xsl:variable name="current-position" select="position()"/>
  7738. <xsl:attribute name="style:name"><xsl:value-of select="concat('data-series',$current-position)"/></xsl:attribute>
  7739. <xsl:call-template name="表:数据点类型">
  7740. <xsl:with-param name="table-name" select="$table-name"/>
  7741. <xsl:with-param name="table-type" select="$table-type"/>
  7742. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7743. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7744. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7745. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7746. <xsl:with-param name="recall-type" select="'data-series'"/>
  7747. </xsl:call-template>
  7748. </style:style>
  7749. </xsl:for-each>
  7750. </xsl:template>
  7751. <xsl:template name="表:数据点集式样">
  7752. <xsl:param name="table-name"/>
  7753. <xsl:param name="table-type"/>
  7754. <xsl:param name="table-subtype"/>
  7755. <xsl:param name="series-value-start"/>
  7756. <xsl:param name="series-value-end"/>
  7757. <xsl:param name="series-generate-type"/>
  7758. <xsl:for-each select="表:数据点">
  7759. <style:style style:family="chart">
  7760. <xsl:attribute name="style:name"><xsl:value-of select="concat('data-point',@表:系列,@表:点)"/></xsl:attribute>
  7761. <xsl:call-template name="表:数据点类型">
  7762. <xsl:with-param name="table-name" select="$table-name"/>
  7763. <xsl:with-param name="table-type" select="$table-type"/>
  7764. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7765. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7766. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7767. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7768. <xsl:with-param name="recall-type" select="'data-point'"/>
  7769. </xsl:call-template>
  7770. </style:style>
  7771. </xsl:for-each>
  7772. </xsl:template>
  7773. <xsl:template name="表:网格线集式样">
  7774. <xsl:param name="table-name"/>
  7775. <xsl:param name="table-type"/>
  7776. <xsl:param name="table-subtype"/>
  7777. <xsl:param name="series-value-start"/>
  7778. <xsl:param name="series-value-end"/>
  7779. <xsl:param name="series-generate-type"/>
  7780. <xsl:for-each select="表:网格线">
  7781. <xsl:choose>
  7782. <xsl:when test="@表:位置='category axis'">
  7783. <style:style style:name="category-axis-grid" style:family="chart">
  7784. <style:graphic-properties>
  7785. <xsl:call-template name="uof:边框"/>
  7786. </style:graphic-properties>
  7787. </style:style>
  7788. </xsl:when>
  7789. <xsl:when test="@表:位置='value axis'">
  7790. <style:style style:name="value-axis-grid" style:family="chart">
  7791. <style:graphic-properties>
  7792. <xsl:call-template name="uof:边框"/>
  7793. </style:graphic-properties>
  7794. </style:style>
  7795. </xsl:when>
  7796. <xsl:otherwise/>
  7797. </xsl:choose>
  7798. </xsl:for-each>
  7799. </xsl:template>
  7800. <xsl:template name="表:数据源式样">
  7801. <xsl:param name="table-name"/>
  7802. <xsl:param name="table-type"/>
  7803. <xsl:param name="table-subtype"/>
  7804. <xsl:param name="series-value-start"/>
  7805. <xsl:param name="series-value-end"/>
  7806. <xsl:param name="series-generate-type"/>
  7807. <xsl:for-each select="表:系列">
  7808. <style:style style:family="chart">
  7809. <xsl:variable name="current-position" select="position()"/>
  7810. <xsl:attribute name="style:name"><xsl:value-of select="concat('data-source',$current-position)"/></xsl:attribute>
  7811. </style:style>
  7812. </xsl:for-each>
  7813. </xsl:template>
  7814. <xsl:template name="表:标题集式样">
  7815. <xsl:param name="table-name"/>
  7816. <xsl:param name="table-type"/>
  7817. <xsl:param name="table-subtype"/>
  7818. <xsl:param name="series-value-start"/>
  7819. <xsl:param name="series-value-end"/>
  7820. <xsl:param name="series-generate-type"/>
  7821. <xsl:for-each select="表:标题">
  7822. <xsl:choose>
  7823. <xsl:when test="@表:位置='chart'">
  7824. <style:style style:name="chart-title" style:family="chart">
  7825. <xsl:call-template name="表:标题类型">
  7826. <xsl:with-param name="table-name" select="$table-name"/>
  7827. <xsl:with-param name="table-type" select="$table-type"/>
  7828. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7829. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7830. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7831. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7832. </xsl:call-template>
  7833. </style:style>
  7834. </xsl:when>
  7835. <xsl:when test="@表:位置='category axis'">
  7836. <style:style style:name="category-axis-title" style:family="chart">
  7837. <xsl:call-template name="表:标题类型">
  7838. <xsl:with-param name="table-name" select="$table-name"/>
  7839. <xsl:with-param name="table-type" select="$table-type"/>
  7840. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7841. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7842. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7843. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7844. </xsl:call-template>
  7845. </style:style>
  7846. </xsl:when>
  7847. <xsl:when test="@表:位置='value axis'">
  7848. <style:style style:name="value-axis-title" style:family="chart">
  7849. <xsl:call-template name="表:标题类型">
  7850. <xsl:with-param name="table-name" select="$table-name"/>
  7851. <xsl:with-param name="table-type" select="$table-type"/>
  7852. <xsl:with-param name="table-subtype" select="$table-subtype"/>
  7853. <xsl:with-param name="series-value-start" select="$series-value-start"/>
  7854. <xsl:with-param name="series-value-end" select="$series-value-end"/>
  7855. <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
  7856. </xsl:call-template>
  7857. </style:style>
  7858. </xsl:when>
  7859. <xsl:otherwise/>
  7860. </xsl:choose>
  7861. </xsl:for-each>
  7862. </xsl:template>
  7863. <xsl:template name="表:坐标轴类型">
  7864. <xsl:param name="table-name"/>
  7865. <xsl:param name="table-type"/>
  7866. <xsl:param name="table-subtype"/>
  7867. <xsl:param name="series-value-start"/>
  7868. <xsl:param name="series-value-end"/>
  7869. <xsl:param name="series-generate-type"/>
  7870. <xsl:param name="axis-type"/>
  7871. <style:chart-properties>
  7872. <xsl:choose>
  7873. <xsl:when test="@表:主刻度类型='cross'">
  7874. <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
  7875. <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
  7876. </xsl:when>
  7877. <xsl:when test="@表:主刻度类型='inside'">
  7878. <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
  7879. <xsl:attribute name="chart:tick-marks-major-outer">false</xsl:attribute>
  7880. </xsl:when>
  7881. <xsl:when test="@表:主刻度类型='outside'">
  7882. <xsl:attribute name="chart:tick-marks-major-inner">false</xsl:attribute>
  7883. <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
  7884. </xsl:when>
  7885. <xsl:otherwise/>
  7886. </xsl:choose>
  7887. <xsl:choose>
  7888. <xsl:when test="@表:次刻度类型='cross'">
  7889. <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
  7890. <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
  7891. </xsl:when>
  7892. <xsl:when test="@表:次刻度类型='inside'">
  7893. <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
  7894. <xsl:attribute name="chart:tick-marks-minor-outer">false</xsl:attribute>
  7895. </xsl:when>
  7896. <xsl:when test="@表:次刻度类型='outside'">
  7897. <xsl:attribute name="chart:tick-marks-minor-inner">false</xsl:attribute>
  7898. <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
  7899. </xsl:when>
  7900. <xsl:otherwise/>
  7901. </xsl:choose>
  7902. <xsl:if test="@表:刻度线标志='next to axis'">
  7903. <xsl:attribute name="chart:display-label">true</xsl:attribute>
  7904. </xsl:if>
  7905. <xsl:for-each select="node()">
  7906. <xsl:choose>
  7907. <xsl:when test="name(.)='表:线型'">
  7908. <xsl:call-template name="uof:线型"/>
  7909. </xsl:when>
  7910. <xsl:when test="name(.)='表:数值'">
  7911. <xsl:attribute name="chart:link-data-style-to-source"><xsl:value-of select="@表:链接到源"/></xsl:attribute>
  7912. </xsl:when>
  7913. <xsl:when test="name(.)='表:刻度'">
  7914. <xsl:call-template name="表:刻度类型"/>
  7915. </xsl:when>
  7916. <xsl:when test="name(.)='表:对齐'">
  7917. <xsl:if test="表:文字方向">
  7918. <xsl:attribute name="fo:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
  7919. </xsl:if>
  7920. <xsl:if test="表:旋转角度">
  7921. <xsl:attribute name="text:rotation-angle"><xsl:value-of select="表:旋转角度"/></xsl:attribute>
  7922. </xsl:if>
  7923. </xsl:when>
  7924. </xsl:choose>
  7925. </xsl:for-each>
  7926. </style:chart-properties>
  7927. <xsl:if test="表:字体">
  7928. <xsl:for-each select="表:字体">
  7929. <xsl:element name="style:text-properties">
  7930. <xsl:call-template name="字:句属性类型"/>
  7931. </xsl:element>
  7932. </xsl:for-each>
  7933. </xsl:if>
  7934. </xsl:template>
  7935. <xsl:template name="表:数据点类型">
  7936. <xsl:param name="table-name"/>
  7937. <xsl:param name="table-type"/>
  7938. <xsl:param name="table-subtype"/>
  7939. <xsl:param name="series-value-start"/>
  7940. <xsl:param name="series-value-end"/>
  7941. <xsl:param name="series-generate-type"/>
  7942. <xsl:param name="recall-type"/>
  7943. <xsl:if test="name(.)='表:数据点'">
  7944. <style:chart-properties>
  7945. <xsl:if test="$table-type='pie' and $table-subtype='pie_offset1' and @表:点='1'">
  7946. <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
  7947. </xsl:if>
  7948. <xsl:if test="$table-type='pie' and $table-subtype='pie_offset2'">
  7949. <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
  7950. </xsl:if>
  7951. </style:chart-properties>
  7952. </xsl:if>
  7953. <xsl:for-each select="node()">
  7954. <xsl:choose>
  7955. <xsl:when test="name(.)='表:边框'">
  7956. <style:graphic-properties>
  7957. <xsl:call-template name="uof:边框"/>
  7958. </style:graphic-properties>
  7959. </xsl:when>
  7960. <xsl:when test="name(.)='表:填充'">
  7961. <style:graphic-properties>
  7962. <xsl:call-template name="图:填充类型"/>
  7963. </style:graphic-properties>
  7964. </xsl:when>
  7965. <xsl:when test="name(.)='表:字体'">
  7966. <style:text-properties>
  7967. <xsl:call-template name="字:句属性类型"/>
  7968. </style:text-properties>
  7969. </xsl:when>
  7970. <xsl:when test="name(.)='表:显示标志'">
  7971. <style:chart-properties>
  7972. <xsl:if test="@表:类别名">
  7973. <xsl:attribute name="chart:data-label-text"><xsl:value-of select="@表:类别名"/></xsl:attribute>
  7974. </xsl:if>
  7975. <xsl:if test="@表:数值">
  7976. <xsl:attribute name="chart:data-label-number">value</xsl:attribute>
  7977. </xsl:if>
  7978. <xsl:if test="@表:百分数">
  7979. <xsl:attribute name="chart:data-label-number">percentage</xsl:attribute>
  7980. </xsl:if>
  7981. <xsl:if test="@表:图例标志">
  7982. <xsl:attribute name="chart:data-label-symbol"><xsl:value-of select="@表:图例标志"/></xsl:attribute>
  7983. </xsl:if>
  7984. </style:chart-properties>
  7985. </xsl:when>
  7986. </xsl:choose>
  7987. </xsl:for-each>
  7988. </xsl:template>
  7989. <xsl:template name="表:标题类型">
  7990. <xsl:param name="table-name"/>
  7991. <xsl:param name="table-type"/>
  7992. <xsl:param name="table-subtype"/>
  7993. <xsl:param name="series-value-start"/>
  7994. <xsl:param name="series-value-end"/>
  7995. <xsl:param name="series-generate-type"/>
  7996. <xsl:for-each select="node()">
  7997. <xsl:choose>
  7998. <xsl:when test="name(.)='表:边框'">
  7999. <style:graphic-properties>
  8000. <xsl:call-template name="uof:边框"/>
  8001. </style:graphic-properties>
  8002. </xsl:when>
  8003. <xsl:when test="name(.)='表:填充'">
  8004. <style:graphic-properties>
  8005. <xsl:call-template name="图:填充类型"/>
  8006. </style:graphic-properties>
  8007. </xsl:when>
  8008. <xsl:when test="name(.)='表:对齐'">
  8009. <style:chart-properties>
  8010. <xsl:call-template name="表:对齐格式类型"/>
  8011. </style:chart-properties>
  8012. </xsl:when>
  8013. <xsl:when test="name(.)='表:字体'">
  8014. <style:text-properties>
  8015. <xsl:call-template name="字:句属性类型"/>
  8016. </style:text-properties>
  8017. </xsl:when>
  8018. </xsl:choose>
  8019. </xsl:for-each>
  8020. </xsl:template>
  8021. <xsl:template name="uof:边框">
  8022. <xsl:if test="@uof:类型">
  8023. <xsl:variable name="type" select="@uof:类型"/>
  8024. <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="@uof:类型='single'">solid</xsl:when><xsl:when test="@uof:类型='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
  8025. <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
  8026. </xsl:if>
  8027. <xsl:if test="@uof:宽度">
  8028. <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
  8029. </xsl:if>
  8030. <xsl:if test="@uof:颜色">
  8031. <xsl:attribute name="svg:stroke-color"><xsl:value-of select="@uof:颜色"/></xsl:attribute>
  8032. </xsl:if>
  8033. </xsl:template>
  8034. <xsl:template name="图:填充类型">
  8035. <xsl:if test="图:颜色">
  8036. <xsl:attribute name="draw:fill">solid</xsl:attribute>
  8037. <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
  8038. </xsl:if>
  8039. <xsl:if test="图:图片">
  8040. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  8041. <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:图片/@图:名称"/></xsl:attribute>
  8042. <xsl:if test="not(图:图片/@图:位置='tile')">
  8043. <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
  8044. </xsl:if>
  8045. </xsl:if>
  8046. <xsl:if test="图:图案">
  8047. <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
  8048. <xsl:attribute name="draw:fill-hatch-name"><xsl:value-of select="图:图案/@图:图形引用"/></xsl:attribute>
  8049. </xsl:if>
  8050. <xsl:if test="图:渐变">
  8051. <xsl:attribute name="draw:fill">gradient</xsl:attribute>
  8052. <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="图:渐变/@图:图形引用"/></xsl:attribute>
  8053. </xsl:if>
  8054. </xsl:template>
  8055. <xsl:template name="uof:线型">
  8056. <xsl:call-template name="uof:边框"/>
  8057. </xsl:template>
  8058. <xsl:template name="字:句属性类型">
  8059. <xsl:apply-templates select="./*"/>
  8060. </xsl:template>
  8061. <xsl:template name="表:刻度类型">
  8062. <xsl:if test="表:最小值">
  8063. <xsl:attribute name="chart:minimum"><xsl:value-of select="表:最小值"/></xsl:attribute>
  8064. </xsl:if>
  8065. <xsl:if test="表:最大值">
  8066. <xsl:attribute name="chart:maximum"><xsl:value-of select="表:最大值"/></xsl:attribute>
  8067. </xsl:if>
  8068. <xsl:if test="表:主单位">
  8069. <xsl:attribute name="chart:interval-major"><xsl:value-of select="表:主单位"/></xsl:attribute>
  8070. </xsl:if>
  8071. <xsl:if test="表:次单位">
  8072. <xsl:attribute name="chart:interval-minor"><xsl:value-of select="表:次单位"/></xsl:attribute>
  8073. </xsl:if>
  8074. <xsl:if test="表:分类交叉点">
  8075. <xsl:attribute name="chart:origin"><xsl:value-of select="表:分类交叉点"/></xsl:attribute>
  8076. </xsl:if>
  8077. </xsl:template>
  8078. <xsl:template name="表:对齐格式类型">
  8079. <xsl:if test="表:文字方向">
  8080. <xsl:attribute name="style:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
  8081. </xsl:if>
  8082. <xsl:if test="表:文字旋转角度">
  8083. <xsl:attribute name="style:rotation-angle"><xsl:value-of select="表:文字旋转角度"/></xsl:attribute>
  8084. </xsl:if>
  8085. </xsl:template>
  8086. <xsl:template match="字:字体">
  8087. <xsl:if test="@字:字号">
  8088. <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  8089. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  8090. <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
  8091. </xsl:if>
  8092. <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
  8093. <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
  8094. <xsl:variable name="zihao">
  8095. <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
  8096. <xsl:value-of select="字:字体/@字:字号"/>
  8097. </xsl:for-each>
  8098. </xsl:variable>
  8099. <xsl:variable name="font-size" select="@字:相对字号"/>
  8100. <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  8101. <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  8102. <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
  8103. </xsl:if>
  8104. <xsl:if test="@字:颜色">
  8105. <xsl:attribute name="fo:color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
  8106. </xsl:if>
  8107. <xsl:if test="@字:中文字体引用">
  8108. <xsl:attribute name="style:font-family-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
  8109. </xsl:if>
  8110. <xsl:if test="@字:西文字体引用">
  8111. <xsl:attribute name="fo:font-family"><xsl:value-of select="@字:西文字体引用"/></xsl:attribute>
  8112. </xsl:if>
  8113. </xsl:template>
  8114. <xsl:template match="字:斜体">
  8115. <xsl:if test="@字:值='true'">
  8116. <xsl:attribute name="fo:font-style">italic</xsl:attribute>
  8117. <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
  8118. <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
  8119. <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
  8120. </xsl:if>
  8121. </xsl:template>
  8122. <xsl:template match="字:粗体">
  8123. <xsl:if test="@字:值='true'">
  8124. <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
  8125. <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
  8126. <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
  8127. </xsl:if>
  8128. </xsl:template>
  8129. <xsl:template match="字:下划线">
  8130. <xsl:choose>
  8131. <xsl:when test="@字:类型 = 'single'">
  8132. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  8133. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8134. </xsl:when>
  8135. <xsl:when test="@字:类型 = 'double'">
  8136. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  8137. <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
  8138. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8139. </xsl:when>
  8140. <xsl:when test="@字:类型 = 'thick'">
  8141. <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
  8142. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8143. </xsl:when>
  8144. <xsl:when test="@字:类型 = 'dotted'">
  8145. <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
  8146. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8147. </xsl:when>
  8148. <xsl:when test="@字:类型 = 'dotted-heavy'">
  8149. <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
  8150. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8151. </xsl:when>
  8152. <xsl:when test="@字:类型 = 'dash'">
  8153. <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
  8154. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8155. </xsl:when>
  8156. <xsl:when test="@字:类型 = 'dashed-heavy'">
  8157. <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
  8158. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8159. </xsl:when>
  8160. <xsl:when test="@字:类型 = 'dash-long'">
  8161. <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
  8162. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8163. </xsl:when>
  8164. <xsl:when test="@字:类型 = 'dash-long-heavy'">
  8165. <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
  8166. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8167. </xsl:when>
  8168. <xsl:when test="@字:类型 = 'dot-dash'">
  8169. <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
  8170. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8171. </xsl:when>
  8172. <xsl:when test="@字:类型 = 'dash-dot-heavy'">
  8173. <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
  8174. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8175. </xsl:when>
  8176. <xsl:when test="@字:类型 = 'dot-dot-dash'">
  8177. <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
  8178. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8179. </xsl:when>
  8180. <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
  8181. <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
  8182. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8183. </xsl:when>
  8184. <xsl:when test="@字:类型 = 'wave'">
  8185. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  8186. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8187. </xsl:when>
  8188. <xsl:when test="@字:类型 = 'wavy-heavy'">
  8189. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  8190. <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
  8191. </xsl:when>
  8192. <xsl:when test="@字:类型 = 'wavy-double'">
  8193. <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
  8194. <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
  8195. <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
  8196. </xsl:when>
  8197. <xsl:otherwise/>
  8198. </xsl:choose>
  8199. <xsl:choose>
  8200. <xsl:when test="@字:颜色">
  8201. <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
  8202. </xsl:when>
  8203. <xsl:otherwise>
  8204. <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
  8205. </xsl:otherwise>
  8206. </xsl:choose>
  8207. </xsl:template>
  8208. <xsl:template match="字:着重号">
  8209. <xsl:if test="not(@字:类型='none')">
  8210. <xsl:choose>
  8211. <xsl:when test="@字:类型='accent above' ">
  8212. <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
  8213. </xsl:when>
  8214. <xsl:when test="@字:类型='dot above' ">
  8215. <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
  8216. </xsl:when>
  8217. <xsl:when test="@字:类型='disc above' ">
  8218. <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
  8219. </xsl:when>
  8220. <xsl:when test="@字:类型='circle above' ">
  8221. <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
  8222. </xsl:when>
  8223. <xsl:when test="@字:类型='accent below' ">
  8224. <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
  8225. </xsl:when>
  8226. <xsl:when test="@字:类型='dot below' ">
  8227. <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
  8228. </xsl:when>
  8229. <xsl:when test="@字:类型='disc below' ">
  8230. <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
  8231. </xsl:when>
  8232. <xsl:when test="@字:类型='circle below' ">
  8233. <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
  8234. </xsl:when>
  8235. </xsl:choose>
  8236. </xsl:if>
  8237. <xsl:if test="字:颜色">
  8238. <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
  8239. </xsl:if>
  8240. </xsl:template>
  8241. <xsl:template match="字:隐藏文字">
  8242. <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
  8243. </xsl:template>
  8244. <xsl:template match="字:空心">
  8245. <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
  8246. </xsl:template>
  8247. <xsl:template match="字:阴影">
  8248. <xsl:if test="not(@字:值='false')">
  8249. <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
  8250. </xsl:if>
  8251. </xsl:template>
  8252. <xsl:template match="字:删除线">
  8253. <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
  8254. <xsl:choose>
  8255. <xsl:when test="@字:类型='double'">
  8256. <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
  8257. </xsl:when>
  8258. <xsl:when test="@字:类型='single'">
  8259. <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
  8260. <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
  8261. </xsl:when>
  8262. <xsl:when test="@字:类型='bold'">
  8263. <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
  8264. </xsl:when>
  8265. <xsl:when test="@字:类型='带/'">
  8266. <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
  8267. </xsl:when>
  8268. <xsl:when test="@字:类型='带X'">
  8269. <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
  8270. </xsl:when>
  8271. <xsl:otherwise/>
  8272. </xsl:choose>
  8273. </xsl:template>
  8274. <xsl:template match="@字:颜色[not(.='auto')]">
  8275. <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
  8276. </xsl:template>
  8277. <xsl:template match="字:浮雕">
  8278. <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
  8279. </xsl:template>
  8280. <xsl:template match="字:醒目字体">
  8281. <xsl:choose>
  8282. <xsl:when test="@字:类型='small-caps'">
  8283. <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
  8284. </xsl:when>
  8285. <xsl:when test="@字:类型='none'">
  8286. <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
  8287. <xsl:attribute name="fo:text-transform">none</xsl:attribute>
  8288. </xsl:when>
  8289. <xsl:otherwise>
  8290. <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
  8291. </xsl:otherwise>
  8292. </xsl:choose>
  8293. </xsl:template>
  8294. <xsl:template match="字:位置">
  8295. <xsl:attribute name="style:text-position"><xsl:value-of select="."/></xsl:attribute>
  8296. </xsl:template>
  8297. <xsl:template match="字:缩放">
  8298. <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
  8299. </xsl:template>
  8300. <xsl:template match="字:字符间距">
  8301. <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/></xsl:attribute>
  8302. </xsl:template>
  8303. <xsl:template match="字:调整字间距">
  8304. <xsl:attribute name="style:letter-kerning"><xsl:value-of select="."/></xsl:attribute>
  8305. </xsl:template>
  8306. <xsl:template match="字:外框">
  8307. <xsl:attribute name="style:text-outline">true</xsl:attribute>
  8308. </xsl:template>
  8309. <xsl:template match="字:缩放">
  8310. <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
  8311. </xsl:template>
  8312. <xsl:template match="字:字符间距[parent::字:句属性]">
  8313. <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( number(.)* $other-to-cm-conversion-factor, $uofUnit)"/></xsl:attribute>
  8314. </xsl:template>
  8315. <xsl:template name="General-Char-Transition">
  8316. <xsl:param name="input-char"/>
  8317. <xsl:param name="output-type"/>
  8318. <xsl:choose>
  8319. <xsl:when test="$input-char='A' or $input-char='a' or $input-char='1' or $input-char='Roman_I' or $input-char='Roman_i' or $input-char='一' or $input-char='壹' or $input-char='甲' or $input-char='子'">
  8320. <xsl:choose>
  8321. <xsl:when test="$output-type='ARABIC'">1</xsl:when>
  8322. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
  8323. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
  8324. <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
  8325. <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
  8326. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
  8327. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
  8328. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
  8329. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
  8330. <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
  8331. <xsl:when test="$output-type='TIAN_GAN_ZH'">甲</xsl:when>
  8332. <xsl:when test="$output-type='DI_ZI_ZH'">子</xsl:when>
  8333. <xsl:otherwise>1</xsl:otherwise>
  8334. </xsl:choose>
  8335. </xsl:when>
  8336. <xsl:when test="$input-char='B' or $input-char='b' or $input-char='2' or $input-char='Roman_II' or $input-char='Roman_ii' or $input-char='二' or $input-char='贰' or $input-char='乙' or $input-char='丑'">
  8337. <xsl:choose>
  8338. <xsl:when test="$output-type='ARABIC'">2</xsl:when>
  8339. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">b</xsl:when>
  8340. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">B</xsl:when>
  8341. <xsl:when test="$output-type='ROMAN_UPPER'">II</xsl:when>
  8342. <xsl:when test="$output-type='ROMAN_LOWER'">ii</xsl:when>
  8343. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">2</xsl:when>
  8344. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二</xsl:when>
  8345. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">2</xsl:when>
  8346. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰</xsl:when>
  8347. <xsl:when test="$output-type='CIRCLE_NUMBER'">2</xsl:when>
  8348. <xsl:when test="$output-type='TIAN_GAN_ZH'">乙</xsl:when>
  8349. <xsl:when test="$output-type='DI_ZI_ZH'">丑</xsl:when>
  8350. <xsl:otherwise>2</xsl:otherwise>
  8351. </xsl:choose>
  8352. </xsl:when>
  8353. <xsl:when test="$input-char='C' or $input-char='c' or $input-char='3' or $input-char='Roman_III' or $input-char='Roman_iii' or $input-char='三' or $input-char='叁' or $input-char='丙' or $input-char='寅'">
  8354. <xsl:choose>
  8355. <xsl:when test="$output-type='ARABIC'">3</xsl:when>
  8356. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">c</xsl:when>
  8357. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">C</xsl:when>
  8358. <xsl:when test="$output-type='ROMAN_UPPER'">III</xsl:when>
  8359. <xsl:when test="$output-type='ROMAN_LOWER'">iii</xsl:when>
  8360. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">3</xsl:when>
  8361. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">三</xsl:when>
  8362. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">3</xsl:when>
  8363. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">叁</xsl:when>
  8364. <xsl:when test="$output-type='CIRCLE_NUMBER'">3</xsl:when>
  8365. <xsl:when test="$output-type='TIAN_GAN_ZH'">丙</xsl:when>
  8366. <xsl:when test="$output-type='DI_ZI_ZH'">寅</xsl:when>
  8367. <xsl:otherwise>3</xsl:otherwise>
  8368. </xsl:choose>
  8369. </xsl:when>
  8370. <xsl:when test="$input-char='D' or $input-char='d' or $input-char='4' or $input-char='Roman_IV' or $input-char='Roman_iv' or $input-char='四' or $input-char='肆' or $input-char='丁' or $input-char='卯'">
  8371. <xsl:choose>
  8372. <xsl:when test="$output-type='ARABIC'">4</xsl:when>
  8373. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">d</xsl:when>
  8374. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">D</xsl:when>
  8375. <xsl:when test="$output-type='ROMAN_UPPER'">IV</xsl:when>
  8376. <xsl:when test="$output-type='ROMAN_LOWER'">iv</xsl:when>
  8377. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">4</xsl:when>
  8378. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">四</xsl:when>
  8379. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">4</xsl:when>
  8380. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">肆</xsl:when>
  8381. <xsl:when test="$output-type='CIRCLE_NUMBER'">4</xsl:when>
  8382. <xsl:when test="$output-type='TIAN_GAN_ZH'">丁</xsl:when>
  8383. <xsl:when test="$output-type='DI_ZI_ZH'">卯</xsl:when>
  8384. <xsl:otherwise>4</xsl:otherwise>
  8385. </xsl:choose>
  8386. </xsl:when>
  8387. <xsl:when test="$input-char='E' or $input-char='e' or $input-char='5' or $input-char='Roman_V' or $input-char='Roman_v' or $input-char='五' or $input-char='伍' or $input-char='戊' or $input-char='辰'">
  8388. <xsl:choose>
  8389. <xsl:when test="$output-type='ARABIC'">5</xsl:when>
  8390. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">e</xsl:when>
  8391. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">E</xsl:when>
  8392. <xsl:when test="$output-type='ROMAN_UPPER'">V</xsl:when>
  8393. <xsl:when test="$output-type='ROMAN_LOWER'">v</xsl:when>
  8394. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">5</xsl:when>
  8395. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">五</xsl:when>
  8396. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">5</xsl:when>
  8397. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">伍</xsl:when>
  8398. <xsl:when test="$output-type='CIRCLE_NUMBER'">5</xsl:when>
  8399. <xsl:when test="$output-type='TIAN_GAN_ZH'">戊</xsl:when>
  8400. <xsl:when test="$output-type='DI_ZI_ZH'">辰</xsl:when>
  8401. <xsl:otherwise>5</xsl:otherwise>
  8402. </xsl:choose>
  8403. </xsl:when>
  8404. <xsl:when test="$input-char='F' or $input-char='f' or $input-char='6' or $input-char='Roman_VI' or $input-char='Roman_vi' or $input-char='六' or $input-char='陆' or $input-char='己' or $input-char='巳'">
  8405. <xsl:choose>
  8406. <xsl:when test="$output-type='ARABIC'">6</xsl:when>
  8407. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">f</xsl:when>
  8408. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">F</xsl:when>
  8409. <xsl:when test="$output-type='ROMAN_UPPER'">VI</xsl:when>
  8410. <xsl:when test="$output-type='ROMAN_LOWER'">vi</xsl:when>
  8411. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">6</xsl:when>
  8412. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">六</xsl:when>
  8413. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">6</xsl:when>
  8414. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">陆</xsl:when>
  8415. <xsl:when test="$output-type='CIRCLE_NUMBER'">6</xsl:when>
  8416. <xsl:when test="$output-type='TIAN_GAN_ZH'">己</xsl:when>
  8417. <xsl:when test="$output-type='DI_ZI_ZH'">巳</xsl:when>
  8418. <xsl:otherwise>6</xsl:otherwise>
  8419. </xsl:choose>
  8420. </xsl:when>
  8421. <xsl:when test="$input-char='G' or $input-char='g' or $input-char='7' or $input-char='7' or $input-char='Roman_VII' or $input-char='Roman_vii' or $input-char='七' or $input-char='柒' or $input-char='庚' or $input-char='午'">
  8422. <xsl:choose>
  8423. <xsl:when test="$output-type='ARABIC'">7</xsl:when>
  8424. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">g</xsl:when>
  8425. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">G</xsl:when>
  8426. <xsl:when test="$output-type='ROMAN_UPPER'">VII</xsl:when>
  8427. <xsl:when test="$output-type='ROMAN_LOWER'">vii</xsl:when>
  8428. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">7</xsl:when>
  8429. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">七</xsl:when>
  8430. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">7</xsl:when>
  8431. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">柒</xsl:when>
  8432. <xsl:when test="$output-type='CIRCLE_NUMBER'">7</xsl:when>
  8433. <xsl:when test="$output-type='TIAN_GAN_ZH'">庚</xsl:when>
  8434. <xsl:when test="$output-type='DI_ZI_ZH'">午</xsl:when>
  8435. <xsl:otherwise>7</xsl:otherwise>
  8436. </xsl:choose>
  8437. </xsl:when>
  8438. <xsl:when test="$input-char='H' or $input-char='h' or $input-char='8' or $input-char='Roman_VIII' or $input-char='Roman_viii' or $input-char='八' or $input-char='捌' or $input-char='辛' or $input-char='未'">
  8439. <xsl:choose>
  8440. <xsl:when test="$output-type='ARABIC'">8</xsl:when>
  8441. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">h</xsl:when>
  8442. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">H</xsl:when>
  8443. <xsl:when test="$output-type='ROMAN_UPPER'">VIII</xsl:when>
  8444. <xsl:when test="$output-type='ROMAN_LOWER'">viii</xsl:when>
  8445. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">8</xsl:when>
  8446. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">八</xsl:when>
  8447. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">8</xsl:when>
  8448. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">捌</xsl:when>
  8449. <xsl:when test="$output-type='CIRCLE_NUMBER'">8</xsl:when>
  8450. <xsl:when test="$output-type='TIAN_GAN_ZH'">辛</xsl:when>
  8451. <xsl:when test="$output-type='DI_ZI_ZH'">未</xsl:when>
  8452. <xsl:otherwise>8</xsl:otherwise>
  8453. </xsl:choose>
  8454. </xsl:when>
  8455. <xsl:when test="$input-char='I' or $input-char='i' or $input-char='9' or $input-char='Roman_IX' or $input-char='Roman_ix' or $input-char='九' or $input-char='玖' or $input-char='壬' or $input-char='申'">
  8456. <xsl:choose>
  8457. <xsl:when test="$output-type='ARABIC'">9</xsl:when>
  8458. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">i</xsl:when>
  8459. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">I</xsl:when>
  8460. <xsl:when test="$output-type='ROMAN_UPPER'">IX</xsl:when>
  8461. <xsl:when test="$output-type='ROMAN_LOWER'">ix</xsl:when>
  8462. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">9</xsl:when>
  8463. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">九</xsl:when>
  8464. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">9</xsl:when>
  8465. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">玖</xsl:when>
  8466. <xsl:when test="$output-type='CIRCLE_NUMBER'">9</xsl:when>
  8467. <xsl:when test="$output-type='TIAN_GAN_ZH'">壬</xsl:when>
  8468. <xsl:when test="$output-type='DI_ZI_ZH'">申</xsl:when>
  8469. <xsl:otherwise>9</xsl:otherwise>
  8470. </xsl:choose>
  8471. </xsl:when>
  8472. <xsl:when test="$input-char='J' or $input-char='j' or $input-char='10' or $input-char='Roman_X' or $input-char='Roman_x' or $input-char='十' or $input-char='拾' or $input-char='癸' or $input-char='酉'">
  8473. <xsl:choose>
  8474. <xsl:when test="$output-type='ARABIC'">10</xsl:when>
  8475. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">j</xsl:when>
  8476. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">J</xsl:when>
  8477. <xsl:when test="$output-type='ROMAN_UPPER'">X</xsl:when>
  8478. <xsl:when test="$output-type='ROMAN_LOWER'">x</xsl:when>
  8479. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">10</xsl:when>
  8480. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十</xsl:when>
  8481. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">10</xsl:when>
  8482. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾</xsl:when>
  8483. <xsl:when test="$output-type='CIRCLE_NUMBER'">10</xsl:when>
  8484. <xsl:when test="$output-type='TIAN_GAN_ZH'">癸</xsl:when>
  8485. <xsl:when test="$output-type='DI_ZI_ZH'">酉</xsl:when>
  8486. <xsl:otherwise>10</xsl:otherwise>
  8487. </xsl:choose>
  8488. </xsl:when>
  8489. <xsl:when test="$input-char='K' or $input-char='k' or $input-char='11' or $input-char='Roman_XI' or $input-char='Roman_xi' or $input-char='十一' or $input-char='拾壹' or $input-char='戌'">
  8490. <xsl:choose>
  8491. <xsl:when test="$output-type='ARABIC'">11</xsl:when>
  8492. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">k</xsl:when>
  8493. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">K</xsl:when>
  8494. <xsl:when test="$output-type='ROMAN_UPPER'">XI</xsl:when>
  8495. <xsl:when test="$output-type='ROMAN_LOWER'">xi</xsl:when>
  8496. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">11</xsl:when>
  8497. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十一</xsl:when>
  8498. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">11</xsl:when>
  8499. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾壹</xsl:when>
  8500. <xsl:when test="$output-type='CIRCLE_NUMBER'">11</xsl:when>
  8501. <xsl:when test="$output-type='DI_ZI_ZH'">戌</xsl:when>
  8502. <xsl:otherwise>11</xsl:otherwise>
  8503. </xsl:choose>
  8504. </xsl:when>
  8505. <xsl:when test="$input-char='L' or $input-char='l' or $input-char='12' or $input-char='Roman_XII' or $input-char='Roman_xii' or $input-char='十二' or $input-char='拾贰' or $input-char='亥'">
  8506. <xsl:choose>
  8507. <xsl:when test="$output-type='ARABIC'">12</xsl:when>
  8508. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">l</xsl:when>
  8509. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">L</xsl:when>
  8510. <xsl:when test="$output-type='ROMAN_UPPER'">XII</xsl:when>
  8511. <xsl:when test="$output-type='ROMAN_LOWER'">xii</xsl:when>
  8512. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">12</xsl:when>
  8513. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十二</xsl:when>
  8514. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">12</xsl:when>
  8515. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾贰</xsl:when>
  8516. <xsl:when test="$output-type='CIRCLE_NUMBER'">12</xsl:when>
  8517. <xsl:when test="$output-type='DI_ZI_ZH'">亥</xsl:when>
  8518. <xsl:otherwise>12</xsl:otherwise>
  8519. </xsl:choose>
  8520. </xsl:when>
  8521. <xsl:when test="$input-char='M' or $input-char='m' or $input-char='13' or $input-char='Roman_XIII' or $input-char='Roman_xiii' or $input-char='十三' or $input-char='拾叁'">
  8522. <xsl:choose>
  8523. <xsl:when test="$output-type='ARABIC'">13</xsl:when>
  8524. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">m</xsl:when>
  8525. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">M</xsl:when>
  8526. <xsl:when test="$output-type='ROMAN_UPPER'">XIII</xsl:when>
  8527. <xsl:when test="$output-type='ROMAN_LOWER'">xiii</xsl:when>
  8528. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">13</xsl:when>
  8529. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十三</xsl:when>
  8530. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">13</xsl:when>
  8531. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾叁</xsl:when>
  8532. <xsl:when test="$output-type='CIRCLE_NUMBER'">13</xsl:when>
  8533. <xsl:otherwise>13</xsl:otherwise>
  8534. </xsl:choose>
  8535. </xsl:when>
  8536. <xsl:when test="$input-char='N' or $input-char='n' or $input-char='14' or $input-char='Roman_XIV' or $input-char='Roman_xiv' or $input-char='十四' or $input-char='拾肆'">
  8537. <xsl:choose>
  8538. <xsl:when test="$output-type='ARABIC'">14</xsl:when>
  8539. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">n</xsl:when>
  8540. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">N</xsl:when>
  8541. <xsl:when test="$output-type='ROMAN_UPPER'">XIV</xsl:when>
  8542. <xsl:when test="$output-type='ROMAN_LOWER'">xiv</xsl:when>
  8543. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">14</xsl:when>
  8544. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十四</xsl:when>
  8545. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">14</xsl:when>
  8546. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾肆</xsl:when>
  8547. <xsl:when test="$output-type='CIRCLE_NUMBER'">14</xsl:when>
  8548. <xsl:otherwise>14</xsl:otherwise>
  8549. </xsl:choose>
  8550. </xsl:when>
  8551. <xsl:when test="$input-char='O' or $input-char='o' or $input-char='15' or $input-char='Roman_XV' or $input-char='Roman_xv' or $input-char='十五' or $input-char='拾伍'">
  8552. <xsl:choose>
  8553. <xsl:when test="$output-type='ARABIC'">15</xsl:when>
  8554. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">o</xsl:when>
  8555. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">O</xsl:when>
  8556. <xsl:when test="$output-type='ROMAN_UPPER'">XV</xsl:when>
  8557. <xsl:when test="$output-type='ROMAN_LOWER'">xv</xsl:when>
  8558. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">15</xsl:when>
  8559. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十五</xsl:when>
  8560. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">15</xsl:when>
  8561. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾伍</xsl:when>
  8562. <xsl:when test="$output-type='CIRCLE_NUMBER'">15</xsl:when>
  8563. <xsl:otherwise>15</xsl:otherwise>
  8564. </xsl:choose>
  8565. </xsl:when>
  8566. <xsl:when test="$input-char='P' or $input-char='p' or $input-char='16' or $input-char='Roman_XVI' or $input-char='Roman_xvi' or $input-char='十六' or $input-char='拾陆'">
  8567. <xsl:choose>
  8568. <xsl:when test="$output-type='ARABIC'">16</xsl:when>
  8569. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">p</xsl:when>
  8570. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">P</xsl:when>
  8571. <xsl:when test="$output-type='ROMAN_UPPER'">XVI</xsl:when>
  8572. <xsl:when test="$output-type='ROMAN_LOWER'">xvi</xsl:when>
  8573. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">16</xsl:when>
  8574. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十六</xsl:when>
  8575. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">16</xsl:when>
  8576. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾陆</xsl:when>
  8577. <xsl:when test="$output-type='CIRCLE_NUMBER'">16</xsl:when>
  8578. <xsl:otherwise>16</xsl:otherwise>
  8579. </xsl:choose>
  8580. </xsl:when>
  8581. <xsl:when test="$input-char='Q' or $input-char='q' or $input-char='17' or $input-char='Roman_XVII' or $input-char='Roman_xvii' or $input-char='十七' or $input-char='拾柒'">
  8582. <xsl:choose>
  8583. <xsl:when test="$output-type='ARABIC'">17</xsl:when>
  8584. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">q</xsl:when>
  8585. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Q</xsl:when>
  8586. <xsl:when test="$output-type='ROMAN_UPPER'">XVII</xsl:when>
  8587. <xsl:when test="$output-type='ROMAN_LOWER'">xvii</xsl:when>
  8588. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">17</xsl:when>
  8589. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十七</xsl:when>
  8590. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">17</xsl:when>
  8591. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾柒</xsl:when>
  8592. <xsl:when test="$output-type='CIRCLE_NUMBER'">17</xsl:when>
  8593. <xsl:otherwise>17</xsl:otherwise>
  8594. </xsl:choose>
  8595. </xsl:when>
  8596. <xsl:when test="$input-char='R' or $input-char='r' or $input-char='18' or $input-char='Roman_XVIII' or $input-char='Roman_xviii' or $input-char='十八' or $input-char='拾捌'">
  8597. <xsl:choose>
  8598. <xsl:when test="$output-type='ARABIC'">18</xsl:when>
  8599. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">r</xsl:when>
  8600. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">R</xsl:when>
  8601. <xsl:when test="$output-type='ROMAN_UPPER'">XVIII</xsl:when>
  8602. <xsl:when test="$output-type='ROMAN_LOWER'">xviii</xsl:when>
  8603. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">18</xsl:when>
  8604. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十八</xsl:when>
  8605. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">18</xsl:when>
  8606. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾捌</xsl:when>
  8607. <xsl:when test="$output-type='CIRCLE_NUMBER'">18</xsl:when>
  8608. <xsl:otherwise>18</xsl:otherwise>
  8609. </xsl:choose>
  8610. </xsl:when>
  8611. <xsl:when test="$input-char='S' or $input-char='s' or $input-char='19' or $input-char='Roman_XIX' or $input-char='Roman_xix' or $input-char='十九' or $input-char='拾玖'">
  8612. <xsl:choose>
  8613. <xsl:when test="$output-type='ARABIC'">19</xsl:when>
  8614. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">s</xsl:when>
  8615. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">S</xsl:when>
  8616. <xsl:when test="$output-type='ROMAN_UPPER'">XIX</xsl:when>
  8617. <xsl:when test="$output-type='ROMAN_LOWER'">xix</xsl:when>
  8618. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">19</xsl:when>
  8619. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十九</xsl:when>
  8620. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">19</xsl:when>
  8621. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾玖</xsl:when>
  8622. <xsl:when test="$output-type='CIRCLE_NUMBER'">19</xsl:when>
  8623. <xsl:otherwise>19</xsl:otherwise>
  8624. </xsl:choose>
  8625. </xsl:when>
  8626. <xsl:when test="$input-char='T' or $input-char='t' or $input-char='20' or $input-char='Roman_XX' or $input-char='Roman_xx' or $input-char='二十' or $input-char='贰拾'">
  8627. <xsl:choose>
  8628. <xsl:when test="$output-type='ARABIC'">20</xsl:when>
  8629. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">t</xsl:when>
  8630. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">T</xsl:when>
  8631. <xsl:when test="$output-type='ROMAN_UPPER'">XX</xsl:when>
  8632. <xsl:when test="$output-type='ROMAN_LOWER'">xx</xsl:when>
  8633. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">20</xsl:when>
  8634. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十</xsl:when>
  8635. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">20</xsl:when>
  8636. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾</xsl:when>
  8637. <xsl:when test="$output-type='CIRCLE_NUMBER'">20</xsl:when>
  8638. <xsl:otherwise>20</xsl:otherwise>
  8639. </xsl:choose>
  8640. </xsl:when>
  8641. <xsl:when test="$input-char='U' or $input-char='u' or $input-char='21' or $input-char='Roman_XXI' or $input-char='Roman_xxi' or $input-char='二十一' or $input-char='贰拾壹'">
  8642. <xsl:choose>
  8643. <xsl:when test="$output-type='ARABIC'">21</xsl:when>
  8644. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">u</xsl:when>
  8645. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">U</xsl:when>
  8646. <xsl:when test="$output-type='ROMAN_UPPER'">XXI</xsl:when>
  8647. <xsl:when test="$output-type='ROMAN_LOWER'">xxi</xsl:when>
  8648. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">21</xsl:when>
  8649. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十一</xsl:when>
  8650. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">21</xsl:when>
  8651. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾壹</xsl:when>
  8652. <xsl:when test="$output-type='CIRCLE_NUMBER'">21</xsl:when>
  8653. <xsl:otherwise>21</xsl:otherwise>
  8654. </xsl:choose>
  8655. </xsl:when>
  8656. <xsl:when test="$input-char='V' or $input-char='v' or $input-char='22' or $input-char='Roman_XXII' or $input-char='Roman_xxii' or $input-char='二十二' or $input-char='贰拾贰'">
  8657. <xsl:choose>
  8658. <xsl:when test="$output-type='ARABIC'">22</xsl:when>
  8659. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">v</xsl:when>
  8660. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">V</xsl:when>
  8661. <xsl:when test="$output-type='ROMAN_UPPER'">XXII</xsl:when>
  8662. <xsl:when test="$output-type='ROMAN_LOWER'">xxii</xsl:when>
  8663. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">22</xsl:when>
  8664. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十二</xsl:when>
  8665. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">22</xsl:when>
  8666. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾贰</xsl:when>
  8667. <xsl:when test="$output-type='CIRCLE_NUMBER'">22</xsl:when>
  8668. <xsl:otherwise>22</xsl:otherwise>
  8669. </xsl:choose>
  8670. </xsl:when>
  8671. <xsl:when test="$input-char='W' or $input-char='w' or $input-char='23' or $input-char='Roman_XXIII' or $input-char='Roman_xxiii' or $input-char='二十三' or $input-char='贰拾叁'">
  8672. <xsl:choose>
  8673. <xsl:when test="$output-type='ARABIC'">23</xsl:when>
  8674. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">w</xsl:when>
  8675. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">W</xsl:when>
  8676. <xsl:when test="$output-type='ROMAN_UPPER'">XXIII</xsl:when>
  8677. <xsl:when test="$output-type='ROMAN_LOWER'">xxiii</xsl:when>
  8678. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">23</xsl:when>
  8679. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十三</xsl:when>
  8680. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">23</xsl:when>
  8681. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾叁</xsl:when>
  8682. <xsl:when test="$output-type='CIRCLE_NUMBER'">23</xsl:when>
  8683. <xsl:otherwise>23</xsl:otherwise>
  8684. </xsl:choose>
  8685. </xsl:when>
  8686. <xsl:when test="$input-char='X' or $input-char='x' or $input-char='24' or $input-char='Roman_XXIV' or $input-char='Roman_xxiv' or $input-char='二十四' or $input-char='贰拾肆'">
  8687. <xsl:choose>
  8688. <xsl:when test="$output-type='ARABIC'">24</xsl:when>
  8689. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">x</xsl:when>
  8690. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">X</xsl:when>
  8691. <xsl:when test="$output-type='ROMAN_UPPER'">XXIV</xsl:when>
  8692. <xsl:when test="$output-type='ROMAN_LOWER'">xxiv</xsl:when>
  8693. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">24</xsl:when>
  8694. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十四</xsl:when>
  8695. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">24</xsl:when>
  8696. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾肆</xsl:when>
  8697. <xsl:when test="$output-type='CIRCLE_NUMBER'">24</xsl:when>
  8698. <xsl:otherwise>24</xsl:otherwise>
  8699. </xsl:choose>
  8700. </xsl:when>
  8701. <xsl:when test="$input-char='Y' or $input-char='y' or $input-char='25' or $input-char='Roman_XXV' or $input-char='Roman_xxv' or $input-char='二十五' or $input-char='贰拾伍'">
  8702. <xsl:choose>
  8703. <xsl:when test="$output-type='ARABIC'">25</xsl:when>
  8704. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">y</xsl:when>
  8705. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Y</xsl:when>
  8706. <xsl:when test="$output-type='ROMAN_UPPER'">XXV</xsl:when>
  8707. <xsl:when test="$output-type='ROMAN_LOWER'">xxv</xsl:when>
  8708. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">25</xsl:when>
  8709. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十五</xsl:when>
  8710. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">25</xsl:when>
  8711. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾伍</xsl:when>
  8712. <xsl:when test="$output-type='CIRCLE_NUMBER'">25</xsl:when>
  8713. <xsl:otherwise>25</xsl:otherwise>
  8714. </xsl:choose>
  8715. </xsl:when>
  8716. <xsl:when test="$input-char='Z' or $input-char='z' or $input-char='26' or $input-char='Roman_XXVI' or $input-char='Roman_xxvi' or $input-char='二十六' or $input-char='贰拾陆'">
  8717. <xsl:choose>
  8718. <xsl:when test="$output-type='ARABIC'">26</xsl:when>
  8719. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">z</xsl:when>
  8720. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Z</xsl:when>
  8721. <xsl:when test="$output-type='ROMAN_UPPER'">XXVI</xsl:when>
  8722. <xsl:when test="$output-type='ROMAN_LOWER'">xxvi</xsl:when>
  8723. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">26</xsl:when>
  8724. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十六</xsl:when>
  8725. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">26</xsl:when>
  8726. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾陆</xsl:when>
  8727. <xsl:when test="$output-type='CIRCLE_NUMBER'">26</xsl:when>
  8728. <xsl:otherwise>26</xsl:otherwise>
  8729. </xsl:choose>
  8730. </xsl:when>
  8731. <xsl:otherwise>
  8732. <xsl:choose>
  8733. <xsl:when test="$output-type='ARABIC'">1</xsl:when>
  8734. <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
  8735. <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
  8736. <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
  8737. <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
  8738. <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
  8739. <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
  8740. <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
  8741. <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
  8742. <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
  8743. <xsl:otherwise>1</xsl:otherwise>
  8744. </xsl:choose>
  8745. </xsl:otherwise>
  8746. </xsl:choose>
  8747. </xsl:template>
  8748. <!--RedOffice comment (Zengjh) end charts-->
  8749. <!-- 以下模板的作用是将网格线颜色由16进制转换为十进制 -->
  8750. <xsl:template name="transform-hex-to-decimal">
  8751. <xsl:param name="number"/>
  8752. <xsl:variable name="R-color-number">
  8753. <xsl:call-template name="color-hex-to-decimal">
  8754. <xsl:with-param name="chars" select="substring($number,2,2)"/>
  8755. </xsl:call-template>
  8756. </xsl:variable>
  8757. <xsl:variable name="G-color-number">
  8758. <xsl:call-template name="color-hex-to-decimal">
  8759. <xsl:with-param name="chars" select="substring($number,4,2)"/>
  8760. </xsl:call-template>
  8761. </xsl:variable>
  8762. <xsl:variable name="B-color-number">
  8763. <xsl:call-template name="color-hex-to-decimal">
  8764. <xsl:with-param name="chars" select="substring($number,6,2)"/>
  8765. </xsl:call-template>
  8766. </xsl:variable>
  8767. <xsl:value-of select="$R-color-number * 65536 + $G-color-number * 256 + $B-color-number"/>
  8768. </xsl:template>
  8769. <!-- 以下模板的作用是为R或G或B颜色转换为十进制形式-->
  8770. <xsl:template name="color-hex-to-decimal">
  8771. <xsl:param name="chars"/>
  8772. <xsl:variable name="first-num">
  8773. <xsl:call-template name="hex-to-decimal">
  8774. <xsl:with-param name="char" select="substring($chars,1,1)"/>
  8775. </xsl:call-template>
  8776. </xsl:variable>
  8777. <xsl:variable name="second-num">
  8778. <xsl:call-template name="hex-to-decimal">
  8779. <xsl:with-param name="char" select="substring($chars,2,1)"/>
  8780. </xsl:call-template>
  8781. </xsl:variable>
  8782. <xsl:value-of select="$first-num *16 + $second-num"/>
  8783. </xsl:template>
  8784. <xsl:template name="hex-to-decimal">
  8785. <xsl:param name="char"/>
  8786. <xsl:choose>
  8787. <xsl:when test="$char='0'">0</xsl:when>
  8788. <xsl:when test="$char='1'">1</xsl:when>
  8789. <xsl:when test="$char='2'">2</xsl:when>
  8790. <xsl:when test="$char='3'">3</xsl:when>
  8791. <xsl:when test="$char='4'">4</xsl:when>
  8792. <xsl:when test="$char='5'">5</xsl:when>
  8793. <xsl:when test="$char='6'">6</xsl:when>
  8794. <xsl:when test="$char='7'">7</xsl:when>
  8795. <xsl:when test="$char='8'">8</xsl:when>
  8796. <xsl:when test="$char='9'">9</xsl:when>
  8797. <xsl:when test="$char='a'">10</xsl:when>
  8798. <xsl:when test="$char='b'">11</xsl:when>
  8799. <xsl:when test="$char='c'">12</xsl:when>
  8800. <xsl:when test="$char='d'">13</xsl:when>
  8801. <xsl:when test="$char='e'">14</xsl:when>
  8802. <xsl:when test="$char='f'">15</xsl:when>
  8803. </xsl:choose>
  8804. </xsl:template>
  8805. <!-- end -->
  8806. <!--ro000179 chenjh-->
  8807. <xsl:template name="search-left-top-in-tables">
  8808. <xsl:param name="cellstylename"/>
  8809. <xsl:param name="tableslist"/>
  8810. <xsl:param name="return"/>
  8811. <xsl:choose>
  8812. <xsl:when test="$tableslist and $return=''">
  8813. <xsl:variable name="firsttablerows" select="$tableslist[1]//表:行"/>
  8814. <xsl:variable name="first-left-top">
  8815. <xsl:call-template name="search-left-top-inatable">
  8816. <xsl:with-param name="row-num" select="'1'"/>
  8817. <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
  8818. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8819. <xsl:with-param name="return" select="''"/>
  8820. </xsl:call-template>
  8821. </xsl:variable>
  8822. <xsl:variable name="rest-left-top">
  8823. <xsl:call-template name="search-left-top-in-tables">
  8824. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8825. <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
  8826. <xsl:with-param name="return" select="$first-left-top"/>
  8827. </xsl:call-template>
  8828. </xsl:variable>
  8829. <xsl:choose>
  8830. <xsl:when test="$first-left-top!=''">
  8831. <xsl:value-of select="$first-left-top"/>
  8832. </xsl:when>
  8833. <xsl:when test="$rest-left-top!=''">
  8834. <xsl:value-of select="$rest-left-top"/>
  8835. </xsl:when>
  8836. <xsl:otherwise>
  8837. <xsl:value-of select="''"/>
  8838. </xsl:otherwise>
  8839. </xsl:choose>
  8840. </xsl:when>
  8841. <xsl:otherwise>
  8842. <xsl:value-of select="$return"/>
  8843. </xsl:otherwise>
  8844. </xsl:choose>
  8845. </xsl:template>
  8846. <!-- 以下模板的作用为在一个table中寻找左上角-->
  8847. <xsl:template name="search-left-top-inatable">
  8848. <xsl:param name="row-num"/>
  8849. <xsl:param name="firsttablerows"/>
  8850. <xsl:param name="cellstylename"/>
  8851. <xsl:param name="return"/>
  8852. <xsl:choose>
  8853. <xsl:when test="$firsttablerows and $return=''">
  8854. <xsl:variable name="firstcells" select="$firsttablerows[1]/表:单元格"/>
  8855. <xsl:variable name="first-left-top">
  8856. <xsl:call-template name="search-left-top-inarow">
  8857. <xsl:with-param name="row-num" select="$row-num"/>
  8858. <xsl:with-param name="firstcells" select="$firstcells"/>
  8859. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8860. <xsl:with-param name="return" select="''"/>
  8861. </xsl:call-template>
  8862. </xsl:variable>
  8863. <xsl:variable name="row-num-p">
  8864. <xsl:choose>
  8865. <xsl:when test="$firsttablerows[1]/@表:跨度">
  8866. <xsl:value-of select="$row-num+ $firsttablerows[1]/@表:跨度"/>
  8867. </xsl:when>
  8868. <xsl:otherwise>
  8869. <xsl:value-of select="$row-num+1"/>
  8870. </xsl:otherwise>
  8871. </xsl:choose>
  8872. </xsl:variable>
  8873. <xsl:variable name="rest-left-top">
  8874. <xsl:call-template name="search-left-top-inatable">
  8875. <xsl:with-param name="row-num" select="$row-num-p"/>
  8876. <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
  8877. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8878. <xsl:with-param name="return" select="$first-left-top"/>
  8879. </xsl:call-template>
  8880. </xsl:variable>
  8881. <xsl:choose>
  8882. <xsl:when test="$first-left-top!=''">
  8883. <xsl:value-of select="$first-left-top"/>
  8884. </xsl:when>
  8885. <xsl:when test="$rest-left-top !=''">
  8886. <xsl:value-of select="$rest-left-top "/>
  8887. </xsl:when>
  8888. <xsl:otherwise>
  8889. <xsl:value-of select="''"/>
  8890. </xsl:otherwise>
  8891. </xsl:choose>
  8892. </xsl:when>
  8893. <xsl:otherwise>
  8894. <xsl:value-of select="$return"/>
  8895. </xsl:otherwise>
  8896. </xsl:choose>
  8897. </xsl:template>
  8898. <!-- 以下模板的作用为在某一行中寻找左上角-->
  8899. <xsl:template name="search-left-top-inarow">
  8900. <xsl:param name="row-num"/>
  8901. <xsl:param name="firstcells"/>
  8902. <xsl:param name="cellstylename"/>
  8903. <xsl:param name="return"/>
  8904. <xsl:choose>
  8905. <xsl:when test="$firstcells and $return=''">
  8906. <xsl:variable name="firstcell" select="$firstcells[1]"/>
  8907. <xsl:variable name="first-left-top">
  8908. <xsl:call-template name="search-left-top-inacell">
  8909. <xsl:with-param name="row-num" select="$row-num"/>
  8910. <xsl:with-param name="cell" select="$firstcell"/>
  8911. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8912. </xsl:call-template>
  8913. </xsl:variable>
  8914. <xsl:variable name="rest-left-top">
  8915. <xsl:call-template name="search-left-top-inarow">
  8916. <xsl:with-param name="row-num" select="$row-num"/>
  8917. <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
  8918. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8919. <xsl:with-param name="return" select="$first-left-top"/>
  8920. </xsl:call-template>
  8921. </xsl:variable>
  8922. <xsl:choose>
  8923. <xsl:when test="$first-left-top!=''">
  8924. <xsl:value-of select="$first-left-top"/>
  8925. </xsl:when>
  8926. <xsl:when test="$rest-left-top !=''">
  8927. <xsl:value-of select="$rest-left-top "/>
  8928. </xsl:when>
  8929. <xsl:otherwise>
  8930. <xsl:value-of select="''"/>
  8931. </xsl:otherwise>
  8932. </xsl:choose>
  8933. </xsl:when>
  8934. <xsl:otherwise>
  8935. <xsl:value-of select="$return"/>
  8936. </xsl:otherwise>
  8937. </xsl:choose>
  8938. </xsl:template>
  8939. <!-- 以下的模板的作用为判断某个cell是否为左上角 -->
  8940. <xsl:template name="search-left-top-inacell">
  8941. <xsl:param name="row-num"/>
  8942. <xsl:param name="cell"/>
  8943. <xsl:param name="cellstylename"/>
  8944. <xsl:choose>
  8945. <xsl:when test="$cell/@表:式样引用=$cellstylename">
  8946. <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
  8947. </xsl:when>
  8948. <xsl:otherwise>
  8949. <xsl:value-of select="''"/>
  8950. <!-- <xsl:variable name="style-is-default">
  8951. <xsl:call-template name="is-default-or-not-condition-format">
  8952. <xsl:with-param name="column-num" select="$cell/@表:列号"/>
  8953. <xsl:with-param name="cell" select="$cell"/>
  8954. <xsl:with-param name="preceding-cellstylename" select="''"/>
  8955. <xsl:with-param name="temp-num" select="'0'"/>
  8956. <xsl:with-param name="cellstylename" select="$cellstylename"/>
  8957. <xsl:with-param name="table-columns" select="$cell/ancestor::表:工作表内容//表:列"/>
  8958. </xsl:call-template>
  8959. </xsl:variable>
  8960. <xsl:choose>
  8961. <xsl:when test="$style-is-default='yes' ">
  8962. <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
  8963. </xsl:when>
  8964. <xsl:otherwise>
  8965. <xsl:value-of select="''"/>
  8966. </xsl:otherwise>
  8967. </xsl:choose> -->
  8968. </xsl:otherwise>
  8969. </xsl:choose>
  8970. </xsl:template>
  8971. <xsl:template name="translate-left-top">
  8972. <xsl:param name="left-top"/>
  8973. <xsl:if test="$left-top!=''">
  8974. <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
  8975. <xsl:variable name="column-number1">
  8976. <xsl:value-of select="floor( $column-number div 26 )"/>
  8977. </xsl:variable>
  8978. <xsl:variable name="column-number2">
  8979. <xsl:value-of select="$column-number mod 26"/>
  8980. </xsl:variable>
  8981. <xsl:variable name="column-character1">
  8982. <xsl:call-template name="number-to-character">
  8983. <xsl:with-param name="number" select="$column-number1"/>
  8984. </xsl:call-template>
  8985. </xsl:variable>
  8986. <xsl:variable name="column-character2">
  8987. <xsl:call-template name="number-to-character">
  8988. <xsl:with-param name="number" select="$column-number2"/>
  8989. </xsl:call-template>
  8990. </xsl:variable>
  8991. <xsl:value-of select="concat(substring-before($left-top,'.'),'.',$column-character1,$column-character2,substring-after($left-top,' '))"/>
  8992. </xsl:if>
  8993. </xsl:template>
  8994. <xsl:template name="create-the-condition-format-map">
  8995. <xsl:param name="condition-format-set"/>
  8996. <xsl:param name="current-left-top"/>
  8997. <xsl:if test="$condition-format-set">
  8998. <xsl:choose>
  8999. <xsl:when test="contains($condition-format-set[1]/表:区域/text(),$current-left-top)">
  9000. <xsl:for-each select="$condition-format-set[1]/表:条件">
  9001. <xsl:variable name="condition-text">
  9002. <xsl:choose>
  9003. <xsl:when test="@表:类型='cell value'">
  9004. <xsl:choose>
  9005. <xsl:when test="表:操作码/text()='between' ">
  9006. <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
  9007. </xsl:when>
  9008. <xsl:when test=" 表:操作码/text()='not between'">
  9009. <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
  9010. </xsl:when>
  9011. <xsl:when test="表:操作码/text()='equal to'">
  9012. <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
  9013. </xsl:when>
  9014. <xsl:when test="表:操作码/text()='not equal to'">
  9015. <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
  9016. </xsl:when>
  9017. <xsl:when test="表:操作码/text()='greater than'">
  9018. <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
  9019. </xsl:when>
  9020. <xsl:when test="表:操作码/text()='less than'">
  9021. <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
  9022. </xsl:when>
  9023. <xsl:when test="表:操作码/text()='greater than or equal to'">
  9024. <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
  9025. </xsl:when>
  9026. <xsl:when test="表:操作码/text()='less than or equal to'">
  9027. <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
  9028. </xsl:when>
  9029. </xsl:choose>
  9030. </xsl:when>
  9031. <xsl:when test="@表:类型='formula'">
  9032. <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
  9033. </xsl:when>
  9034. </xsl:choose>
  9035. </xsl:variable>
  9036. <xsl:element name="style:map">
  9037. <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
  9038. <xsl:attribute name="style:apply-style-name"><xsl:value-of select="//uof:单元格式样[@表:标识符=current()/表:格式/@表:式样引用]/@表:名称"/></xsl:attribute>
  9039. <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($condition-format-set[1]/表:区域/text(),':')"/></xsl:attribute>
  9040. </xsl:element>
  9041. </xsl:for-each>
  9042. </xsl:when>
  9043. <xsl:otherwise>
  9044. <xsl:call-template name="create-the-condition-format-map">
  9045. <xsl:with-param name="condition-format-set" select="$condition-format-set[position()!=1]"/>
  9046. <xsl:with-param name="current-left-top" select="$current-left-top"/>
  9047. </xsl:call-template>
  9048. </xsl:otherwise>
  9049. </xsl:choose>
  9050. </xsl:if>
  9051. </xsl:template>
  9052. <!--ro000179 end-->
  9053. </xsl:stylesheet>