docx2html.xsl 344 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "&#160;">]>
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
  5. xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
  6. xmlns:o="urn:schemas-microsoft-com:office:office"
  7. xmlns:v="urn:schemas-microsoft-com:vml"
  8. xmlns:WX="http://schemas.microsoft.com/office/word/2003/auxHint"
  9. xmlns:aml="http://schemas.microsoft.com/aml/2001/core"
  10. xmlns:w10="urn:schemas-microsoft-com:office:word"
  11. xmlns:mml="http://www.w3.org/1998/Math/MathML"
  12. xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
  13. xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
  14. xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
  15. xmlns="http://www.w3.org/1999/xhtml"
  16. version="1.0">
  17. <xsl:param name="pmathml" select="''"/>
  18. <xsl:param name="dtd" select="false()"/>
  19. <xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" indent="yes"/>
  20. <xsl:variable name="paraStyleID_Default">Normal</xsl:variable>
  21. <xsl:variable name="tblStyleID_Default">TableNormal</xsl:variable>
  22. <xsl:variable name="tblStyleSuffix">-T</xsl:variable>
  23. <xsl:variable name="rowStyleSuffix">-R</xsl:variable>
  24. <xsl:variable name="cellStyleSuffix">-C</xsl:variable>
  25. <xsl:variable name="paraStyleSuffix">-P</xsl:variable>
  26. <xsl:variable name="charStyleSuffix">-H</xsl:variable>
  27. <xsl:variable name="paraMarginDefaultTop">0pt</xsl:variable>
  28. <xsl:variable name="paraMarginDefaultRight">0pt</xsl:variable>
  29. <xsl:variable name="paraMarginDefaultBottom">.0001pt</xsl:variable>
  30. <xsl:variable name="paraMarginDefaultLeft">0pt</xsl:variable>
  31. <xsl:variable name="cxtSpacing_all"></xsl:variable>
  32. <xsl:variable name="cxtSpacing_top">t</xsl:variable>
  33. <xsl:variable name="cxtSpacing_bottom">b</xsl:variable>
  34. <xsl:variable name="cxtSpacing_none">
  35. <xsl:value-of select="$cxtSpacing_top"/>
  36. <xsl:value-of select="$cxtSpacing_bottom"/>
  37. </xsl:variable>
  38. <xsl:variable name="bdrSide_top">-top</xsl:variable>
  39. <xsl:variable name="bdrSide_right">-right</xsl:variable>
  40. <xsl:variable name="bdrSide_bottom">-bottom</xsl:variable>
  41. <xsl:variable name="bdrSide_left">-left</xsl:variable>
  42. <xsl:variable name="bdrSide_char"></xsl:variable>
  43. <xsl:variable name="prrFrame">1</xsl:variable>
  44. <xsl:variable name="prrDefaultCellpadding">2</xsl:variable>
  45. <xsl:variable name="prrCellspacing">3</xsl:variable>
  46. <xsl:variable name="prrBdrPr_top">4</xsl:variable>
  47. <xsl:variable name="prrBdrPr_right">5</xsl:variable>
  48. <xsl:variable name="prrBdrPr_bottom">6</xsl:variable>
  49. <xsl:variable name="prrBdrPr_left">7</xsl:variable>
  50. <xsl:variable name="prrBdrPr_between">8</xsl:variable>
  51. <xsl:variable name="prrBdrPr_bar">9</xsl:variable>
  52. <xsl:variable name="prrBdrPr_insideH">A</xsl:variable>
  53. <xsl:variable name="prrBdrPr_insideV">B</xsl:variable>
  54. <xsl:variable name="prrListSuff">C</xsl:variable>
  55. <xsl:variable name="prrListInd">D</xsl:variable>
  56. <xsl:variable name="prrApplyRPr">E</xsl:variable>
  57. <xsl:variable name="prrUpdateRPr">F</xsl:variable>
  58. <xsl:variable name="prrApplyTcPr">G</xsl:variable>
  59. <xsl:variable name="prrCustomCellpadding">H</xsl:variable>
  60. <xsl:variable name="prrCantSplit">I</xsl:variable>
  61. <xsl:variable name="prrTblInd">J</xsl:variable>
  62. <xsl:variable name="prrList">K</xsl:variable>
  63. <xsl:variable name="prrNonList">L</xsl:variable>
  64. <xsl:variable name="cnfFirstRow">firstRow</xsl:variable>
  65. <xsl:variable name="cnfLastRow">lastRow</xsl:variable>
  66. <xsl:variable name="cnfFirstCol">firstCol</xsl:variable>
  67. <xsl:variable name="cnfLastCol">lastCol</xsl:variable>
  68. <xsl:variable name="cnfBand1Vert">band1Vert</xsl:variable>
  69. <xsl:variable name="cnfBand2Vert">band2Vert</xsl:variable>
  70. <xsl:variable name="cnfBand1Horz">band1Horz</xsl:variable>
  71. <xsl:variable name="cnfBand2Horz">band2Horz</xsl:variable>
  72. <xsl:variable name="cnfNECell">neCell</xsl:variable>
  73. <xsl:variable name="cnfNWCell">nwCell</xsl:variable>
  74. <xsl:variable name="cnfSECell">seCell</xsl:variable>
  75. <xsl:variable name="cnfSWCell">swCell</xsl:variable>
  76. <xsl:variable name="icnfFirstRow">1</xsl:variable>
  77. <xsl:variable name="icnfLastRow">2</xsl:variable>
  78. <xsl:variable name="icnfFirstCol">3</xsl:variable>
  79. <xsl:variable name="icnfLastCol">4</xsl:variable>
  80. <xsl:variable name="icnfBand1Vert">5</xsl:variable>
  81. <xsl:variable name="icnfBand2Vert">6</xsl:variable>
  82. <xsl:variable name="icnfBand1Horz">7</xsl:variable>
  83. <xsl:variable name="icnfBand2Horz">8</xsl:variable>
  84. <xsl:variable name="icnfNECell">9</xsl:variable>
  85. <xsl:variable name="icnfNWCell">10</xsl:variable>
  86. <xsl:variable name="icnfSECell">11</xsl:variable>
  87. <xsl:variable name="icnfSWCell">12</xsl:variable>
  88. <xsl:variable name="off">0</xsl:variable>
  89. <xsl:variable name="on">1</xsl:variable>
  90. <xsl:variable name="na">2</xsl:variable>
  91. <xsl:variable name="defaultFontSz">20</xsl:variable>
  92. <xsl:variable name="sep">/</xsl:variable>
  93. <xsl:variable name="sep1">|</xsl:variable>
  94. <xsl:variable name="sep2">,</xsl:variable>
  95. <xsl:variable name="autoColor_hex">auto</xsl:variable>
  96. <xsl:variable name="autoColor_text">windowtext</xsl:variable>
  97. <xsl:variable name="autoColor_bg">transparent</xsl:variable>
  98. <xsl:variable name="transparentColor_hex">transparent</xsl:variable>
  99. <xsl:variable name="transparentColor_text">transparent</xsl:variable>
  100. <xsl:variable name="transparentColor_bg">transparent</xsl:variable>
  101. <xsl:variable name="prListSuff_space">Space</xsl:variable>
  102. <xsl:variable name="prListSuff_nothing">Nothing</xsl:variable>
  103. <xsl:variable name="nsStyles" select="/w:document[1]/w:styles[1]/w:style"/>
  104. <xsl:variable name="ndLists" select="/w:document[1]/w:numbering[1]|//w:cfChunk/w:numbering"/>
  105. <xsl:variable name="ndDocPr" select="/w:document[1]/w:settings[1]"/>
  106. <xsl:variable name="ndDocInfo" select="/w:document[1]/w:docInfo[1]"/>
  107. <xsl:variable name="ndOfficeDocPr" select="/w:document[1]/o:DocumentProperties[1]"/>
  108. <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
  109. <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
  110. <xsl:variable name="pixelsPerInch">
  111. <xsl:choose>
  112. <xsl:when test="$ndDocPr/w:pixelsPerInch/@w:val">
  113. <xsl:value-of select="$ndDocPr/w:pixelsPerInch/@w:val"/>
  114. </xsl:when>
  115. <xsl:otherwise>96</xsl:otherwise>
  116. </xsl:choose>
  117. </xsl:variable>
  118. <xsl:variable name="nfcBullet">bullet</xsl:variable>
  119. <xsl:variable name="iEmbossImprint">1</xsl:variable>
  120. <xsl:variable name="iU_Em">2</xsl:variable>
  121. <xsl:variable name="iStrikeDStrike">3</xsl:variable>
  122. <xsl:variable name="iSup">4</xsl:variable>
  123. <xsl:variable name="iSub">5</xsl:variable>
  124. <xsl:variable name="iVanishWebHidden">6</xsl:variable>
  125. <xsl:variable name="iBCs">7</xsl:variable>
  126. <xsl:variable name="iICs">8</xsl:variable>
  127. <xsl:variable name="iAsciiTheme">9</xsl:variable>
  128. <xsl:variable name="iAnsiTheme">10</xsl:variable>
  129. <xsl:variable name="iEATheme">11</xsl:variable>
  130. <xsl:variable name="iCSTheme">12</xsl:variable>
  131. <xsl:variable name="ISzCs">13</xsl:variable>
  132. <xsl:variable name="iTextAutospaceO">1</xsl:variable>
  133. <xsl:variable name="iTextAutospaceN">2</xsl:variable>
  134. <xsl:variable name="iInd">3</xsl:variable>
  135. <xsl:variable name="prsRDefault">
  136. <xsl:variable name="innerDefault">
  137. <xsl:value-of select="$na"/>
  138. <xsl:value-of select="$na"/>
  139. <xsl:value-of select="$na"/>
  140. <xsl:value-of select="$na"/>
  141. <xsl:value-of select="$na"/>
  142. <xsl:value-of select="$na"/>
  143. <xsl:value-of select="$na"/>
  144. <xsl:value-of select="$na"/>
  145. <xsl:value-of select="$na"/>
  146. <xsl:value-of select="$na"/>
  147. <xsl:value-of select="$na"/>
  148. <xsl:value-of select="$na"/>
  149. <xsl:value-of select="$defaultFontSz"/>
  150. </xsl:variable>
  151. <xsl:for-each select="/w:document[1]/w:styles[1]/w:docDefaults/w:rPrDefault">
  152. <xsl:call-template name="PrsUpdateRPrCore">
  153. <xsl:with-param name="prsR" select="$innerDefault"/>
  154. </xsl:call-template>
  155. </xsl:for-each>
  156. </xsl:variable>
  157. <xsl:variable name="minorAscii">0</xsl:variable>
  158. <xsl:variable name="minorAnsi">1</xsl:variable>
  159. <xsl:variable name="minorEA">3</xsl:variable>
  160. <xsl:variable name="minorCS">4</xsl:variable>
  161. <xsl:variable name="majorAscii">5</xsl:variable>
  162. <xsl:variable name="majorAnsi">6</xsl:variable>
  163. <xsl:variable name="majorEA">7</xsl:variable>
  164. <xsl:variable name="majorCS">8</xsl:variable>
  165. <xsl:variable name="textClassAscii">asciiText</xsl:variable>
  166. <xsl:variable name="textClassAnsi">hAnsiText</xsl:variable>
  167. <xsl:variable name="textClassEA">eaText</xsl:variable>
  168. <xsl:variable name="textClassCS">csText</xsl:variable>
  169. <xsl:variable name="minorAsciiTheme">minorAsciiTheme</xsl:variable>
  170. <xsl:variable name="majorAsciiTheme">majorAsciiTheme</xsl:variable>
  171. <xsl:variable name="minorAnsiTheme">minorAnsiTheme</xsl:variable>
  172. <xsl:variable name="majorAnsiTheme">majorAnsiTheme</xsl:variable>
  173. <xsl:variable name="minorEATheme">minorEATheme</xsl:variable>
  174. <xsl:variable name="majorEATheme">majorEATheme</xsl:variable>
  175. <xsl:variable name="minorCSTheme">minorCSTheme</xsl:variable>
  176. <xsl:variable name="majorCSTheme">majorCSTheme</xsl:variable>
  177. <xsl:variable name="prsPDefault">
  178. <xsl:value-of select="$na"/>
  179. <xsl:value-of select="$na"/>
  180. </xsl:variable>
  181. <xsl:variable name="footnoteRefLink">_ftnref</xsl:variable>
  182. <xsl:variable name="footnoteLink">_ftn</xsl:variable>
  183. <xsl:variable name="endnoteRefLink">_ednref</xsl:variable>
  184. <xsl:variable name="endnoteLink">_edn</xsl:variable>
  185. <xsl:template name="ConvertHexToDec">
  186. <xsl:param name="value"/>
  187. <xsl:param name="i" select="1"/>
  188. <xsl:param name="s" select="1"/>
  189. <xsl:variable name="hexDigit" select="substring($value,$i,1)"/>
  190. <xsl:if test="not($hexDigit = '')">
  191. <xsl:text> </xsl:text>
  192. <xsl:choose>
  193. <xsl:when test="$hexDigit = 'A'">10</xsl:when>
  194. <xsl:when test="$hexDigit = 'B'">11</xsl:when>
  195. <xsl:when test="$hexDigit = 'C'">12</xsl:when>
  196. <xsl:when test="$hexDigit = 'D'">13</xsl:when>
  197. <xsl:when test="$hexDigit = 'E'">14</xsl:when>
  198. <xsl:when test="$hexDigit = 'F'">15</xsl:when>
  199. <xsl:otherwise>
  200. <xsl:value-of select="$hexDigit"/>
  201. </xsl:otherwise>
  202. </xsl:choose>
  203. <xsl:call-template name="ConvertHexToDec">
  204. <xsl:with-param name="value" select="$value"/>
  205. <xsl:with-param name="i" select="$i+$s"/>
  206. <xsl:with-param name="s" select="$s"/>
  207. </xsl:call-template>
  208. </xsl:if>
  209. </xsl:template>
  210. <xsl:template name="ConvBorderStyle">
  211. <xsl:param name="value"/>
  212. <xsl:choose>
  213. <xsl:when test="$value='none' or $value='nil'">none</xsl:when>
  214. <xsl:when test="$value='single'">solid</xsl:when>
  215. <xsl:when test="contains($value,'stroke')">solid</xsl:when>
  216. <xsl:when test="$value='dashed'">dashed</xsl:when>
  217. <xsl:when test="contains($value,'dash')">dashed</xsl:when>
  218. <xsl:when test="$value='double'">double</xsl:when>
  219. <xsl:when test="$value='triple'">double</xsl:when>
  220. <xsl:when test="contains($value,'double')">double</xsl:when>
  221. <xsl:when test="contains($value,'gap')">double</xsl:when>
  222. <xsl:when test="$value='dotted'">dotted</xsl:when>
  223. <xsl:when test="$value='three-d-emboss'">ridge</xsl:when>
  224. <xsl:when test="$value='three-d-engrave'">groove</xsl:when>
  225. <xsl:when test="$value='outset'">outset</xsl:when>
  226. <xsl:when test="$value='inset'">inset</xsl:when>
  227. <xsl:otherwise>solid</xsl:otherwise>
  228. </xsl:choose>
  229. </xsl:template>
  230. <xsl:template name="EvalTableWidth">
  231. <xsl:choose>
  232. <xsl:when test="@w:type = 'pct'">
  233. <xsl:value-of select="@w:w div 50"/>%
  234. </xsl:when>
  235. <xsl:otherwise>
  236. <xsl:value-of select="@w:w div 20"/>pt
  237. </xsl:otherwise>
  238. </xsl:choose>
  239. </xsl:template>
  240. <xsl:template name="ConvColor">
  241. <xsl:param name="value"/>
  242. <xsl:choose>
  243. <xsl:when test="$value='black'">black</xsl:when>
  244. <xsl:when test="$value='blue'">blue</xsl:when>
  245. <xsl:when test="$value='cyan'">aqua</xsl:when>
  246. <xsl:when test="$value='green'">lime</xsl:when>
  247. <xsl:when test="$value='magenta'">fuchsia</xsl:when>
  248. <xsl:when test="$value='red'">red</xsl:when>
  249. <xsl:when test="$value='yellow'">yellow</xsl:when>
  250. <xsl:when test="$value='white'">white</xsl:when>
  251. <xsl:when test="$value='darkBlue'">navy</xsl:when>
  252. <xsl:when test="$value='darkCyan'">teal</xsl:when>
  253. <xsl:when test="$value='darkGreen'">green</xsl:when>
  254. <xsl:when test="$value='darkMagenta'">purple</xsl:when>
  255. <xsl:when test="$value='darkRed'">maroon</xsl:when>
  256. <xsl:when test="$value='darkYellow'">olive</xsl:when>
  257. <xsl:when test="$value='darkGray'">gray</xsl:when>
  258. <xsl:when test="$value='lightGray'">silver</xsl:when>
  259. <xsl:when test="$value='none'">transparent</xsl:when>
  260. </xsl:choose>
  261. </xsl:template>
  262. <xsl:template name="ConvHexColor">
  263. <xsl:param name="value"/>
  264. <xsl:param name="autoColor" select="$autoColor_text"/>
  265. <xsl:param name="transparentColor">transparent</xsl:param>
  266. <xsl:choose>
  267. <xsl:when test="$value = $autoColor_hex or $value = ''">
  268. <xsl:value-of select="$autoColor"/>
  269. </xsl:when>
  270. <xsl:when test="$value = $transparentColor_hex">
  271. <xsl:value-of select="$transparentColor"/>
  272. </xsl:when>
  273. <xsl:otherwise>
  274. <xsl:value-of select="concat('#',$value)"/>
  275. </xsl:otherwise>
  276. </xsl:choose>
  277. </xsl:template>
  278. <!--template of underline,strikethrough-->
  279. <xsl:template name="EvalBooleanType">
  280. <xsl:choose>
  281. <xsl:when test="string-length(@w:val) = 0 or @w:val = 'off' or @w:val = 'none' or @w:val = '0' ">
  282. <xsl:value-of select="$off"/>
  283. </xsl:when>
  284. <xsl:otherwise>
  285. <xsl:value-of select="$on"/>
  286. </xsl:otherwise>
  287. </xsl:choose>
  288. </xsl:template>
  289. <xsl:template name="GetBorderPr">
  290. <xsl:value-of select="@w:val"/>
  291. <xsl:value-of select="$sep2"/>
  292. <xsl:value-of select="@w:color"/>
  293. <xsl:value-of select="$sep2"/>
  294. <xsl:choose>
  295. <xsl:when test="@w:sz">
  296. <xsl:value-of select="@w:sz * 2.5"/>
  297. <xsl:value-of select="$sep2"/>
  298. </xsl:when>
  299. <xsl:otherwise>
  300. 0<xsl:value-of select="$sep2"/>
  301. </xsl:otherwise>
  302. </xsl:choose>
  303. <xsl:value-of select="@w:space"/>
  304. <xsl:value-of select="$sep2"/>
  305. <xsl:value-of select="@w:shadow"/>
  306. </xsl:template>
  307. <xsl:template name="ApplyBorderPr">
  308. <xsl:param name="pr.bdr"/>
  309. <xsl:param name="bdrSide" select="$bdrSide_char"/>
  310. <xsl:if test="not($pr.bdr='')">
  311. <xsl:text>border</xsl:text>
  312. <xsl:value-of select="$bdrSide"/>
  313. <xsl:text>:</xsl:text>
  314. <xsl:call-template name="ConvBorderStyle">
  315. <xsl:with-param name="value" select="substring-before($pr.bdr,$sep2)"/>
  316. </xsl:call-template>
  317. <xsl:variable name="temp" select="substring-after($pr.bdr,$sep2)"/>
  318. <xsl:text> </xsl:text>
  319. <xsl:call-template name="ConvHexColor">
  320. <xsl:with-param name="value" select="substring-before($temp,$sep2)"/>
  321. </xsl:call-template>
  322. <xsl:text> </xsl:text>
  323. <xsl:value-of select="substring-before(substring-after($temp,$sep2),$sep2) div 20"/>
  324. <xsl:text>pt;</xsl:text>
  325. <xsl:if test="$bdrSide = $bdrSide_char">padding:0;</xsl:if>
  326. </xsl:if>
  327. </xsl:template>
  328. <xsl:variable name="valid_hex_digits" select="'0123456789ABCDEF'"/>
  329. <xsl:template name="TwoHexToDec">
  330. <xsl:param name="value"/>
  331. <xsl:choose>
  332. <xsl:when test="string-length($value) = 0">
  333. <xsl:value-of select="0"/>
  334. </xsl:when>
  335. <xsl:when test="string-length($value) = 1">
  336. <xsl:value-of select="string-length(substring-before($valid_hex_digits,substring($value,1,1)))"/>
  337. </xsl:when>
  338. <xsl:otherwise>
  339. <xsl:variable name="digit1_16" select="substring($value,1,1)"/>
  340. <xsl:variable name="digit2_16" select="substring($value,2,1)"/>
  341. <xsl:variable name="digit1_10" select="string-length(substring-before($valid_hex_digits,$digit1_16))"/>
  342. <xsl:variable name="digit2_10" select="string-length(substring-before($valid_hex_digits,$digit2_16))"/>
  343. <xsl:value-of select="$digit1_10 * 16 + $digit2_10"/>
  344. </xsl:otherwise>
  345. </xsl:choose>
  346. </xsl:template>
  347. <xsl:template name="DecToTwoHex">
  348. <xsl:param name="value"/>
  349. <xsl:variable name="digit1_10" select="floor($value div 16)"/>
  350. <xsl:variable name="digit2_10" select="$value mod 16"/>
  351. <xsl:variable name="digit1_16" select="substring($valid_hex_digits,$digit1_10 + 1,1)"/>
  352. <xsl:variable name="digit2_16" select="substring($valid_hex_digits,$digit2_10 + 1,1)"/>
  353. <xsl:value-of select="concat($digit1_16,$digit2_16)"/>
  354. </xsl:template>
  355. <xsl:template name="ApplyShdPct">
  356. <xsl:param name="value"/>
  357. <xsl:param name="pct"/>
  358. <xsl:param name="transparentColor">transparent</xsl:param>
  359. <xsl:choose>
  360. <xsl:when test="$value = $autoColor_hex or $value = ''">
  361. <xsl:call-template name="ApplyShdPct">
  362. <xsl:with-param name="value" select="'FFFFFF'"/>
  363. <xsl:with-param name="pct" select="$pct"/>
  364. </xsl:call-template>
  365. </xsl:when>
  366. <xsl:when test="$value = $transparentColor_hex">
  367. <xsl:value-of select="$transparentColor"/>
  368. </xsl:when>
  369. <xsl:otherwise>
  370. <xsl:variable name="r">
  371. <xsl:call-template name="TwoHexToDec">
  372. <xsl:with-param name="value" select="substring($value,1,2)"/>
  373. </xsl:call-template>
  374. </xsl:variable>
  375. <xsl:variable name="g">
  376. <xsl:call-template name="TwoHexToDec">
  377. <xsl:with-param name="value" select="substring($value,3,2)"/>
  378. </xsl:call-template>
  379. </xsl:variable>
  380. <xsl:variable name="b">
  381. <xsl:call-template name="TwoHexToDec">
  382. <xsl:with-param name="value" select="substring($value,5,2)"/>
  383. </xsl:call-template>
  384. </xsl:variable>
  385. <xsl:value-of select="'#'"/>
  386. <xsl:call-template name="DecToTwoHex">
  387. <xsl:with-param name="value" select="round(number($r) * $pct)"/>
  388. </xsl:call-template>
  389. <xsl:call-template name="DecToTwoHex">
  390. <xsl:with-param name="value" select="round(number($g) * $pct)"/>
  391. </xsl:call-template>
  392. <xsl:call-template name="DecToTwoHex">
  393. <xsl:with-param name="value" select="round(number($b) * $pct)"/>
  394. </xsl:call-template>
  395. </xsl:otherwise>
  396. </xsl:choose>
  397. </xsl:template>
  398. <xsl:template name="ApplyShd">
  399. <xsl:variable name="backgroundColor">
  400. <xsl:choose>
  401. <xsl:when test="@w:val = 'clear' or not(@w:val)">
  402. <xsl:call-template name="ConvHexColor">
  403. <xsl:with-param name="value" select="@w:fill"/>
  404. <xsl:with-param name="autoColor" select="$autoColor_bg"/>
  405. </xsl:call-template>
  406. </xsl:when>
  407. <xsl:when test="@w:val = 'solid'">#000000</xsl:when>
  408. <xsl:when test="substring(@w:val,1,3) = 'pct'">
  409. <xsl:call-template name="ApplyShdPct">
  410. <xsl:with-param name="value" select="@w:fill"/>
  411. <xsl:with-param name="autoColor" select="$autoColor_bg"/>
  412. <xsl:with-param name="pct" select="(100 - number(substring(@w:val,4))) div 100"/>
  413. </xsl:call-template>
  414. </xsl:when>
  415. <xsl:otherwise>
  416. <xsl:call-template name="ConvHexColor">
  417. <xsl:with-param name="value" select="@WX:bgcolor"/>
  418. <xsl:with-param name="autoColor" select="$autoColor_bg"/>
  419. </xsl:call-template>
  420. </xsl:otherwise>
  421. </xsl:choose>
  422. </xsl:variable>
  423. <xsl:text>background-color:</xsl:text>
  424. <xsl:value-of select="$backgroundColor"/>
  425. <!--<xsl:variable select="backgroundColor"/>-->
  426. <xsl:text>;</xsl:text>
  427. <xsl:call-template name="ApplyAutoForeColor">
  428. <xsl:with-param name="backgroundColor" select="$backgroundColor"/>
  429. </xsl:call-template>
  430. </xsl:template>
  431. <xsl:template name="ApplyAutoForeColor">
  432. <xsl:param name="backgroundColor"/>
  433. <xsl:if test="contains($backgroundColor,'#')">
  434. <xsl:variable name="backgroundHex" select="substring-after($backgroundColor,'#')"/>
  435. <xsl:variable name="r">
  436. <xsl:call-template name="TwoHexToDec">
  437. <xsl:with-param name="value" select="substring($backgroundHex,1,2)"/>
  438. </xsl:call-template>
  439. </xsl:variable>
  440. <xsl:variable name="g">
  441. <xsl:call-template name="TwoHexToDec">
  442. <xsl:with-param name="value" select="substring($backgroundHex,3,2)"/>
  443. </xsl:call-template>
  444. </xsl:variable>
  445. <xsl:variable name="b">
  446. <xsl:call-template name="TwoHexToDec">
  447. <xsl:with-param name="value" select="substring($backgroundHex,5,2)"/>
  448. </xsl:call-template>
  449. </xsl:variable>
  450. <xsl:if test="0.299 * number($r) + 0.587 * number($g) + 0.114 * number($b) &lt;= 60">
  451. <xsl:text>color:#FFFFFF;</xsl:text>
  452. </xsl:if>
  453. </xsl:if>
  454. </xsl:template>
  455. <xsl:template name="ApplyShdHint">
  456. <xsl:text>background-color:</xsl:text>
  457. <xsl:call-template name="ConvHexColor">
  458. <xsl:with-param name="value" select="@WX:bgcolor"/>
  459. <xsl:with-param name="autoColor" select="$autoColor_bg"/>
  460. <xsl:with-param name="transparentColor">transparent</xsl:with-param>
  461. </xsl:call-template>
  462. <xsl:text>;</xsl:text>
  463. </xsl:template>
  464. <xsl:template name="ApplyTextDirection">
  465. <xsl:text>layout-flow:</xsl:text>
  466. <xsl:choose>
  467. <xsl:when test="@w:val = 'tb-rl-v'">vertical-ideographic</xsl:when>
  468. <xsl:when test="@w:val = 'lr-tb-v'">horizontal-ideographic</xsl:when>
  469. <xsl:otherwise>normal</xsl:otherwise>
  470. </xsl:choose>
  471. <xsl:text>;</xsl:text>
  472. </xsl:template>
  473. <xsl:template name="ApplyCellMar">
  474. <xsl:choose>
  475. <xsl:when test="@w:val='none'">none</xsl:when>
  476. <xsl:otherwise>
  477. <xsl:text>padding:</xsl:text>
  478. <xsl:choose>
  479. <xsl:when test="w:top">
  480. <xsl:for-each select="w:top[1]">
  481. <xsl:call-template name="EvalTableWidth"/>
  482. </xsl:for-each>
  483. </xsl:when>
  484. <xsl:otherwise>0</xsl:otherwise>
  485. </xsl:choose>
  486. <xsl:text> </xsl:text>
  487. <xsl:choose>
  488. <xsl:when test="w:right">
  489. <xsl:for-each select="w:right[1]">
  490. <xsl:call-template name="EvalTableWidth"/>
  491. </xsl:for-each>
  492. </xsl:when>
  493. <xsl:otherwise>0</xsl:otherwise>
  494. </xsl:choose>
  495. <xsl:text> </xsl:text>
  496. <xsl:choose>
  497. <xsl:when test="w:bottom">
  498. <xsl:for-each select="w:bottom[1]">
  499. <xsl:call-template name="EvalTableWidth"/>
  500. </xsl:for-each>
  501. </xsl:when>
  502. <xsl:otherwise>0</xsl:otherwise>
  503. </xsl:choose>
  504. <xsl:text> </xsl:text>
  505. <xsl:choose>
  506. <xsl:when test="w:left">
  507. <xsl:for-each select="w:left[1]">
  508. <xsl:call-template name="EvalTableWidth"/>
  509. </xsl:for-each>
  510. </xsl:when>
  511. <xsl:otherwise>0</xsl:otherwise>
  512. </xsl:choose>
  513. <xsl:text>;</xsl:text>
  514. </xsl:otherwise>
  515. </xsl:choose>
  516. </xsl:template>
  517. <xsl:template name="PrsUpdatePPr">
  518. <xsl:param name="prsP" select="$prsPDefault"/>
  519. <xsl:param name="ndPrContainer" select="."/>
  520. <xsl:variable name="prsPTemp">
  521. <xsl:for-each select="$ndPrContainer">
  522. <xsl:call-template name="PrsUpdatePPrCore">
  523. <xsl:with-param name="prsP" select="$prsP"/>
  524. </xsl:call-template>
  525. </xsl:for-each>
  526. </xsl:variable>
  527. <xsl:choose>
  528. <xsl:when test="$prsPTemp=''">
  529. <xsl:value-of select="$prsP"/>
  530. </xsl:when>
  531. <xsl:otherwise>
  532. <xsl:value-of select="$prsPTemp"/>
  533. </xsl:otherwise>
  534. </xsl:choose>
  535. </xsl:template>
  536. <xsl:template name="FetchBasedOnPropertyBoolean">
  537. <xsl:param name="match" select="''"/>
  538. <xsl:choose>
  539. <xsl:when test="$match">
  540. <xsl:for-each select="$match">
  541. <xsl:call-template name="EvalBooleanType"/>
  542. </xsl:for-each>
  543. </xsl:when>
  544. <xsl:when test="../w:basedOn">
  545. <xsl:variable name="sBasedOn">
  546. <xsl:value-of select="../w:basedOn/@w:val"/>
  547. </xsl:variable>
  548. <xsl:for-each select="$nsStyles[@w:styleId=$sBasedOn]">
  549. <xsl:call-template name="FetchBasedOnPropertyBoolean">
  550. <xsl:with-param name="match" select="$match"/>
  551. </xsl:call-template>
  552. </xsl:for-each>
  553. </xsl:when>
  554. <xsl:otherwise>
  555. <xsl:value-of select="$na"/>
  556. </xsl:otherwise>
  557. </xsl:choose>
  558. </xsl:template>
  559. <xsl:variable name="fbopModeIndentLeft" select="'1'"/>
  560. <xsl:variable name="fbopModeIndentLeftChars" select="'2'"/>
  561. <xsl:variable name="fbopModeIndentRight" select="'3'"/>
  562. <xsl:variable name="fbopModeIndentRightChars" select="'4'"/>
  563. <xsl:variable name="fbopModeIndentHanging" select="'5'"/>
  564. <xsl:variable name="fbopModeIndentHangingChars" select="'6'"/>
  565. <xsl:variable name="fbopModeIndentFirstLine" select="'7'"/>
  566. <xsl:variable name="fbopModeIndentFirstLineChars" select="'8'"/>
  567. <xsl:template name="FetchBasedOnProperty">
  568. <xsl:param name="mode" select="''"/>
  569. <xsl:param name="sDefault" select="''"/>
  570. <xsl:variable name="sValue">
  571. <xsl:choose>
  572. <xsl:when test="$mode=$fbopModeIndentLeft">
  573. <xsl:value-of select="w:ind[1]/@w:left"/>
  574. </xsl:when>
  575. <xsl:when test="$mode=$fbopModeIndentLeftChars">
  576. <xsl:value-of select="w:ind[1]/@w:leftChars"/>
  577. </xsl:when>
  578. <xsl:when test="$mode=$fbopModeIndentRight">
  579. <xsl:value-of select="w:ind[1]/@w:right"/>
  580. </xsl:when>
  581. <xsl:when test="$mode=$fbopModeIndentRightChars">
  582. <xsl:value-of select="w:ind[1]/@w:rightChars"/>
  583. </xsl:when>
  584. <xsl:when test="$mode=$fbopModeIndentHanging">
  585. <xsl:value-of select="w:ind[1]/@w:hanging"/>
  586. </xsl:when>
  587. <xsl:when test="$mode=$fbopModeIndentHangingChars">
  588. <xsl:value-of select="w:ind[1]/@w:hangingChars"/>
  589. </xsl:when>
  590. <xsl:when test="$mode=$fbopModeIndentFirstLine">
  591. <xsl:value-of select="w:ind[1]/@w:firstLine"/>
  592. </xsl:when>
  593. <xsl:when test="$mode=$fbopModeIndentFirstLineChars">
  594. <xsl:value-of select="w:ind[1]/@w:firstLineChars"/>
  595. </xsl:when>
  596. <xsl:otherwise>
  597. <xsl:text></xsl:text>
  598. </xsl:otherwise>
  599. </xsl:choose>
  600. </xsl:variable>
  601. <xsl:choose>
  602. <xsl:when test="not($sValue='')">
  603. <xsl:value-of select="$sValue"/>
  604. </xsl:when>
  605. <xsl:when test="../w:basedOn">
  606. <xsl:variable name="sBasedOn">
  607. <xsl:value-of select="../w:basedOn/@w:val"/>
  608. </xsl:variable>
  609. <xsl:for-each select="$nsStyles[@w:styleId=$sBasedOn]/w:pPr[1]">
  610. <xsl:call-template name="FetchBasedOnProperty">
  611. <xsl:with-param name="mode" select="$mode"/>
  612. </xsl:call-template>
  613. </xsl:for-each>
  614. </xsl:when>
  615. <xsl:otherwise>
  616. <xsl:value-of select="$sDefault"/>
  617. </xsl:otherwise>
  618. </xsl:choose>
  619. </xsl:template>
  620. <xsl:template name="PrsUpdatePPrCore">
  621. <xsl:param name="prsP" select="$prsPDefault"/>
  622. <xsl:for-each select="w:pPr[1]">
  623. <xsl:variable name="fTextAutospaceO">
  624. <xsl:for-each select="w:autoSpaceDE[1]">
  625. <xsl:call-template name="EvalBooleanType"/>
  626. </xsl:for-each>
  627. </xsl:variable>
  628. <xsl:choose>
  629. <xsl:when test="$fTextAutospaceO=''">
  630. <xsl:value-of select="substring($prsP, $iTextAutospaceO, 1)"/>
  631. </xsl:when>
  632. <xsl:otherwise>
  633. <xsl:value-of select="$fTextAutospaceO"/>
  634. </xsl:otherwise>
  635. </xsl:choose>
  636. <xsl:variable name="fTextAutospaceN">
  637. <xsl:for-each select="w:autoSpaceDN[1]">
  638. <xsl:call-template name="EvalBooleanType"/>
  639. </xsl:for-each>
  640. </xsl:variable>
  641. <xsl:choose>
  642. <xsl:when test="$fTextAutospaceN=''">
  643. <xsl:value-of select="substring($prsP, $iTextAutospaceN, 1)"/>
  644. </xsl:when>
  645. <xsl:otherwise>
  646. <xsl:value-of select="$fTextAutospaceN"/>
  647. </xsl:otherwise>
  648. </xsl:choose>
  649. <xsl:variable name="prsDefaultInd" select="substring($prsP, $iInd)"/>
  650. <xsl:variable name="sDefLeft" select="substring-before($prsDefaultInd,$sep2)"/>
  651. <xsl:variable name="temp1" select="substring-after($prsDefaultInd,$sep2)"/>
  652. <xsl:variable name="sDefLeftChars" select="substring-before($temp1,$sep2)"/>
  653. <xsl:variable name="temp2" select="substring-after($temp1,$sep2)"/>
  654. <xsl:variable name="sDefRight" select="substring-before($temp2,$sep2)"/>
  655. <xsl:variable name="temp3" select="substring-after($temp2,$sep2)"/>
  656. <xsl:variable name="sDefRightChars" select="substring-before($temp3,$sep2)"/>
  657. <xsl:variable name="temp4" select="substring-after($temp3,$sep2)"/>
  658. <xsl:variable name="sDefHanging" select="substring-before($temp4,$sep2)"/>
  659. <xsl:variable name="temp5" select="substring-after($temp4,$sep2)"/>
  660. <xsl:variable name="sDefHangingChars" select="substring-before($temp5,$sep2)"/>
  661. <xsl:variable name="temp6" select="substring-after($temp5,$sep2)"/>
  662. <xsl:variable name="sDefFirstLine" select="substring-before($temp6,$sep2)"/>
  663. <xsl:variable name="sDefFirstLineChars" select="substring-after($temp6,$sep2)"/>
  664. <xsl:variable name="nInd">
  665. <xsl:call-template name="FetchBasedOnProperty">
  666. <xsl:with-param name="mode" select="$fbopModeIndentLeft"/>
  667. <xsl:with-param name="sDefault" select="$sDefLeft"/>
  668. </xsl:call-template>
  669. <xsl:value-of select="$sep2"/>
  670. <xsl:call-template name="FetchBasedOnProperty">
  671. <xsl:with-param name="mode" select="$fbopModeIndentLeftChars"/>
  672. <xsl:with-param name="sDefault" select="$sDefLeftChars"/>
  673. </xsl:call-template>
  674. <xsl:value-of select="$sep2"/>
  675. <xsl:call-template name="FetchBasedOnProperty">
  676. <xsl:with-param name="mode" select="$fbopModeIndentRight"/>
  677. <xsl:with-param name="sDefault" select="$sDefRight"/>
  678. </xsl:call-template>
  679. <xsl:value-of select="$sep2"/>
  680. <xsl:call-template name="FetchBasedOnProperty">
  681. <xsl:with-param name="mode" select="$fbopModeIndentRightChars"/>
  682. <xsl:with-param name="sDefault" select="$sDefRightChars"/>
  683. </xsl:call-template>
  684. <xsl:value-of select="$sep2"/>
  685. <xsl:call-template name="FetchBasedOnProperty">
  686. <xsl:with-param name="mode" select="$fbopModeIndentHanging"/>
  687. <xsl:with-param name="sDefault" select="$sDefHanging"/>
  688. </xsl:call-template>
  689. <xsl:value-of select="$sep2"/>
  690. <xsl:call-template name="FetchBasedOnProperty">
  691. <xsl:with-param name="mode" select="$fbopModeIndentHangingChars"/>
  692. <xsl:with-param name="sDefault" select="$sDefHangingChars"/>
  693. </xsl:call-template>
  694. <xsl:value-of select="$sep2"/>
  695. <xsl:call-template name="FetchBasedOnProperty">
  696. <xsl:with-param name="mode" select="$fbopModeIndentFirstLine"/>
  697. <xsl:with-param name="sDefault" select="$sDefFirstLine"/>
  698. </xsl:call-template>
  699. <xsl:value-of select="$sep2"/>
  700. <xsl:call-template name="FetchBasedOnProperty">
  701. <xsl:with-param name="mode" select="$fbopModeIndentFirstLineChars"/>
  702. <xsl:with-param name="sDefault" select="$sDefFirstLineChars"/>
  703. </xsl:call-template>
  704. </xsl:variable>
  705. <xsl:choose>
  706. <xsl:when test="$nInd=''">
  707. <xsl:value-of select="substring($prsP, $iInd)"/>
  708. </xsl:when>
  709. <xsl:otherwise>
  710. <xsl:value-of select="$nInd"/>
  711. </xsl:otherwise>
  712. </xsl:choose>
  713. </xsl:for-each>
  714. </xsl:template>
  715. <xsl:template name="PrsUpdateRPr">
  716. <xsl:param name="prsR" select="$prsRDefault"/>
  717. <xsl:param name="ndPrContainer" select="."/>
  718. <xsl:variable name="prsRTemp">
  719. <xsl:for-each select="$ndPrContainer">
  720. <xsl:call-template name="PrsUpdateRPrCore">
  721. <xsl:with-param name="prsR" select="$prsR"/>
  722. </xsl:call-template>
  723. </xsl:for-each>
  724. </xsl:variable>
  725. <xsl:choose>
  726. <xsl:when test="$prsRTemp=''">
  727. <xsl:value-of select="$prsR"/>
  728. </xsl:when>
  729. <xsl:otherwise>
  730. <xsl:value-of select="$prsRTemp"/>
  731. </xsl:otherwise>
  732. </xsl:choose>
  733. </xsl:template>
  734. <xsl:template name="PrsUpdateRPrCore">
  735. <xsl:param name="prsR"/>
  736. <xsl:param name="type" select="$prrNonList"/>
  737. <xsl:for-each select="w:rPr[1]">
  738. <xsl:variable name="fEmbossImprint">
  739. <xsl:variable name="condition1">
  740. <xsl:for-each select="w:emboss[1]">
  741. <xsl:call-template name="EvalBooleanType"/>
  742. </xsl:for-each>
  743. </xsl:variable>
  744. <xsl:variable name="condition2">
  745. <xsl:for-each select="w:imprint[1]">
  746. <xsl:call-template name="EvalBooleanType"/>
  747. </xsl:for-each>
  748. </xsl:variable>
  749. <xsl:choose>
  750. <xsl:when test="$condition1 = $on or $condition2 = $on">
  751. <xsl:value-of select="$on"/>
  752. </xsl:when>
  753. <xsl:when test="$condition1 = $off or $condition2 = $off">
  754. <xsl:value-of select="$off"/>
  755. </xsl:when>
  756. </xsl:choose>
  757. </xsl:variable>
  758. <xsl:choose>
  759. <xsl:when test="$fEmbossImprint = ''">
  760. <xsl:value-of select="substring($prsR,$iEmbossImprint,1)"/>
  761. </xsl:when>
  762. <xsl:otherwise>
  763. <xsl:value-of select="$fEmbossImprint"/>
  764. </xsl:otherwise>
  765. </xsl:choose>
  766. <xsl:variable name="fU_Em">
  767. <xsl:variable name="condition1">
  768. <!--here is the underline tag-->
  769. <xsl:for-each select="w:u[1]">
  770. <xsl:call-template name="EvalBooleanType"/>
  771. </xsl:for-each>
  772. </xsl:variable>
  773. <xsl:variable name="condition2">
  774. <xsl:for-each select="w:em[1]">
  775. <xsl:call-template name="EvalBooleanType"/>
  776. </xsl:for-each>
  777. </xsl:variable>
  778. <xsl:choose>
  779. <xsl:when test="$condition1 = $on or $condition2 = $on">
  780. <xsl:value-of select="$on"/>
  781. </xsl:when>
  782. <xsl:when test="$condition1 = $off or $condition2 = $off">
  783. <xsl:value-of select="$off"/>
  784. </xsl:when>
  785. </xsl:choose>
  786. </xsl:variable>
  787. <xsl:choose>
  788. <xsl:when test="$fU_Em = ''">
  789. <xsl:choose>
  790. <xsl:when test="$type=$prrList">
  791. <xsl:value-of select="$off"/>
  792. </xsl:when>
  793. <xsl:otherwise>
  794. <xsl:value-of select="substring($prsR,$iU_Em,1)"/>
  795. </xsl:otherwise>
  796. </xsl:choose>
  797. </xsl:when>
  798. <xsl:otherwise>
  799. <xsl:value-of select="$fU_Em"/>
  800. </xsl:otherwise>
  801. </xsl:choose>
  802. <xsl:variable name="fStrikeDStrike">
  803. <xsl:variable name="condition1">
  804. <xsl:for-each select="w:strike[1]">
  805. <xsl:value-of select="$on"/>
  806. </xsl:for-each>
  807. </xsl:variable>
  808. <xsl:variable name="condition2">
  809. <xsl:for-each select="w:dstrike[1]">
  810. <xsl:call-template name="EvalBooleanType"/>
  811. </xsl:for-each>
  812. </xsl:variable>
  813. <xsl:choose>
  814. <xsl:when test="$condition1 = $on or $condition2 = $on">
  815. <xsl:value-of select="$on"/>
  816. </xsl:when>
  817. <xsl:when test="$condition1 = $off or $condition2 = $off">
  818. <xsl:value-of select="$off"/>
  819. </xsl:when>
  820. </xsl:choose>
  821. </xsl:variable>
  822. <xsl:choose>
  823. <xsl:when test="$fStrikeDStrike = ''">
  824. <xsl:value-of select="substring($prsR,$iStrikeDStrike,1)"/>
  825. </xsl:when>
  826. <xsl:otherwise>
  827. <xsl:value-of select="$fStrikeDStrike"/>
  828. </xsl:otherwise>
  829. </xsl:choose>
  830. <xsl:variable name="fSup">
  831. <xsl:choose>
  832. <xsl:when test="w:vertAlign/@w:val='superscript'">
  833. <xsl:value-of select="$on"/>
  834. </xsl:when>
  835. <xsl:otherwise>
  836. <xsl:value-of select="$off"/>
  837. </xsl:otherwise>
  838. </xsl:choose>
  839. </xsl:variable>
  840. <xsl:choose>
  841. <xsl:when test="not(w:vertAlign)">
  842. <xsl:value-of select="substring($prsR,$iSup,1)"/>
  843. </xsl:when>
  844. <xsl:otherwise>
  845. <xsl:value-of select="$fSup"/>
  846. </xsl:otherwise>
  847. </xsl:choose>
  848. <xsl:variable name="fSub">
  849. <xsl:choose>
  850. <xsl:when test="w:vertAlign/@w:val='subscript'">
  851. <xsl:value-of select="$on"/>
  852. </xsl:when>
  853. <xsl:otherwise>
  854. <xsl:value-of select="$off"/>
  855. </xsl:otherwise>
  856. </xsl:choose>
  857. </xsl:variable>
  858. <xsl:choose>
  859. <xsl:when test="not(w:vertAlign)">
  860. <xsl:value-of select="substring($prsR,$iSub,1)"/>
  861. </xsl:when>
  862. <xsl:otherwise>
  863. <xsl:value-of select="$fSub"/>
  864. </xsl:otherwise>
  865. </xsl:choose>
  866. <xsl:variable name="fVanishWebHidden">
  867. <xsl:variable name="condition1">
  868. <xsl:for-each select="w:vanish[1]">
  869. <xsl:call-template name="EvalBooleanType"/>
  870. </xsl:for-each>
  871. </xsl:variable>
  872. <xsl:variable name="condition2">
  873. <xsl:for-each select="w:webHidden[1]">
  874. <xsl:call-template name="EvalBooleanType"/>
  875. </xsl:for-each>
  876. </xsl:variable>
  877. <xsl:choose>
  878. <xsl:when test="$condition1 = $on or $condition2 = $on">
  879. <xsl:value-of select="$on"/>
  880. </xsl:when>
  881. <xsl:when test="$condition1 = $off or $condition2 = $off">
  882. <xsl:value-of select="$off"/>
  883. </xsl:when>
  884. </xsl:choose>
  885. </xsl:variable>
  886. <xsl:choose>
  887. <xsl:when test="$fVanishWebHidden = ''">
  888. <xsl:value-of select="substring($prsR,$iVanishWebHidden,1)"/>
  889. </xsl:when>
  890. <xsl:otherwise>
  891. <xsl:value-of select="$fVanishWebHidden"/>
  892. </xsl:otherwise>
  893. </xsl:choose>
  894. <xsl:variable name="fBCs">
  895. <xsl:for-each select="w:bCs[1]">
  896. <xsl:call-template name="EvalBooleanType"/>
  897. </xsl:for-each>
  898. </xsl:variable>
  899. <xsl:choose>
  900. <xsl:when test="$fBCs = ''">
  901. <xsl:value-of select="substring($prsR,$iBCs,1)"/>
  902. </xsl:when>
  903. <xsl:otherwise>
  904. <xsl:value-of select="$fBCs"/>
  905. </xsl:otherwise>
  906. </xsl:choose>
  907. <xsl:variable name="fICs">
  908. <xsl:for-each select="w:iCs[1]">
  909. <xsl:call-template name="EvalBooleanType"/>
  910. </xsl:for-each>
  911. </xsl:variable>
  912. <xsl:choose>
  913. <xsl:when test="$fICs = ''">
  914. <xsl:value-of select="substring($prsR,$iICs,1)"/>
  915. </xsl:when>
  916. <xsl:otherwise>
  917. <xsl:value-of select="$fICs"/>
  918. </xsl:otherwise>
  919. </xsl:choose>
  920. <xsl:variable name="szAsciiTheme" select="string(w:rFonts[1]/@w:asciiTheme)"/>
  921. <xsl:choose>
  922. <xsl:when test="$szAsciiTheme = ''">
  923. <xsl:value-of select="substring($prsR,$iAsciiTheme,1)"/>
  924. </xsl:when>
  925. <xsl:otherwise>
  926. <xsl:call-template name="EvalThemeType">
  927. <xsl:with-param name="themeStyle" select="$szAsciiTheme"/>
  928. </xsl:call-template>
  929. </xsl:otherwise>
  930. </xsl:choose>
  931. <xsl:variable name="szAnsiTheme" select="string(w:rFonts[1]/@w:hAnsiTheme)"/>
  932. <xsl:choose>
  933. <xsl:when test="$szAnsiTheme = ''">
  934. <xsl:value-of select="substring($prsR,$iAnsiTheme,1)"/>
  935. </xsl:when>
  936. <xsl:otherwise>
  937. <xsl:call-template name="EvalThemeType">
  938. <xsl:with-param name="themeStyle" select="$szAnsiTheme"/>
  939. </xsl:call-template>
  940. </xsl:otherwise>
  941. </xsl:choose>
  942. <xsl:variable name="szEATheme" select="string(w:rFonts[1]/@w:eastAsiaTheme)"/>
  943. <xsl:choose>
  944. <xsl:when test="$szEATheme = ''">
  945. <xsl:value-of select="substring($prsR,$iEATheme,1)"/>
  946. </xsl:when>
  947. <xsl:otherwise>
  948. <xsl:call-template name="EvalThemeType">
  949. <xsl:with-param name="themeStyle" select="$szEATheme"/>
  950. </xsl:call-template>
  951. </xsl:otherwise>
  952. </xsl:choose>
  953. <xsl:variable name="szCSTheme" select="string(w:rFonts[1]/@w:cstheme)"/>
  954. <xsl:choose>
  955. <xsl:when test="$szCSTheme = ''">
  956. <xsl:value-of select="substring($prsR,$iCSTheme,1)"/>
  957. </xsl:when>
  958. <xsl:otherwise>
  959. <xsl:call-template name="EvalThemeType">
  960. <xsl:with-param name="themeStyle" select="$szCSTheme"/>
  961. </xsl:call-template>
  962. </xsl:otherwise>
  963. </xsl:choose>
  964. <xsl:variable name="nSzCs" select="string(w:szCs[1]/@w:val)"/>
  965. <xsl:choose>
  966. <xsl:when test="$nSzCs = ''">
  967. <xsl:value-of select="substring($prsR,$ISzCs)"/>
  968. </xsl:when>
  969. <xsl:otherwise>
  970. <xsl:value-of select="$nSzCs"/>
  971. </xsl:otherwise>
  972. </xsl:choose>
  973. </xsl:for-each>
  974. </xsl:template>
  975. <xsl:template name="EvalThemeType">
  976. <xsl:param name="themeStyle"/>
  977. <xsl:choose>
  978. <xsl:when test="$themeStyle = 'minorAscii'">
  979. <xsl:value-of select="$minorAscii"/>
  980. </xsl:when>
  981. <xsl:when test="$themeStyle = 'majorAscii'">
  982. <xsl:value-of select="$majorAscii"/>
  983. </xsl:when>
  984. <xsl:when test="$themeStyle = 'minorHAnsi'">
  985. <xsl:value-of select="$minorAnsi"/>
  986. </xsl:when>
  987. <xsl:when test="$themeStyle = 'majorHAnsi'">
  988. <xsl:value-of select="$majorAnsi"/>
  989. </xsl:when>
  990. <xsl:when test="$themeStyle = 'minorEastAsia'">
  991. <xsl:value-of select="$minorEA"/>
  992. </xsl:when>
  993. <xsl:when test="$themeStyle = 'majorEastAsia'">
  994. <xsl:value-of select="$majorEA"/>
  995. </xsl:when>
  996. <xsl:when test="$themeStyle = 'minorBidi'">
  997. <xsl:value-of select="$minorCS"/>
  998. </xsl:when>
  999. <xsl:when test="$themeStyle = 'majorBidi'">
  1000. <xsl:value-of select="$majorCS"/>
  1001. </xsl:when>
  1002. </xsl:choose>
  1003. </xsl:template>
  1004. <xsl:template name="PrsGetListPr">
  1005. <xsl:param name="type"/>
  1006. <xsl:param name="prsR"/>
  1007. <xsl:for-each select="w:numPr">
  1008. <xsl:choose>
  1009. <xsl:when test="w:numId and w:ilvl">
  1010. <xsl:call-template name="PrsGetListPrCore">
  1011. <xsl:with-param name="type" select="$type"/>
  1012. <xsl:with-param name="prsR" select="$prsR"/>
  1013. </xsl:call-template>
  1014. </xsl:when>
  1015. <xsl:otherwise>
  1016. <xsl:variable name="pstyleId">
  1017. <xsl:for-each select="ancestor::w:p[1]">
  1018. <xsl:call-template name="GetPStyleId"/>
  1019. </xsl:for-each>
  1020. </xsl:variable>
  1021. <xsl:for-each select="($nsStyles[@w:styleId=$pstyleId])[1]/w:pPr[1]/w:numPr[1]">
  1022. <xsl:call-template name="PrsGetListPrCore">
  1023. <xsl:with-param name="type" select="$type"/>
  1024. <xsl:with-param name="prsR" select="$prsR"/>
  1025. </xsl:call-template>
  1026. </xsl:for-each>
  1027. </xsl:otherwise>
  1028. </xsl:choose>
  1029. </xsl:for-each>
  1030. </xsl:template>
  1031. <xsl:template name="PrsGetListPrCore">
  1032. <xsl:param name="type"/>
  1033. <xsl:param name="prsR"/>
  1034. <xsl:variable name="numId" select="w:numId/@w:val"/>
  1035. <xsl:variable name="ilvl" select="w:ilvl/@w:val"/>
  1036. <xsl:for-each select="$ndLists">
  1037. <xsl:variable name="list" select="w:num[@w:numId=$numId][1]"/>
  1038. <xsl:choose>
  1039. <xsl:when test="w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  1040. <xsl:for-each select="w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  1041. <xsl:call-template name="PrsGetListPrFromListDef">
  1042. <xsl:with-param name="type" select="$type"/>
  1043. <xsl:with-param name="prsR" select="$prsR"/>
  1044. </xsl:call-template>
  1045. </xsl:for-each>
  1046. <xsl:if test="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  1047. <xsl:for-each select="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  1048. <xsl:call-template name="PrsGetListPrFromListDef">
  1049. <xsl:with-param name="type" select="$type"/>
  1050. <xsl:with-param name="prsR" select="$prsR"/>
  1051. </xsl:call-template>
  1052. </xsl:for-each>
  1053. </xsl:if>
  1054. </xsl:when>
  1055. <xsl:when test="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  1056. <xsl:for-each select="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  1057. <xsl:call-template name="PrsGetListPrFromListDef">
  1058. <xsl:with-param name="type" select="$type"/>
  1059. <xsl:with-param name="prsR" select="$prsR"/>
  1060. </xsl:call-template>
  1061. </xsl:for-each>
  1062. </xsl:when>
  1063. <xsl:when test="w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:listStyleLink">
  1064. <xsl:variable name="linkedStyleId" select="w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:listStyleLink/@w:val" />
  1065. <xsl:variable name="linkedStyle" select="$nsStyles[@w:styleId=$linkedStyleId]" />
  1066. <xsl:variable name="linkedList" select="w:num[@w:numId=$linkedStyle/w:pPr/w:numPr/w:numId/@w:val]" />
  1067. <xsl:for-each select="w:abstractNum[@w:abstractNumId=$linkedList/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  1068. <xsl:call-template name="PrsGetListPrFromListDef">
  1069. <xsl:with-param name="type" select="$type"/>
  1070. <xsl:with-param name="prsR" select="$prsR"/>
  1071. </xsl:call-template>
  1072. </xsl:for-each>
  1073. </xsl:when>
  1074. </xsl:choose>
  1075. </xsl:for-each>
  1076. </xsl:template>
  1077. <xsl:template name="PrsGetListPrFromListDef">
  1078. <xsl:param name="type"/>
  1079. <xsl:param name="prsR"/>
  1080. <xsl:choose>
  1081. <xsl:when test="$type = $prrListSuff">
  1082. <xsl:variable name="suff" select="w:suff[1]/@w:val"/>
  1083. <xsl:choose>
  1084. <xsl:when test="$suff = $prListSuff_space or $suff = $prListSuff_nothing">
  1085. <xsl:value-of select="$suff"/>
  1086. </xsl:when>
  1087. <xsl:otherwise>
  1088. <xsl:value-of select="$prListSuff_space"/>
  1089. </xsl:otherwise>
  1090. </xsl:choose>
  1091. </xsl:when>
  1092. <xsl:when test="$type = $prrListInd">
  1093. <xsl:for-each select="w:pPr[1]/w:ind[1]">
  1094. <xsl:value-of select="@w:left"/>
  1095. <xsl:value-of select="$sep2"/>
  1096. <xsl:value-of select="@w:left-chars"/>
  1097. <xsl:value-of select="$sep2"/>
  1098. <xsl:value-of select="@w:hanging"/>
  1099. <xsl:value-of select="$sep2"/>
  1100. <xsl:value-of select="@w:hanging-chars"/>
  1101. </xsl:for-each>
  1102. </xsl:when>
  1103. <xsl:when test="$type = $prrApplyRPr">
  1104. <xsl:call-template name="ApplyRPr.class"/>
  1105. </xsl:when>
  1106. <xsl:when test="$type = $prrUpdateRPr">
  1107. <xsl:call-template name="PrsUpdateRPrCore">
  1108. <xsl:with-param name="type" select="$prrList"/>
  1109. <xsl:with-param name="prsR" select="$prsR"/>
  1110. </xsl:call-template>
  1111. </xsl:when>
  1112. </xsl:choose>
  1113. </xsl:template>
  1114. <xsl:template name="GetSinglePPr">
  1115. <xsl:param name="type"/>
  1116. <xsl:param name="sParaStyleName"/>
  1117. <xsl:variable name="result">
  1118. <xsl:call-template name="GetSinglePPrCore">
  1119. <xsl:with-param name="type" select="$type"/>
  1120. </xsl:call-template>
  1121. </xsl:variable>
  1122. <xsl:if test="$result=''">
  1123. <xsl:for-each select="$sParaStyleName">
  1124. <xsl:call-template name="GetSinglePPrCore">
  1125. <xsl:with-param name="type" select="$type"/>
  1126. </xsl:call-template>
  1127. </xsl:for-each>
  1128. </xsl:if>
  1129. <xsl:value-of select="$result"/>
  1130. </xsl:template>
  1131. <xsl:template name="GetSinglePPrCore">
  1132. <xsl:param name="type"/>
  1133. <xsl:for-each select="w:pPr[1]">
  1134. <xsl:choose>
  1135. <xsl:when test="$type = $prrBdrPr_top">
  1136. <xsl:for-each select="w:bdr[1]/w:top[1]">
  1137. <xsl:call-template name="GetBorderPr"/>
  1138. </xsl:for-each>
  1139. </xsl:when>
  1140. <xsl:when test="$type = $prrBdrPr_right">
  1141. <xsl:for-each select="w:bdr[1]/w:right[1]">
  1142. <xsl:call-template name="GetBorderPr"/>
  1143. </xsl:for-each>
  1144. </xsl:when>
  1145. <xsl:when test="$type = $prrBdrPr_bottom">
  1146. <xsl:for-each select="w:bdr[1]/w:bottom[1]">
  1147. <xsl:call-template name="GetBorderPr"/>
  1148. </xsl:for-each>
  1149. </xsl:when>
  1150. <xsl:when test="$type = $prrBdrPr_left">
  1151. <xsl:for-each select="w:bdr[1]/w:left[1]">
  1152. <xsl:call-template name="GetBorderPr"/>
  1153. </xsl:for-each>
  1154. </xsl:when>
  1155. <xsl:when test="$type = $prrBdrPr_between">
  1156. <xsl:for-each select="w:bdr[1]/w:between[1]">
  1157. <xsl:call-template name="GetBorderPr"/>
  1158. </xsl:for-each>
  1159. </xsl:when>
  1160. <xsl:when test="$type = $prrBdrPr_bar">
  1161. <xsl:for-each select="w:bdr[1]/w:bar[1]">
  1162. <xsl:call-template name="GetBorderPr"/>
  1163. </xsl:for-each>
  1164. </xsl:when>
  1165. <xsl:when test="$type = $prrFrame">
  1166. <xsl:for-each select="w:framePr[1]">
  1167. <xsl:value-of select="@w:w"/>
  1168. <xsl:value-of select="$sep2"/>
  1169. <xsl:value-of select="@w:h"/>
  1170. <xsl:value-of select="$sep2"/>
  1171. <xsl:value-of select="@w:h-rule"/>
  1172. <xsl:value-of select="$sep2"/>
  1173. <xsl:value-of select="@w:x-align"/>
  1174. <xsl:value-of select="$sep2"/>
  1175. <xsl:value-of select="@w:vSpace"/>
  1176. <xsl:value-of select="$sep2"/>
  1177. <xsl:value-of select="@w:hSpace"/>
  1178. <xsl:value-of select="$sep2"/>
  1179. <xsl:value-of select="@w:wrap"/>
  1180. <xsl:value-of select="$sep2"/>
  1181. <xsl:value-of select="@w:drop-cap"/>
  1182. <xsl:value-of select="$sep2"/>
  1183. <xsl:value-of select="@w:lines"/>
  1184. <xsl:value-of select="$sep2"/>
  1185. <xsl:value-of select="@w:x"/>
  1186. <xsl:value-of select="$sep2"/>
  1187. <xsl:value-of select="@w:y-align"/>
  1188. <xsl:value-of select="$sep2"/>
  1189. <xsl:value-of select="@w:y"/>
  1190. <xsl:value-of select="$sep2"/>
  1191. <xsl:value-of select="@w:hAnchor"/>
  1192. <xsl:value-of select="$sep2"/>
  1193. <xsl:value-of select="@w:vAnchor"/>
  1194. <xsl:value-of select="$sep2"/>
  1195. <xsl:value-of select="@w:anchor-lock"/>
  1196. </xsl:for-each>
  1197. </xsl:when>
  1198. </xsl:choose>
  1199. </xsl:for-each>
  1200. </xsl:template>
  1201. <xsl:template name="GetSingleTblPr">
  1202. <xsl:param name="type"/>
  1203. <xsl:param name="sTblStyleName"/>
  1204. <xsl:variable name="result">
  1205. <xsl:call-template name="GetSingleTblPrCore">
  1206. <xsl:with-param name="type" select="$type"/>
  1207. </xsl:call-template>
  1208. </xsl:variable>
  1209. <xsl:if test="$result='' and $sTblStyleName">
  1210. <xsl:for-each select="$sTblStyleName">
  1211. <xsl:call-template name="GetSingleTblPrCore">
  1212. <xsl:with-param name="type" select="$type"/>
  1213. </xsl:call-template>
  1214. </xsl:for-each>
  1215. </xsl:if>
  1216. <xsl:value-of select="$result"/>
  1217. </xsl:template>
  1218. <xsl:template name="GetSingleTblPrCore">
  1219. <xsl:param name="type"/>
  1220. <xsl:for-each select="w:tblPr[1]">
  1221. <xsl:choose>
  1222. <xsl:when test="$type = $prrBdrPr_top">
  1223. <xsl:for-each select="w:tblBorders[1]/w:top[1]">
  1224. <xsl:call-template name="GetBorderPr"/>
  1225. </xsl:for-each>
  1226. </xsl:when>
  1227. <xsl:when test="$type = $prrBdrPr_left">
  1228. <xsl:for-each select="w:tblBorders[1]/w:left[1]">
  1229. <xsl:call-template name="GetBorderPr"/>
  1230. </xsl:for-each>
  1231. </xsl:when>
  1232. <xsl:when test="$type = $prrBdrPr_bottom">
  1233. <xsl:for-each select="w:tblBorders[1]/w:bottom[1]">
  1234. <xsl:call-template name="GetBorderPr"/>
  1235. </xsl:for-each>
  1236. </xsl:when>
  1237. <xsl:when test="$type = $prrBdrPr_right">
  1238. <xsl:for-each select="w:tblBorders[1]/w:right[1]">
  1239. <xsl:call-template name="GetBorderPr"/>
  1240. </xsl:for-each>
  1241. </xsl:when>
  1242. <xsl:when test="$type = $prrBdrPr_insideH">
  1243. <xsl:for-each select="w:tblBorders[1]/w:insideH[1]">
  1244. <xsl:call-template name="GetBorderPr"/>
  1245. </xsl:for-each>
  1246. </xsl:when>
  1247. <xsl:when test="$type = $prrBdrPr_insideV">
  1248. <xsl:for-each select="w:tblBorders[1]/w:insideV[1]">
  1249. <xsl:call-template name="GetBorderPr"/>
  1250. </xsl:for-each>
  1251. </xsl:when>
  1252. <xsl:when test="$type = $prrDefaultCellpadding">
  1253. <xsl:for-each select="w:tblCellMar[1]">
  1254. <xsl:call-template name="ApplyCellMar"/>
  1255. </xsl:for-each>
  1256. </xsl:when>
  1257. <xsl:when test="$type = $prrCellspacing">
  1258. <xsl:value-of select="w:tblCellSpacing[1]/@w:w"/>
  1259. </xsl:when>
  1260. <xsl:when test="$type = $prrTblInd">
  1261. <xsl:for-each select="w:tblInd[1]">
  1262. <xsl:call-template name="EvalTableWidth"/>
  1263. </xsl:for-each>
  1264. </xsl:when>
  1265. </xsl:choose>
  1266. </xsl:for-each>
  1267. </xsl:template>
  1268. <xsl:template name="WrapCnf">
  1269. <xsl:param name="sTblStyleName"/>
  1270. <xsl:param name="cnfCol"/>
  1271. <xsl:param name="cnfRow"/>
  1272. <xsl:param name="prsPAccum"/>
  1273. <xsl:param name="prsP"/>
  1274. <xsl:param name="prsR"/>
  1275. <xsl:choose>
  1276. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  1277. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfBand1Horz][1]"/>
  1278. <xsl:variable name="prsP.updated">
  1279. <xsl:call-template name="PrsUpdatePPr">
  1280. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1281. <xsl:with-param name="prsP" select="$prsP"/>
  1282. </xsl:call-template>
  1283. </xsl:variable>
  1284. <xsl:variable name="prsR.updated">
  1285. <xsl:call-template name="PrsUpdateRPr">
  1286. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1287. <xsl:with-param name="prsR" select="$prsR"/>
  1288. </xsl:call-template>
  1289. </xsl:variable>
  1290. <xsl:variable name="prsPAccum.updated">
  1291. <xsl:value-of select="$prsPAccum"/>
  1292. <xsl:for-each select="$p.cnfType">
  1293. <xsl:call-template name="ApplyPPr.many"/>
  1294. </xsl:for-each>
  1295. </xsl:variable>
  1296. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfBand1Horz)}">
  1297. <xsl:call-template name="WrapCnf.a">
  1298. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1299. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1300. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1301. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1302. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1303. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1304. </xsl:call-template>
  1305. </div>
  1306. </xsl:when>
  1307. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  1308. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfBand2Horz][1]"/>
  1309. <xsl:variable name="prsP.updated">
  1310. <xsl:call-template name="PrsUpdatePPr">
  1311. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1312. <xsl:with-param name="prsP" select="$prsP"/>
  1313. </xsl:call-template>
  1314. </xsl:variable>
  1315. <xsl:variable name="prsR.updated">
  1316. <xsl:call-template name="PrsUpdateRPr">
  1317. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1318. <xsl:with-param name="prsR" select="$prsR"/>
  1319. </xsl:call-template>
  1320. </xsl:variable>
  1321. <xsl:variable name="prsPAccum.updated">
  1322. <xsl:value-of select="$prsPAccum"/>
  1323. <xsl:for-each select="$p.cnfType">
  1324. <xsl:call-template name="ApplyPPr.many"/>
  1325. </xsl:for-each>
  1326. </xsl:variable>
  1327. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfBand2Horz)}">
  1328. <xsl:call-template name="WrapCnf.a">
  1329. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1330. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1331. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1332. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1333. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1334. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1335. </xsl:call-template>
  1336. </div>
  1337. </xsl:when>
  1338. <xsl:otherwise>
  1339. <xsl:call-template name="WrapCnf.a">
  1340. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1341. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1342. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1343. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  1344. <xsl:with-param name="prsP" select="$prsP"/>
  1345. <xsl:with-param name="prsR" select="$prsR"/>
  1346. </xsl:call-template>
  1347. </xsl:otherwise>
  1348. </xsl:choose>
  1349. </xsl:template>
  1350. <xsl:template name="WrapCnf.a">
  1351. <xsl:param name="sTblStyleName"/>
  1352. <xsl:param name="cnfCol"/>
  1353. <xsl:param name="cnfRow"/>
  1354. <xsl:param name="prsPAccum"/>
  1355. <xsl:param name="prsP"/>
  1356. <xsl:param name="prsR"/>
  1357. <xsl:choose>
  1358. <xsl:when test="substring($cnfCol,$icnfBand1Vert,1)=$on">
  1359. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfBand1Vert][1]"/>
  1360. <xsl:variable name="prsP.updated">
  1361. <xsl:call-template name="PrsUpdatePPr">
  1362. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1363. <xsl:with-param name="prsP" select="$prsP"/>
  1364. </xsl:call-template>
  1365. </xsl:variable>
  1366. <xsl:variable name="prsR.updated">
  1367. <xsl:call-template name="PrsUpdateRPr">
  1368. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1369. <xsl:with-param name="prsR" select="$prsR"/>
  1370. </xsl:call-template>
  1371. </xsl:variable>
  1372. <xsl:variable name="prsPAccum.updated">
  1373. <xsl:value-of select="$prsPAccum"/>
  1374. <xsl:for-each select="$p.cnfType">
  1375. <xsl:call-template name="ApplyPPr.many"/>
  1376. </xsl:for-each>
  1377. </xsl:variable>
  1378. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfBand1Vert)}">
  1379. <xsl:call-template name="WrapCnf.b">
  1380. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1381. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1382. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1383. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1384. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1385. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1386. </xsl:call-template>
  1387. </div>
  1388. </xsl:when>
  1389. <xsl:when test="substring($cnfCol,$icnfBand2Vert,1)=$on">
  1390. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfBand2Vert][1]"/>
  1391. <xsl:variable name="prsP.updated">
  1392. <xsl:call-template name="PrsUpdatePPr">
  1393. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1394. <xsl:with-param name="prsP" select="$prsP"/>
  1395. </xsl:call-template>
  1396. </xsl:variable>
  1397. <xsl:variable name="prsR.updated">
  1398. <xsl:call-template name="PrsUpdateRPr">
  1399. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1400. <xsl:with-param name="prsR" select="$prsR"/>
  1401. </xsl:call-template>
  1402. </xsl:variable>
  1403. <xsl:variable name="prsPAccum.updated">
  1404. <xsl:value-of select="$prsPAccum"/>
  1405. <xsl:for-each select="$p.cnfType">
  1406. <xsl:call-template name="ApplyPPr.many"/>
  1407. </xsl:for-each>
  1408. </xsl:variable>
  1409. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfBand2Vert)}">
  1410. <xsl:call-template name="WrapCnf.b">
  1411. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1412. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1413. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1414. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1415. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1416. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1417. </xsl:call-template>
  1418. </div>
  1419. </xsl:when>
  1420. <xsl:otherwise>
  1421. <xsl:call-template name="WrapCnf.b">
  1422. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1423. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1424. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1425. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  1426. <xsl:with-param name="prsP" select="$prsP"/>
  1427. <xsl:with-param name="prsR" select="$prsR"/>
  1428. </xsl:call-template>
  1429. </xsl:otherwise>
  1430. </xsl:choose>
  1431. </xsl:template>
  1432. <xsl:template name="WrapCnf.b">
  1433. <xsl:param name="sTblStyleName"/>
  1434. <xsl:param name="cnfCol"/>
  1435. <xsl:param name="cnfRow"/>
  1436. <xsl:param name="prsPAccum"/>
  1437. <xsl:param name="prsP"/>
  1438. <xsl:param name="prsR"/>
  1439. <xsl:choose>
  1440. <xsl:when test="substring($cnfCol,$icnfFirstCol,1)=$on">
  1441. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfFirstCol][1]"/>
  1442. <xsl:variable name="prsP.updated">
  1443. <xsl:call-template name="PrsUpdatePPr">
  1444. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1445. <xsl:with-param name="prsP" select="$prsP"/>
  1446. </xsl:call-template>
  1447. </xsl:variable>
  1448. <xsl:variable name="prsR.updated">
  1449. <xsl:call-template name="PrsUpdateRPr">
  1450. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1451. <xsl:with-param name="prsR" select="$prsR"/>
  1452. </xsl:call-template>
  1453. </xsl:variable>
  1454. <xsl:variable name="prsPAccum.updated">
  1455. <xsl:value-of select="$prsPAccum"/>
  1456. <xsl:for-each select="$p.cnfType">
  1457. <xsl:call-template name="ApplyPPr.many"/>
  1458. </xsl:for-each>
  1459. </xsl:variable>
  1460. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfFirstCol)}">
  1461. <xsl:call-template name="WrapCnf.c">
  1462. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1463. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1464. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1465. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1466. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1467. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1468. </xsl:call-template>
  1469. </div>
  1470. </xsl:when>
  1471. <xsl:when test="substring($cnfCol,$icnfLastCol,1)=$on">
  1472. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfLastCol][1]"/>
  1473. <xsl:variable name="prsP.updated">
  1474. <xsl:call-template name="PrsUpdatePPr">
  1475. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1476. <xsl:with-param name="prsP" select="$prsP"/>
  1477. </xsl:call-template>
  1478. </xsl:variable>
  1479. <xsl:variable name="prsR.updated">
  1480. <xsl:call-template name="PrsUpdateRPr">
  1481. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1482. <xsl:with-param name="prsR" select="$prsR"/>
  1483. </xsl:call-template>
  1484. </xsl:variable>
  1485. <xsl:variable name="prsPAccum.updated">
  1486. <xsl:value-of select="$prsPAccum"/>
  1487. <xsl:for-each select="$p.cnfType">
  1488. <xsl:call-template name="ApplyPPr.many"/>
  1489. </xsl:for-each>
  1490. </xsl:variable>
  1491. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfLastCol)}">
  1492. <xsl:call-template name="WrapCnf.c">
  1493. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1494. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1495. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1496. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1497. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1498. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1499. </xsl:call-template>
  1500. </div>
  1501. </xsl:when>
  1502. <xsl:otherwise>
  1503. <xsl:call-template name="WrapCnf.c">
  1504. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1505. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1506. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1507. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  1508. <xsl:with-param name="prsP" select="$prsP"/>
  1509. <xsl:with-param name="prsR" select="$prsR"/>
  1510. </xsl:call-template>
  1511. </xsl:otherwise>
  1512. </xsl:choose>
  1513. </xsl:template>
  1514. <xsl:template name="WrapCnf.c">
  1515. <xsl:param name="sTblStyleName"/>
  1516. <xsl:param name="cnfCol"/>
  1517. <xsl:param name="cnfRow"/>
  1518. <xsl:param name="prsPAccum"/>
  1519. <xsl:param name="prsP"/>
  1520. <xsl:param name="prsR"/>
  1521. <xsl:choose>
  1522. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  1523. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfFirstRow][1]"/>
  1524. <xsl:variable name="prsP.updated">
  1525. <xsl:call-template name="PrsUpdatePPr">
  1526. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1527. <xsl:with-param name="prsP" select="$prsP"/>
  1528. </xsl:call-template>
  1529. </xsl:variable>
  1530. <xsl:variable name="prsR.updated">
  1531. <xsl:call-template name="PrsUpdateRPr">
  1532. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1533. <xsl:with-param name="prsR" select="$prsR"/>
  1534. </xsl:call-template>
  1535. </xsl:variable>
  1536. <xsl:variable name="prsPAccum.updated">
  1537. <xsl:value-of select="$prsPAccum"/>
  1538. <xsl:for-each select="$p.cnfType">
  1539. <xsl:call-template name="ApplyPPr.many"/>
  1540. </xsl:for-each>
  1541. </xsl:variable>
  1542. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfFirstRow)}">
  1543. <xsl:call-template name="WrapCnf.d">
  1544. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1545. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1546. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1547. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1548. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1549. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1550. </xsl:call-template>
  1551. </div>
  1552. </xsl:when>
  1553. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  1554. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfLastRow][1]"/>
  1555. <xsl:variable name="prsP.updated">
  1556. <xsl:call-template name="PrsUpdatePPr">
  1557. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1558. <xsl:with-param name="prsP" select="$prsP"/>
  1559. </xsl:call-template>
  1560. </xsl:variable>
  1561. <xsl:variable name="prsR.updated">
  1562. <xsl:call-template name="PrsUpdateRPr">
  1563. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1564. <xsl:with-param name="prsR" select="$prsR"/>
  1565. </xsl:call-template>
  1566. </xsl:variable>
  1567. <xsl:variable name="prsPAccum.updated">
  1568. <xsl:value-of select="$prsPAccum"/>
  1569. <xsl:for-each select="$p.cnfType">
  1570. <xsl:call-template name="ApplyPPr.many"/>
  1571. </xsl:for-each>
  1572. </xsl:variable>
  1573. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfLastRow)}">
  1574. <xsl:call-template name="WrapCnf.d">
  1575. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1576. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1577. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1578. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1579. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1580. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1581. </xsl:call-template>
  1582. </div>
  1583. </xsl:when>
  1584. <xsl:otherwise>
  1585. <xsl:call-template name="WrapCnf.d">
  1586. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  1587. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  1588. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  1589. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  1590. <xsl:with-param name="prsP" select="$prsP"/>
  1591. <xsl:with-param name="prsR" select="$prsR"/>
  1592. </xsl:call-template>
  1593. </xsl:otherwise>
  1594. </xsl:choose>
  1595. </xsl:template>
  1596. <xsl:template name="WrapCnf.d">
  1597. <xsl:param name="sTblStyleName"/>
  1598. <xsl:param name="cnfCol"/>
  1599. <xsl:param name="cnfRow"/>
  1600. <xsl:param name="prsPAccum"/>
  1601. <xsl:param name="prsP"/>
  1602. <xsl:param name="prsR"/>
  1603. <xsl:choose>
  1604. <xsl:when test="substring($cnfCol,$icnfNECell,1)=$on">
  1605. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfNECell][1]"/>
  1606. <xsl:variable name="prsP.updated">
  1607. <xsl:call-template name="PrsUpdatePPr">
  1608. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1609. <xsl:with-param name="prsP" select="$prsP"/>
  1610. </xsl:call-template>
  1611. </xsl:variable>
  1612. <xsl:variable name="prsR.updated">
  1613. <xsl:call-template name="PrsUpdateRPr">
  1614. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1615. <xsl:with-param name="prsR" select="$prsR"/>
  1616. </xsl:call-template>
  1617. </xsl:variable>
  1618. <xsl:variable name="prsPAccum.updated">
  1619. <xsl:value-of select="$prsPAccum"/>
  1620. <xsl:for-each select="$p.cnfType">
  1621. <xsl:call-template name="ApplyPPr.many"/>
  1622. </xsl:for-each>
  1623. </xsl:variable>
  1624. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfNECell)}">
  1625. <xsl:call-template name="DisplayBodyContent">
  1626. <xsl:with-param name="ns.content" select="*"/>
  1627. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1628. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1629. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1630. </xsl:call-template>
  1631. </div>
  1632. </xsl:when>
  1633. <xsl:when test="substring($cnfCol,$icnfNWCell,1)=$on">
  1634. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfNWCell][1]"/>
  1635. <xsl:variable name="prsP.updated">
  1636. <xsl:call-template name="PrsUpdatePPr">
  1637. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1638. <xsl:with-param name="prsP" select="$prsP"/>
  1639. </xsl:call-template>
  1640. </xsl:variable>
  1641. <xsl:variable name="prsR.updated">
  1642. <xsl:call-template name="PrsUpdateRPr">
  1643. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1644. <xsl:with-param name="prsR" select="$prsR"/>
  1645. </xsl:call-template>
  1646. </xsl:variable>
  1647. <xsl:variable name="prsPAccum.updated">
  1648. <xsl:value-of select="$prsPAccum"/>
  1649. <xsl:for-each select="$p.cnfType">
  1650. <xsl:call-template name="ApplyPPr.many"/>
  1651. </xsl:for-each>
  1652. </xsl:variable>
  1653. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfNWCell)}">
  1654. <xsl:call-template name="DisplayBodyContent">
  1655. <xsl:with-param name="ns.content" select="*"/>
  1656. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1657. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1658. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1659. </xsl:call-template>
  1660. </div>
  1661. </xsl:when>
  1662. <xsl:when test="substring($cnfCol,$icnfSECell,1)=$on">
  1663. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfSECell][1]"/>
  1664. <xsl:variable name="prsP.updated">
  1665. <xsl:call-template name="PrsUpdatePPr">
  1666. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1667. <xsl:with-param name="prsP" select="$prsP"/>
  1668. </xsl:call-template>
  1669. </xsl:variable>
  1670. <xsl:variable name="prsR.updated">
  1671. <xsl:call-template name="PrsUpdateRPr">
  1672. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1673. <xsl:with-param name="prsR" select="$prsR"/>
  1674. </xsl:call-template>
  1675. </xsl:variable>
  1676. <xsl:variable name="prsPAccum.updated">
  1677. <xsl:value-of select="$prsPAccum"/>
  1678. <xsl:for-each select="$p.cnfType">
  1679. <xsl:call-template name="ApplyPPr.many"/>
  1680. </xsl:for-each>
  1681. </xsl:variable>
  1682. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfSECell)}">
  1683. <xsl:call-template name="DisplayBodyContent">
  1684. <xsl:with-param name="ns.content" select="*"/>
  1685. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1686. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1687. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1688. </xsl:call-template>
  1689. </div>
  1690. </xsl:when>
  1691. <xsl:when test="substring($cnfCol,$icnfSWCell,1)=$on">
  1692. <xsl:variable name="p.cnfType" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfSWCell][1]"/>
  1693. <xsl:variable name="prsP.updated">
  1694. <xsl:call-template name="PrsUpdatePPr">
  1695. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1696. <xsl:with-param name="prsP" select="$prsP"/>
  1697. </xsl:call-template>
  1698. </xsl:variable>
  1699. <xsl:variable name="prsR.updated">
  1700. <xsl:call-template name="PrsUpdateRPr">
  1701. <xsl:with-param name="ndPrContainer" select="$p.cnfType"/>
  1702. <xsl:with-param name="prsR" select="$prsR"/>
  1703. </xsl:call-template>
  1704. </xsl:variable>
  1705. <xsl:variable name="prsPAccum.updated">
  1706. <xsl:value-of select="$prsPAccum"/>
  1707. <xsl:for-each select="$p.cnfType">
  1708. <xsl:call-template name="ApplyPPr.many"/>
  1709. </xsl:for-each>
  1710. </xsl:variable>
  1711. <div class="{concat($sTblStyleName/@w:styleId,'-',$cnfSWCell)}">
  1712. <xsl:call-template name="DisplayBodyContent">
  1713. <xsl:with-param name="ns.content" select="*"/>
  1714. <xsl:with-param name="prsPAccum" select="$prsPAccum.updated"/>
  1715. <xsl:with-param name="prsP" select="$prsP.updated"/>
  1716. <xsl:with-param name="prsR" select="$prsR.updated"/>
  1717. </xsl:call-template>
  1718. </div>
  1719. </xsl:when>
  1720. <xsl:otherwise>
  1721. <xsl:call-template name="DisplayBodyContent">
  1722. <xsl:with-param name="ns.content" select="*"/>
  1723. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  1724. <xsl:with-param name="prsP" select="$prsP"/>
  1725. <xsl:with-param name="prsR" select="$prsR"/>
  1726. </xsl:call-template>
  1727. </xsl:otherwise>
  1728. </xsl:choose>
  1729. </xsl:template>
  1730. <xsl:template name="GetCnfPr.all">
  1731. <xsl:param name="type"/>
  1732. <xsl:param name="cnfCol"/>
  1733. <xsl:param name="cnfRow"/>
  1734. <xsl:choose>
  1735. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  1736. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand1Horz][1]">
  1737. <xsl:call-template name="GetCnfPr.a">
  1738. <xsl:with-param name="type" select="$type"/>
  1739. </xsl:call-template>
  1740. </xsl:for-each>
  1741. </xsl:when>
  1742. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  1743. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand2Horz][1]">
  1744. <xsl:call-template name="GetCnfPr.a">
  1745. <xsl:with-param name="type" select="$type"/>
  1746. </xsl:call-template>
  1747. </xsl:for-each>
  1748. </xsl:when>
  1749. </xsl:choose>
  1750. <xsl:choose>
  1751. <xsl:when test="substring($cnfCol,$icnfBand1Vert,1)=$on">
  1752. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand1Vert][1]">
  1753. <xsl:call-template name="GetCnfPr.a">
  1754. <xsl:with-param name="type" select="$type"/>
  1755. </xsl:call-template>
  1756. </xsl:for-each>
  1757. </xsl:when>
  1758. <xsl:when test="substring($cnfCol,$icnfBand2Vert,1)=$on">
  1759. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand2Vert][1]">
  1760. <xsl:call-template name="GetCnfPr.a">
  1761. <xsl:with-param name="type" select="$type"/>
  1762. </xsl:call-template>
  1763. </xsl:for-each>
  1764. </xsl:when>
  1765. </xsl:choose>
  1766. <xsl:choose>
  1767. <xsl:when test="substring($cnfCol,$icnfFirstCol,1)=$on">
  1768. <xsl:for-each select="w:tblStylePr[@w:type=$cnfFirstCol][1]">
  1769. <xsl:call-template name="GetCnfPr.a">
  1770. <xsl:with-param name="type" select="$type"/>
  1771. </xsl:call-template>
  1772. </xsl:for-each>
  1773. </xsl:when>
  1774. <xsl:when test="substring($cnfCol,$icnfLastCol,1)=$on">
  1775. <xsl:for-each select="w:tblStylePr[@w:type=$cnfLastCol][1]">
  1776. <xsl:call-template name="GetCnfPr.a">
  1777. <xsl:with-param name="type" select="$type"/>
  1778. </xsl:call-template>
  1779. </xsl:for-each>
  1780. </xsl:when>
  1781. </xsl:choose>
  1782. <xsl:choose>
  1783. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  1784. <xsl:for-each select="w:tblStylePr[@w:type=$cnfFirstRow][1]">
  1785. <xsl:call-template name="GetCnfPr.a">
  1786. <xsl:with-param name="type" select="$type"/>
  1787. </xsl:call-template>
  1788. </xsl:for-each>
  1789. </xsl:when>
  1790. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  1791. <xsl:for-each select="w:tblStylePr[@w:type=$cnfLastRow][1]">
  1792. <xsl:call-template name="GetCnfPr.a">
  1793. <xsl:with-param name="type" select="$type"/>
  1794. </xsl:call-template>
  1795. </xsl:for-each>
  1796. </xsl:when>
  1797. </xsl:choose>
  1798. <xsl:choose>
  1799. <xsl:when test="substring($cnfCol,$icnfNECell,1)=$on">
  1800. <xsl:for-each select="w:tblStylePr[@w:type=$cnfNECell][1]">
  1801. <xsl:call-template name="GetCnfPr.a">
  1802. <xsl:with-param name="type" select="$type"/>
  1803. </xsl:call-template>
  1804. </xsl:for-each>
  1805. </xsl:when>
  1806. <xsl:when test="substring($cnfCol,$icnfNWCell,1)=$on">
  1807. <xsl:for-each select="w:tblStylePr[@w:type=$cnfNWCell][1]">
  1808. <xsl:call-template name="GetCnfPr.a">
  1809. <xsl:with-param name="type" select="$type"/>
  1810. </xsl:call-template>
  1811. </xsl:for-each>
  1812. </xsl:when>
  1813. <xsl:when test="substring($cnfCol,$icnfSECell,1)=$on">
  1814. <xsl:for-each select="w:tblStylePr[@w:type=$cnfSECell][1]">
  1815. <xsl:call-template name="GetCnfPr.a">
  1816. <xsl:with-param name="type" select="$type"/>
  1817. </xsl:call-template>
  1818. </xsl:for-each>
  1819. </xsl:when>
  1820. <xsl:when test="substring($cnfCol,$icnfSWCell,1)=$on">
  1821. <xsl:for-each select="w:tblStylePr[@w:type=$cnfSWCell][1]">
  1822. <xsl:call-template name="GetCnfPr.a">
  1823. <xsl:with-param name="type" select="$type"/>
  1824. </xsl:call-template>
  1825. </xsl:for-each>
  1826. </xsl:when>
  1827. </xsl:choose>
  1828. </xsl:template>
  1829. <xsl:template name="GetCnfPr.cell">
  1830. <xsl:param name="type"/>
  1831. <xsl:param name="cnfCol"/>
  1832. <xsl:param name="cnfRow"/>
  1833. <xsl:variable name="result1">
  1834. <xsl:choose>
  1835. <xsl:when test="substring($cnfCol,$icnfNECell,1)=$on">
  1836. <xsl:for-each select="w:tblStylePr[@w:type=$cnfNECell][1]">
  1837. <xsl:call-template name="GetCnfPr.a">
  1838. <xsl:with-param name="type" select="$type"/>
  1839. </xsl:call-template>
  1840. </xsl:for-each>
  1841. </xsl:when>
  1842. <xsl:when test="substring($cnfCol,$icnfNWCell,1)=$on">
  1843. <xsl:for-each select="w:tblStylePr[@w:type=$cnfNWCell][1]">
  1844. <xsl:call-template name="GetCnfPr.a">
  1845. <xsl:with-param name="type" select="$type"/>
  1846. </xsl:call-template>
  1847. </xsl:for-each>
  1848. </xsl:when>
  1849. <xsl:when test="substring($cnfCol,$icnfSECell,1)=$on">
  1850. <xsl:for-each select="w:tblStylePr[@w:type=$cnfSECell][1]">
  1851. <xsl:call-template name="GetCnfPr.a">
  1852. <xsl:with-param name="type" select="$type"/>
  1853. </xsl:call-template>
  1854. </xsl:for-each>
  1855. </xsl:when>
  1856. <xsl:when test="substring($cnfCol,$icnfSWCell,1)=$on">
  1857. <xsl:for-each select="w:tblStylePr[@w:type=$cnfSWCell][1]">
  1858. <xsl:call-template name="GetCnfPr.a">
  1859. <xsl:with-param name="type" select="$type"/>
  1860. </xsl:call-template>
  1861. </xsl:for-each>
  1862. </xsl:when>
  1863. </xsl:choose>
  1864. </xsl:variable>
  1865. <xsl:value-of select="$result1"/>
  1866. <xsl:if test="$result1=''">
  1867. <xsl:variable name="result2">
  1868. <xsl:choose>
  1869. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  1870. <xsl:for-each select="w:tblStylePr[@w:type=$cnfFirstRow][1]">
  1871. <xsl:call-template name="GetCnfPr.a">
  1872. <xsl:with-param name="type" select="$type"/>
  1873. </xsl:call-template>
  1874. </xsl:for-each>
  1875. </xsl:when>
  1876. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  1877. <xsl:for-each select="w:tblStylePr[@w:type=$cnfLastRow][1]">
  1878. <xsl:call-template name="GetCnfPr.a">
  1879. <xsl:with-param name="type" select="$type"/>
  1880. </xsl:call-template>
  1881. </xsl:for-each>
  1882. </xsl:when>
  1883. </xsl:choose>
  1884. </xsl:variable>
  1885. <xsl:value-of select="$result2"/>
  1886. <xsl:if test="$result2=''">
  1887. <xsl:variable name="result3">
  1888. <xsl:choose>
  1889. <xsl:when test="substring($cnfCol,$icnfFirstCol,1)=$on">
  1890. <xsl:for-each select="w:tblStylePr[@w:type=$cnfFirstCol][1]">
  1891. <xsl:call-template name="GetCnfPr.a">
  1892. <xsl:with-param name="type" select="$type"/>
  1893. </xsl:call-template>
  1894. </xsl:for-each>
  1895. </xsl:when>
  1896. <xsl:when test="substring($cnfCol,$icnfLastCol,1)=$on">
  1897. <xsl:for-each select="w:tblStylePr[@w:type=$cnfLastCol][1]">
  1898. <xsl:call-template name="GetCnfPr.a">
  1899. <xsl:with-param name="type" select="$type"/>
  1900. </xsl:call-template>
  1901. </xsl:for-each>
  1902. </xsl:when>
  1903. </xsl:choose>
  1904. </xsl:variable>
  1905. <xsl:value-of select="$result3"/>
  1906. <xsl:if test="$result3=''">
  1907. <xsl:variable name="result4">
  1908. <xsl:choose>
  1909. <xsl:when test="substring($cnfCol,$icnfBand1Vert,1)=$on">
  1910. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand1Vert][1]">
  1911. <xsl:call-template name="GetCnfPr.a">
  1912. <xsl:with-param name="type" select="$type"/>
  1913. </xsl:call-template>
  1914. </xsl:for-each>
  1915. </xsl:when>
  1916. <xsl:when test="substring($cnfCol,$icnfBand2Vert,1)=$on">
  1917. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand2Vert][1]">
  1918. <xsl:call-template name="GetCnfPr.a">
  1919. <xsl:with-param name="type" select="$type"/>
  1920. </xsl:call-template>
  1921. </xsl:for-each>
  1922. </xsl:when>
  1923. </xsl:choose>
  1924. </xsl:variable>
  1925. <xsl:value-of select="$result4"/>
  1926. <xsl:if test="$result4=''">
  1927. <xsl:choose>
  1928. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  1929. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand1Horz][1]">
  1930. <xsl:call-template name="GetCnfPr.a">
  1931. <xsl:with-param name="type" select="$type"/>
  1932. </xsl:call-template>
  1933. </xsl:for-each>
  1934. </xsl:when>
  1935. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  1936. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand2Horz][1]">
  1937. <xsl:call-template name="GetCnfPr.a">
  1938. <xsl:with-param name="type" select="$type"/>
  1939. </xsl:call-template>
  1940. </xsl:for-each>
  1941. </xsl:when>
  1942. </xsl:choose>
  1943. </xsl:if>
  1944. </xsl:if>
  1945. </xsl:if>
  1946. </xsl:if>
  1947. </xsl:template>
  1948. <xsl:template name="GetCnfPr.row">
  1949. <xsl:param name="type"/>
  1950. <xsl:param name="cnfRow"/>
  1951. <xsl:variable name="result1">
  1952. <xsl:choose>
  1953. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  1954. <xsl:for-each select="w:tblStylePr[@w:type=$cnfFirstRow][1]">
  1955. <xsl:call-template name="GetCnfPr.a">
  1956. <xsl:with-param name="type" select="$type"/>
  1957. </xsl:call-template>
  1958. </xsl:for-each>
  1959. </xsl:when>
  1960. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  1961. <xsl:for-each select="w:tblStylePr[@w:type=$cnfLastRow][1]">
  1962. <xsl:call-template name="GetCnfPr.a">
  1963. <xsl:with-param name="type" select="$type"/>
  1964. </xsl:call-template>
  1965. </xsl:for-each>
  1966. </xsl:when>
  1967. </xsl:choose>
  1968. </xsl:variable>
  1969. <xsl:value-of select="$result1"/>
  1970. <xsl:if test="$result1=''">
  1971. <xsl:choose>
  1972. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  1973. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand1Horz][1]">
  1974. <xsl:call-template name="GetCnfPr.a">
  1975. <xsl:with-param name="type" select="$type"/>
  1976. </xsl:call-template>
  1977. </xsl:for-each>
  1978. </xsl:when>
  1979. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  1980. <xsl:for-each select="w:tblStylePr[@w:type=$cnfBand2Horz][1]">
  1981. <xsl:call-template name="GetCnfPr.a">
  1982. <xsl:with-param name="type" select="$type"/>
  1983. </xsl:call-template>
  1984. </xsl:for-each>
  1985. </xsl:when>
  1986. </xsl:choose>
  1987. </xsl:if>
  1988. </xsl:template>
  1989. <xsl:template name="GetCnfPr.a">
  1990. <xsl:param name="type"/>
  1991. <xsl:choose>
  1992. <xsl:when test="$type = $prrApplyTcPr">
  1993. <xsl:call-template name="ApplyTcPr.class"/>
  1994. </xsl:when>
  1995. <xsl:when test="$type = $prrCustomCellpadding">
  1996. <xsl:for-each select="w:tcPr[1]/w:tcMar[1]">
  1997. <xsl:call-template name="ApplyCellMar"/>
  1998. </xsl:for-each>
  1999. </xsl:when>
  2000. <xsl:when test="$type = $prrDefaultCellpadding">
  2001. <xsl:for-each select="w:tblPr[1]/w:tblCellMar[1]">
  2002. <xsl:call-template name="ApplyCellMar"/>
  2003. </xsl:for-each>
  2004. </xsl:when>
  2005. <xsl:when test="$type = $prrCantSplit">
  2006. <xsl:for-each select="w:trPr[1]/w:cantSplit[1]">
  2007. <xsl:choose>
  2008. <xsl:when test="@w:val = 'off'">page-break-inside:auto;</xsl:when>
  2009. <xsl:otherwise>page-break-inside:avoid;</xsl:otherwise>
  2010. </xsl:choose>
  2011. </xsl:for-each>
  2012. </xsl:when>
  2013. </xsl:choose>
  2014. </xsl:template>
  2015. <xsl:template name="GetCnfType">
  2016. <xsl:param name="cnfCol"/>
  2017. <xsl:param name="cnfRow"/>
  2018. <xsl:choose>
  2019. <xsl:when test="substring($cnfCol,$icnfNECell,1)=$on">
  2020. <xsl:value-of select="$cnfNECell"/>
  2021. </xsl:when>
  2022. <xsl:when test="substring($cnfCol,$icnfNWCell,1)=$on">
  2023. <xsl:value-of select="$cnfNWCell"/>
  2024. </xsl:when>
  2025. <xsl:when test="substring($cnfCol,$icnfSECell,1)=$on">
  2026. <xsl:value-of select="$cnfSECell"/>
  2027. </xsl:when>
  2028. <xsl:when test="substring($cnfCol,$icnfSWCell,1)=$on">
  2029. <xsl:value-of select="$cnfSWCell"/>
  2030. </xsl:when>
  2031. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  2032. <xsl:value-of select="$cnfFirstRow"/>
  2033. </xsl:when>
  2034. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  2035. <xsl:value-of select="$cnfLastRow"/>
  2036. </xsl:when>
  2037. <xsl:when test="substring($cnfCol,$icnfFirstCol,1)=$on">
  2038. <xsl:value-of select="$cnfFirstCol"/>
  2039. </xsl:when>
  2040. <xsl:when test="substring($cnfCol,$icnfLastCol,1)=$on">
  2041. <xsl:value-of select="$cnfLastCol"/>
  2042. </xsl:when>
  2043. <xsl:when test="substring($cnfCol,$icnfBand1Vert,1)=$on">
  2044. <xsl:value-of select="$cnfBand1Vert"/>
  2045. </xsl:when>
  2046. <xsl:when test="substring($cnfCol,$icnfBand2Vert,1)=$on">
  2047. <xsl:value-of select="$cnfBand2Vert"/>
  2048. </xsl:when>
  2049. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  2050. <xsl:value-of select="$cnfBand1Horz"/>
  2051. </xsl:when>
  2052. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  2053. <xsl:value-of select="$cnfBand2Horz"/>
  2054. </xsl:when>
  2055. </xsl:choose>
  2056. </xsl:template>
  2057. <xsl:template name="GetCnfTypeRow">
  2058. <xsl:param name="cnfRow"/>
  2059. <xsl:choose>
  2060. <xsl:when test="substring($cnfRow,$icnfFirstRow,1)=$on">
  2061. <xsl:value-of select="$cnfFirstRow"/>
  2062. </xsl:when>
  2063. <xsl:when test="substring($cnfRow,$icnfLastRow,1)=$on">
  2064. <xsl:value-of select="$cnfLastRow"/>
  2065. </xsl:when>
  2066. <xsl:when test="substring($cnfRow,$icnfBand1Horz,1)=$on">
  2067. <xsl:value-of select="$cnfBand1Horz"/>
  2068. </xsl:when>
  2069. <xsl:when test="substring($cnfRow,$icnfBand2Horz,1)=$on">
  2070. <xsl:value-of select="$cnfBand2Horz"/>
  2071. </xsl:when>
  2072. </xsl:choose>
  2073. </xsl:template>
  2074. <xsl:template name="GetCnfTypeCol">
  2075. <xsl:param name="cnfCol"/>
  2076. <xsl:choose>
  2077. <xsl:when test="substring($cnfCol,$icnfNECell,1)=$on">
  2078. <xsl:value-of select="$cnfNECell"/>
  2079. </xsl:when>
  2080. <xsl:when test="substring($cnfCol,$icnfNWCell,1)=$on">
  2081. <xsl:value-of select="$cnfNWCell"/>
  2082. </xsl:when>
  2083. <xsl:when test="substring($cnfCol,$icnfSECell,1)=$on">
  2084. <xsl:value-of select="$cnfSECell"/>
  2085. </xsl:when>
  2086. <xsl:when test="substring($cnfCol,$icnfSWCell,1)=$on">
  2087. <xsl:value-of select="$cnfSWCell"/>
  2088. </xsl:when>
  2089. <xsl:when test="substring($cnfCol,$icnfFirstCol,1)=$on">
  2090. <xsl:value-of select="$cnfFirstCol"/>
  2091. </xsl:when>
  2092. <xsl:when test="substring($cnfCol,$icnfLastCol,1)=$on">
  2093. <xsl:value-of select="$cnfLastCol"/>
  2094. </xsl:when>
  2095. <xsl:when test="substring($cnfCol,$icnfBand1Vert,1)=$on">
  2096. <xsl:value-of select="$cnfBand1Vert"/>
  2097. </xsl:when>
  2098. <xsl:when test="substring($cnfCol,$icnfBand2Vert,1)=$on">
  2099. <xsl:value-of select="$cnfBand2Vert"/>
  2100. </xsl:when>
  2101. </xsl:choose>
  2102. </xsl:template>
  2103. <xsl:template name="RecursiveRStyledGetBorderPr">
  2104. <xsl:param name="rStyleId"/>
  2105. <xsl:variable name="myStyle" select="($nsStyles[@w:styleId=$rStyleId])[1]" />
  2106. <xsl:if test="not($rStyleId='')">
  2107. <xsl:choose>
  2108. <xsl:when test="$myStyle/w:rPr[1]/w:bdr[1]">
  2109. <xsl:for-each select="$myStyle/w:rPr[1]/w:bdr[1]">
  2110. <xsl:call-template name="GetBorderPr"/>
  2111. </xsl:for-each>
  2112. </xsl:when>
  2113. <xsl:otherwise>
  2114. <xsl:if test="$myStyle/w:basedOn">
  2115. <xsl:call-template name="RecursiveRStyledGetBorderPr">
  2116. <xsl:with-param name="rStyleId" select="$myStyle/w:basedOn/@w:val" />
  2117. </xsl:call-template>
  2118. </xsl:if>
  2119. </xsl:otherwise>
  2120. </xsl:choose>
  2121. </xsl:if>
  2122. </xsl:template>
  2123. <xsl:template name="DisplayRBorder">
  2124. <xsl:param name="ns.content" select="*"/>
  2125. <xsl:param name="i.range.start" select="1"/>
  2126. <xsl:param name="i.this" select="number($i.range.start)"/>
  2127. <xsl:param name="pr.bdr.prev" select="''"/>
  2128. <xsl:param name="b.bidi"/>
  2129. <xsl:param name="prsR"/>
  2130. <xsl:param name="runStyleName"/>
  2131. <xsl:choose>
  2132. <xsl:when test="($ns.content)[$i.this]">
  2133. <xsl:for-each select="($ns.content)[$i.this]">
  2134. <xsl:choose>
  2135. <xsl:when test="name() = 'w:proofErr' or (name() = 'aml:annotation' and not(@w:type = 'Word.Insertion'))">
  2136. <xsl:call-template name="DisplayRBorder">
  2137. <xsl:with-param name="ns.content" select="$ns.content"/>
  2138. <xsl:with-param name="i.range.start" select="$i.range.start"/>
  2139. <xsl:with-param name="i.this" select="$i.this+1"/>
  2140. <xsl:with-param name="pr.bdr.prev" select="$pr.bdr.prev"/>
  2141. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2142. <xsl:with-param name="prsR" select="$prsR"/>
  2143. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2144. </xsl:call-template>
  2145. </xsl:when>
  2146. <xsl:otherwise>
  2147. <xsl:variable name="pr.bdr.this">
  2148. <xsl:choose>
  2149. <xsl:when test="name()='aml:annotation'"/>
  2150. <xsl:otherwise>
  2151. <xsl:for-each select="descendant-or-self::*[name()='w:pPr' or name()='w:r'][1]">
  2152. <xsl:choose>
  2153. <xsl:when test="w:rPr[1]/w:bdr[1]">
  2154. <xsl:for-each select="w:rPr[1]/w:bdr[1]">
  2155. <xsl:call-template name="GetBorderPr"/>
  2156. </xsl:for-each>
  2157. </xsl:when>
  2158. <xsl:otherwise>
  2159. <xsl:call-template name="RecursiveRStyledGetBorderPr">
  2160. <xsl:with-param name="rStyleId" select="w:rPr[1]/w:rStyle[1]/@w:val" />
  2161. </xsl:call-template>
  2162. </xsl:otherwise>
  2163. </xsl:choose>
  2164. </xsl:for-each>
  2165. </xsl:otherwise>
  2166. </xsl:choose>
  2167. </xsl:variable>
  2168. <xsl:choose>
  2169. <xsl:when test="$pr.bdr.prev = $pr.bdr.this">
  2170. <xsl:call-template name="DisplayRBorder">
  2171. <xsl:with-param name="ns.content" select="$ns.content"/>
  2172. <xsl:with-param name="i.range.start" select="$i.range.start"/>
  2173. <xsl:with-param name="i.this" select="$i.this+1"/>
  2174. <xsl:with-param name="pr.bdr.prev" select="$pr.bdr.prev"/>
  2175. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2176. <xsl:with-param name="prsR" select="$prsR"/>
  2177. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2178. </xsl:call-template>
  2179. </xsl:when>
  2180. <xsl:otherwise>
  2181. <xsl:call-template name="WrapRBorder">
  2182. <xsl:with-param name="ns.content" select="$ns.content"/>
  2183. <xsl:with-param name="i.bdrRange.start" select="$i.range.start"/>
  2184. <xsl:with-param name="i.bdrRange.end" select="$i.this"/>
  2185. <xsl:with-param name="pr.bdr" select="$pr.bdr.prev"/>
  2186. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2187. <xsl:with-param name="prsR" select="$prsR"/>
  2188. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2189. </xsl:call-template>
  2190. <xsl:call-template name="DisplayRBorder">
  2191. <xsl:with-param name="ns.content" select="$ns.content"/>
  2192. <xsl:with-param name="i.range.start" select="$i.this"/>
  2193. <xsl:with-param name="i.this" select="$i.this+1"/>
  2194. <xsl:with-param name="pr.bdr.prev" select="$pr.bdr.this"/>
  2195. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2196. <xsl:with-param name="prsR" select="$prsR"/>
  2197. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2198. </xsl:call-template>
  2199. </xsl:otherwise>
  2200. </xsl:choose>
  2201. </xsl:otherwise>
  2202. </xsl:choose>
  2203. </xsl:for-each>
  2204. </xsl:when>
  2205. <xsl:otherwise>
  2206. <xsl:call-template name="WrapRBorder">
  2207. <xsl:with-param name="ns.content" select="$ns.content"/>
  2208. <xsl:with-param name="i.bdrRange.start" select="$i.range.start"/>
  2209. <xsl:with-param name="i.bdrRange.end" select="$i.this"/>
  2210. <xsl:with-param name="pr.bdr" select="$pr.bdr.prev"/>
  2211. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2212. <xsl:with-param name="prsR" select="$prsR"/>
  2213. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2214. </xsl:call-template>
  2215. </xsl:otherwise>
  2216. </xsl:choose>
  2217. </xsl:template>
  2218. <xsl:template name="WrapRBorder">
  2219. <xsl:param name="ns.content"/>
  2220. <xsl:param name="i.bdrRange.start"/>
  2221. <xsl:param name="i.bdrRange.end"/>
  2222. <xsl:param name="pr.bdr"/>
  2223. <xsl:param name="b.bidi"/>
  2224. <xsl:param name="prsR"/>
  2225. <xsl:param name="runStyleName"/>
  2226. <xsl:choose>
  2227. <xsl:when test="$pr.bdr = ''">
  2228. <xsl:apply-templates select="($ns.content)[position() &gt;= $i.bdrRange.start and position() &lt; $i.bdrRange.end]">
  2229. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2230. <xsl:with-param name="prsR" select="$prsR"/>
  2231. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2232. </xsl:apply-templates>
  2233. </xsl:when>
  2234. <xsl:otherwise>
  2235. <span>
  2236. <xsl:attribute name="style">
  2237. <xsl:call-template name="ApplyBorderPr">
  2238. <xsl:with-param name="pr.bdr" select="$pr.bdr"/>
  2239. </xsl:call-template>
  2240. </xsl:attribute>
  2241. <xsl:apply-templates select="($ns.content)[position() &gt;= $i.bdrRange.start and position() &lt; $i.bdrRange.end]">
  2242. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  2243. <xsl:with-param name="prsR" select="$prsR"/>
  2244. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  2245. </xsl:apply-templates>
  2246. </span>
  2247. </xsl:otherwise>
  2248. </xsl:choose>
  2249. </xsl:template>
  2250. <xsl:template name="DisplayPBorderOld">
  2251. <xsl:param name="pr.frame.prev"/>
  2252. <xsl:param name="pr.bdrTop.prev"/>
  2253. <xsl:param name="pr.bdrLeft.prev"/>
  2254. <xsl:param name="pr.bdrBottom.prev"/>
  2255. <xsl:param name="pr.bdrRight.prev"/>
  2256. <xsl:param name="pr.bdrBetween.prev"/>
  2257. <xsl:param name="pr.bdrBar.prev"/>
  2258. <xsl:param name="ns.content"/>
  2259. <xsl:param name="i.range.start" select="1"/>
  2260. <xsl:param name="i.this" select="number($i.range.start)"/>
  2261. <xsl:param name="prsPAccum"/>
  2262. <xsl:param name="prsP"/>
  2263. <xsl:param name="prsR"/>
  2264. <xsl:choose>
  2265. <xsl:when test="($ns.content)[$i.this]">
  2266. <xsl:for-each select="($ns.content)[$i.this]">
  2267. <xsl:variable name="pstyle">
  2268. <xsl:call-template name="GetPStyleId"/>
  2269. </xsl:variable>
  2270. <xsl:variable name="sParaStyleName" select="($nsStyles[@w:styleId=$pstyle])[1]"/>
  2271. <xsl:variable name="pr.frame.this">
  2272. <xsl:call-template name="GetSinglePPr">
  2273. <xsl:with-param name="type" select="$prrFrame"/>
  2274. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2275. </xsl:call-template>
  2276. </xsl:variable>
  2277. <xsl:variable name="pr.bdrTop.this">
  2278. <xsl:call-template name="GetSinglePPr">
  2279. <xsl:with-param name="type" select="$prrBdrPr_top"/>
  2280. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2281. </xsl:call-template>
  2282. </xsl:variable>
  2283. <xsl:variable name="pr.bdrLeft.this">
  2284. <xsl:call-template name="GetSinglePPr">
  2285. <xsl:with-param name="type" select="$prrBdrPr_left"/>
  2286. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2287. </xsl:call-template>
  2288. </xsl:variable>
  2289. <xsl:variable name="pr.bdrBottom.this">
  2290. <xsl:call-template name="GetSinglePPr">
  2291. <xsl:with-param name="type" select="$prrBdrPr_bottom"/>
  2292. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2293. </xsl:call-template>
  2294. </xsl:variable>
  2295. <xsl:variable name="pr.bdrRight.this">
  2296. <xsl:call-template name="GetSinglePPr">
  2297. <xsl:with-param name="type" select="$prrBdrPr_right"/>
  2298. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2299. </xsl:call-template>
  2300. </xsl:variable>
  2301. <xsl:variable name="pr.bdrBetween.this">
  2302. <xsl:call-template name="GetSinglePPr">
  2303. <xsl:with-param name="type" select="$prrBdrPr_between"/>
  2304. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2305. </xsl:call-template>
  2306. </xsl:variable>
  2307. <xsl:variable name="pr.bdrBar.this">
  2308. <xsl:call-template name="GetSinglePPr">
  2309. <xsl:with-param name="type" select="$prrBdrPr_bar"/>
  2310. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2311. </xsl:call-template>
  2312. </xsl:variable>
  2313. <xsl:choose>
  2314. <xsl:when test="0 = 1 and $pr.frame.prev = $pr.frame.this and $pr.bdrTop.prev = $pr.bdrTop.this and $pr.bdrLeft.prev = $pr.bdrLeft.this and $pr.bdrBottom.prev = $pr.bdrBottom.this and $pr.bdrRight.prev = $pr.bdrRight.this and $pr.bdrBetween.prev = $pr.bdrBetween.this and $pr.bdrBar.prev = $pr.bdrBar.this">
  2315. <xsl:call-template name="DisplayPBorder">
  2316. <xsl:with-param name="ns.content" select="$ns.content"/>
  2317. <xsl:with-param name="i.range.start" select="$i.range.start"/>
  2318. <xsl:with-param name="i.this" select="$i.this+1"/>
  2319. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2320. <xsl:with-param name="prsP" select="$prsP"/>
  2321. <xsl:with-param name="prsR" select="$prsR"/>
  2322. <xsl:with-param name="pr.frame.prev" select="$pr.frame.prev"/>
  2323. <xsl:with-param name="pr.bdrTop.prev" select="$pr.bdrTop.prev"/>
  2324. <xsl:with-param name="pr.bdrLeft.prev" select="$pr.bdrLeft.prev"/>
  2325. <xsl:with-param name="pr.bdrBottom.prev" select="$pr.bdrBottom.prev"/>
  2326. <xsl:with-param name="pr.bdrRight.prev" select="$pr.bdrRight.prev"/>
  2327. <xsl:with-param name="pr.bdrBetween.prev" select="$pr.bdrBetween.prev"/>
  2328. <xsl:with-param name="pr.bdrBar.prev" select="$pr.bdrBar.prev"/>
  2329. </xsl:call-template>
  2330. </xsl:when>
  2331. <xsl:otherwise>
  2332. <xsl:call-template name="wrapFrame">
  2333. <xsl:with-param name="ns.content" select="$ns.content"/>
  2334. <xsl:with-param name="i.bdrRange.start" select="$i.range.start"/>
  2335. <xsl:with-param name="i.bdrRange.end" select="$i.this"/>
  2336. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2337. <xsl:with-param name="prsP" select="$prsP"/>
  2338. <xsl:with-param name="prsR" select="$prsR"/>
  2339. <xsl:with-param name="framePr" select="$pr.frame.prev"/>
  2340. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop.prev"/>
  2341. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft.prev"/>
  2342. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom.prev"/>
  2343. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight.prev"/>
  2344. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween.prev"/>
  2345. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar.prev"/>
  2346. </xsl:call-template>
  2347. <xsl:call-template name="DisplayPBorder">
  2348. <xsl:with-param name="ns.content" select="$ns.content"/>
  2349. <xsl:with-param name="i.range.start" select="$i.this"/>
  2350. <xsl:with-param name="i.this" select="$i.this+1"/>
  2351. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2352. <xsl:with-param name="prsP" select="$prsP"/>
  2353. <xsl:with-param name="prsR" select="$prsR"/>
  2354. <xsl:with-param name="pr.frame.prev" select="$pr.frame.this"/>
  2355. <xsl:with-param name="pr.bdrTop.prev" select="$pr.bdrTop.this"/>
  2356. <xsl:with-param name="pr.bdrLeft.prev" select="$pr.bdrLeft.this"/>
  2357. <xsl:with-param name="pr.bdrBottom.prev" select="$pr.bdrBottom.this"/>
  2358. <xsl:with-param name="pr.bdrRight.prev" select="$pr.bdrRight.this"/>
  2359. <xsl:with-param name="pr.bdrBetween.prev" select="$pr.bdrBetween.this"/>
  2360. <xsl:with-param name="pr.bdrBar.prev" select="$pr.bdrBar.this"/>
  2361. </xsl:call-template>
  2362. </xsl:otherwise>
  2363. </xsl:choose>
  2364. </xsl:for-each>
  2365. </xsl:when>
  2366. <xsl:otherwise>
  2367. <xsl:call-template name="wrapFrame">
  2368. <xsl:with-param name="ns.content" select="$ns.content"/>
  2369. <xsl:with-param name="i.bdrRange.start" select="$i.range.start"/>
  2370. <xsl:with-param name="i.bdrRange.end" select="$i.this"/>
  2371. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2372. <xsl:with-param name="prsP" select="$prsP"/>
  2373. <xsl:with-param name="prsR" select="$prsR"/>
  2374. <xsl:with-param name="framePr" select="$pr.frame.prev"/>
  2375. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop.prev"/>
  2376. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft.prev"/>
  2377. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom.prev"/>
  2378. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight.prev"/>
  2379. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween.prev"/>
  2380. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar.prev"/>
  2381. </xsl:call-template>
  2382. </xsl:otherwise>
  2383. </xsl:choose>
  2384. </xsl:template>
  2385. <xsl:template name="DisplayPBorder">
  2386. <xsl:param name="pr.frame.prev"/>
  2387. <xsl:param name="pr.bdrTop.prev"/>
  2388. <xsl:param name="pr.bdrLeft.prev"/>
  2389. <xsl:param name="pr.bdrBottom.prev"/>
  2390. <xsl:param name="pr.bdrRight.prev"/>
  2391. <xsl:param name="pr.bdrBetween.prev"/>
  2392. <xsl:param name="pr.bdrBar.prev"/>
  2393. <xsl:param name="ns.content"/>
  2394. <xsl:param name="i.range.start" select="1"/>
  2395. <xsl:param name="i.this" select="number($i.range.start)"/>
  2396. <xsl:param name="prsPAccum"/>
  2397. <xsl:param name="prsP"/>
  2398. <xsl:param name="prsR"/>
  2399. <xsl:choose>
  2400. <xsl:when test="($ns.content)[$i.this]">
  2401. <xsl:for-each select="($ns.content)">
  2402. <xsl:variable name="pstyle">
  2403. <xsl:call-template name="GetPStyleId"/>
  2404. </xsl:variable>
  2405. <xsl:variable name="sParaStyleName" select="($nsStyles[@w:styleId=$pstyle])[1]"/>
  2406. <xsl:variable name="pr.frame.this">
  2407. <xsl:call-template name="GetSinglePPr">
  2408. <xsl:with-param name="type" select="$prrFrame"/>
  2409. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2410. </xsl:call-template>
  2411. </xsl:variable>
  2412. <xsl:variable name="pr.bdrTop.this">
  2413. <xsl:call-template name="GetSinglePPr">
  2414. <xsl:with-param name="type" select="$prrBdrPr_top"/>
  2415. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2416. </xsl:call-template>
  2417. </xsl:variable>
  2418. <xsl:variable name="pr.bdrLeft.this">
  2419. <xsl:call-template name="GetSinglePPr">
  2420. <xsl:with-param name="type" select="$prrBdrPr_left"/>
  2421. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2422. </xsl:call-template>
  2423. </xsl:variable>
  2424. <xsl:variable name="pr.bdrBottom.this">
  2425. <xsl:call-template name="GetSinglePPr">
  2426. <xsl:with-param name="type" select="$prrBdrPr_bottom"/>
  2427. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2428. </xsl:call-template>
  2429. </xsl:variable>
  2430. <xsl:variable name="pr.bdrRight.this">
  2431. <xsl:call-template name="GetSinglePPr">
  2432. <xsl:with-param name="type" select="$prrBdrPr_right"/>
  2433. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2434. </xsl:call-template>
  2435. </xsl:variable>
  2436. <xsl:variable name="pr.bdrBetween.this">
  2437. <xsl:call-template name="GetSinglePPr">
  2438. <xsl:with-param name="type" select="$prrBdrPr_between"/>
  2439. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2440. </xsl:call-template>
  2441. </xsl:variable>
  2442. <xsl:variable name="pr.bdrBar.this">
  2443. <xsl:call-template name="GetSinglePPr">
  2444. <xsl:with-param name="type" select="$prrBdrPr_bar"/>
  2445. <xsl:with-param name="sParaStyleName" select="$sParaStyleName"/>
  2446. </xsl:call-template>
  2447. </xsl:variable>
  2448. <xsl:call-template name="wrapFrame">
  2449. <xsl:with-param name="ns.content" select="."/>
  2450. <xsl:with-param name="i.bdrRange.start" select="1"/>
  2451. <xsl:with-param name="i.bdrRange.end" select="2"/>
  2452. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2453. <xsl:with-param name="prsP" select="$prsP"/>
  2454. <xsl:with-param name="prsR" select="$prsR"/>
  2455. <xsl:with-param name="framePr" select="$pr.frame.prev"/>
  2456. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop.prev"/>
  2457. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft.prev"/>
  2458. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom.prev"/>
  2459. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight.prev"/>
  2460. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween.prev"/>
  2461. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar.prev"/>
  2462. </xsl:call-template>
  2463. </xsl:for-each>
  2464. </xsl:when>
  2465. <xsl:otherwise>
  2466. <xsl:call-template name="wrapFrame">
  2467. <xsl:with-param name="ns.content" select="$ns.content"/>
  2468. <xsl:with-param name="i.bdrRange.start" select="$i.range.start"/>
  2469. <xsl:with-param name="i.bdrRange.end" select="$i.this"/>
  2470. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2471. <xsl:with-param name="prsP" select="$prsP"/>
  2472. <xsl:with-param name="prsR" select="$prsR"/>
  2473. <xsl:with-param name="framePr" select="$pr.frame.prev"/>
  2474. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop.prev"/>
  2475. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft.prev"/>
  2476. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom.prev"/>
  2477. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight.prev"/>
  2478. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween.prev"/>
  2479. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar.prev"/>
  2480. </xsl:call-template>
  2481. </xsl:otherwise>
  2482. </xsl:choose>
  2483. </xsl:template>
  2484. <xsl:template name="wrapFrame">
  2485. <xsl:param name="framePr"/>
  2486. <xsl:param name="pr.bdrTop"/>
  2487. <xsl:param name="pr.bdrLeft"/>
  2488. <xsl:param name="pr.bdrBottom"/>
  2489. <xsl:param name="pr.bdrRight"/>
  2490. <xsl:param name="pr.bdrBetween"/>
  2491. <xsl:param name="pr.bdrBar"/>
  2492. <xsl:param name="ns.content"/>
  2493. <xsl:param name="i.bdrRange.start"/>
  2494. <xsl:param name="i.bdrRange.end"/>
  2495. <xsl:param name="prsPAccum"/>
  2496. <xsl:param name="prsP"/>
  2497. <xsl:param name="prsR"/>
  2498. <xsl:choose>
  2499. <xsl:when test="$framePr = ''">
  2500. <xsl:call-template name="wrapPBdr">
  2501. <xsl:with-param name="ns.content" select="$ns.content"/>
  2502. <xsl:with-param name="i.bdrRange.start" select="$i.bdrRange.start"/>
  2503. <xsl:with-param name="i.bdrRange.end" select="$i.bdrRange.end"/>
  2504. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop"/>
  2505. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft"/>
  2506. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom"/>
  2507. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight"/>
  2508. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween"/>
  2509. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar"/>
  2510. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2511. <xsl:with-param name="prsP" select="$prsP"/>
  2512. <xsl:with-param name="prsR" select="$prsR"/>
  2513. </xsl:call-template>
  2514. </xsl:when>
  2515. <xsl:otherwise>
  2516. <xsl:variable name="width" select="substring-before($framePr,$sep2)"/>
  2517. <xsl:variable name="framePr1" select="substring-after($framePr,$sep2)"/>
  2518. <xsl:variable name="height" select="substring-before($framePr1,$sep2)"/>
  2519. <xsl:variable name="framePr2" select="substring-after($framePr1,$sep2)"/>
  2520. <xsl:variable name="hrule" select="substring-before($framePr2,$sep2)"/>
  2521. <xsl:variable name="framePr3" select="substring-after($framePr2,$sep2)"/>
  2522. <xsl:variable name="xalign" select="substring-before($framePr3,$sep2)"/>
  2523. <xsl:variable name="framePr4" select="substring-after($framePr3,$sep2)"/>
  2524. <xsl:variable name="vspace" select="substring-before($framePr4,$sep2)"/>
  2525. <xsl:variable name="framePr5" select="substring-after($framePr4,$sep2)"/>
  2526. <xsl:variable name="hspace" select="substring-before($framePr5,$sep2)"/>
  2527. <xsl:variable name="framePr6" select="substring-after($framePr5,$sep2)"/>
  2528. <xsl:variable name="wrap" select="substring-before($framePr6,$sep2)"/>
  2529. <table cellspacing="0" cellpadding="0" hspace="0" vspace="0">
  2530. <xsl:if test="not($width = '' and $height='')">
  2531. <xsl:attribute name="style">
  2532. <xsl:if test="not($width = '')">
  2533. width:<xsl:value-of select="$width div 20"/>pt;
  2534. </xsl:if>
  2535. <xsl:if test="not($height = '')">
  2536. height:<xsl:value-of select="$height div 20"/>pt;
  2537. </xsl:if>
  2538. </xsl:attribute>
  2539. </xsl:if>
  2540. <xsl:attribute name="align">
  2541. <xsl:choose>
  2542. <xsl:when test="$xalign = 'right' or $xalign = 'outside'">right</xsl:when>
  2543. <xsl:otherwise>left</xsl:otherwise>
  2544. </xsl:choose>
  2545. </xsl:attribute>
  2546. <tr>
  2547. <td valign="top" align="left">
  2548. <xsl:attribute name="style">
  2549. <xsl:text>padding:</xsl:text>
  2550. <xsl:choose>
  2551. <xsl:when test="$vspace = ''">0</xsl:when>
  2552. <xsl:otherwise>
  2553. <xsl:value-of select="$vspace div 20"/>pt
  2554. </xsl:otherwise>
  2555. </xsl:choose>
  2556. <xsl:text> </xsl:text>
  2557. <xsl:choose>
  2558. <xsl:when test="$hspace = ''">0</xsl:when>
  2559. <xsl:otherwise>
  2560. <xsl:value-of select="$hspace div 20"/>pt
  2561. </xsl:otherwise>
  2562. </xsl:choose>
  2563. <xsl:text>;</xsl:text>
  2564. </xsl:attribute>
  2565. <xsl:call-template name="wrapPBdr">
  2566. <xsl:with-param name="ns.content" select="$ns.content"/>
  2567. <xsl:with-param name="i.bdrRange.start" select="$i.bdrRange.start"/>
  2568. <xsl:with-param name="i.bdrRange.end" select="$i.bdrRange.end"/>
  2569. <xsl:with-param name="pr.bdrTop" select="$pr.bdrTop"/>
  2570. <xsl:with-param name="pr.bdrLeft" select="$pr.bdrLeft"/>
  2571. <xsl:with-param name="pr.bdrBottom" select="$pr.bdrBottom"/>
  2572. <xsl:with-param name="pr.bdrRight" select="$pr.bdrRight"/>
  2573. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween"/>
  2574. <xsl:with-param name="pr.bdrBar" select="$pr.bdrBar"/>
  2575. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2576. <xsl:with-param name="prsP" select="$prsP"/>
  2577. <xsl:with-param name="prsR" select="$prsR"/>
  2578. </xsl:call-template>
  2579. </td>
  2580. </tr>
  2581. </table>
  2582. <xsl:if test="$wrap = '' or $wrap = 'none' or $wrap = 'not-beside'">
  2583. <br clear="all"/>
  2584. </xsl:if>
  2585. </xsl:otherwise>
  2586. </xsl:choose>
  2587. </xsl:template>
  2588. <xsl:template name="wrapPBdr">
  2589. <xsl:param name="pr.bdrTop"/>
  2590. <xsl:param name="pr.bdrLeft"/>
  2591. <xsl:param name="pr.bdrBottom"/>
  2592. <xsl:param name="pr.bdrRight"/>
  2593. <xsl:param name="pr.bdrBetween"/>
  2594. <xsl:param name="pr.bdrBar"/>
  2595. <xsl:param name="ns.content"/>
  2596. <xsl:param name="i.bdrRange.start"/>
  2597. <xsl:param name="i.bdrRange.end"/>
  2598. <xsl:param name="prsPAccum"/>
  2599. <xsl:param name="prsP"/>
  2600. <xsl:param name="prsR"/>
  2601. <xsl:choose>
  2602. <xsl:when test="$pr.bdrTop = '' and $pr.bdrLeft = '' and $pr.bdrBottom = '' and $pr.bdrRight = '' and $pr.bdrBar = ''">
  2603. <xsl:apply-templates select="($ns.content)[position() &gt;= $i.bdrRange.start and position() &lt; $i.bdrRange.end]">
  2604. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2605. <xsl:with-param name="prsP" select="$prsP"/>
  2606. <xsl:with-param name="prsR" select="$prsR"/>
  2607. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween"/>
  2608. </xsl:apply-templates>
  2609. </xsl:when>
  2610. <xsl:otherwise>
  2611. <div>
  2612. <xsl:attribute name="style">
  2613. <xsl:call-template name="ApplyBorderPr">
  2614. <xsl:with-param name="pr.bdr" select="$pr.bdrBar"/>
  2615. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  2616. </xsl:call-template>
  2617. <xsl:call-template name="ApplyBorderPr">
  2618. <xsl:with-param name="pr.bdr" select="$pr.bdrTop"/>
  2619. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  2620. </xsl:call-template>
  2621. <xsl:call-template name="ApplyBorderPr">
  2622. <xsl:with-param name="pr.bdr" select="$pr.bdrLeft"/>
  2623. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  2624. </xsl:call-template>
  2625. <xsl:call-template name="ApplyBorderPr">
  2626. <xsl:with-param name="pr.bdr" select="$pr.bdrBottom"/>
  2627. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  2628. </xsl:call-template>
  2629. <xsl:call-template name="ApplyBorderPr">
  2630. <xsl:with-param name="pr.bdr" select="$pr.bdrRight"/>
  2631. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  2632. </xsl:call-template>
  2633. <xsl:text>padding:</xsl:text>
  2634. <xsl:variable name="topPad" select="substring-before(substring-after(substring-after(substring-after($pr.bdrTop,$sep2),$sep2),$sep2),$sep2)"/>
  2635. <xsl:variable name="rightPad" select="substring-before(substring-after(substring-after(substring-after($pr.bdrRight,$sep2),$sep2),$sep2),$sep2)"/>
  2636. <xsl:variable name="bottomPad" select="substring-before(substring-after(substring-after(substring-after($pr.bdrBottom,$sep2),$sep2),$sep2),$sep2)"/>
  2637. <xsl:variable name="leftPad" select="substring-before(substring-after(substring-after(substring-after($pr.bdrLeft,$sep2),$sep2),$sep2),$sep2)"/>
  2638. <xsl:choose>
  2639. <xsl:when test="$topPad = ''">0</xsl:when>
  2640. <xsl:otherwise>
  2641. <xsl:value-of select="$topPad"/>pt
  2642. </xsl:otherwise>
  2643. </xsl:choose>
  2644. <xsl:text> </xsl:text>
  2645. <xsl:choose>
  2646. <xsl:when test="$rightPad = ''">0</xsl:when>
  2647. <xsl:otherwise>
  2648. <xsl:value-of select="$rightPad"/>pt
  2649. </xsl:otherwise>
  2650. </xsl:choose>
  2651. <xsl:text> </xsl:text>
  2652. <xsl:choose>
  2653. <xsl:when test="$bottomPad = ''">0</xsl:when>
  2654. <xsl:otherwise>
  2655. <xsl:value-of select="$bottomPad"/>pt
  2656. </xsl:otherwise>
  2657. </xsl:choose>
  2658. <xsl:text> </xsl:text>
  2659. <xsl:choose>
  2660. <xsl:when test="$leftPad = ''">0</xsl:when>
  2661. <xsl:otherwise>
  2662. <xsl:value-of select="$leftPad"/>pt
  2663. </xsl:otherwise>
  2664. </xsl:choose>
  2665. <xsl:text>;</xsl:text>
  2666. </xsl:attribute>
  2667. <xsl:apply-templates select="($ns.content)[position() &gt;= $i.bdrRange.start and position() &lt; $i.bdrRange.end]">
  2668. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  2669. <xsl:with-param name="prsP" select="$prsP"/>
  2670. <xsl:with-param name="prsR" select="$prsR"/>
  2671. <xsl:with-param name="pr.bdrBetween" select="$pr.bdrBetween"/>
  2672. </xsl:apply-templates>
  2673. </div>
  2674. </xsl:otherwise>
  2675. </xsl:choose>
  2676. </xsl:template>
  2677. <xsl:template name="ApplyArgs">
  2678. <xsl:param name="value"/>
  2679. <xsl:variable name="attributeName" select="normalize-space(substring-before($value,'='))"/>
  2680. <xsl:variable name="afterName" select="concat(substring-after($value,'='),' ')"/>
  2681. <xsl:if test="not($attributeName = '')">
  2682. <xsl:attribute name="{$attributeName}">
  2683. <xsl:value-of select="normalize-space(translate(substring-before($afterName,' '),'&quot;',' '))"/>
  2684. </xsl:attribute>
  2685. <xsl:call-template name="ApplyArgs">
  2686. <xsl:with-param name="value" select="normalize-space(substring-after($afterName,' '))"/>
  2687. </xsl:call-template>
  2688. </xsl:if>
  2689. </xsl:template>
  2690. <xsl:template match="w:scriptAnchor">
  2691. <script>
  2692. <xsl:apply-templates select="*" mode="scriptAnchor"/>
  2693. </script>
  2694. </xsl:template>
  2695. <xsl:template match="w:args" mode="scriptAnchor">
  2696. <xsl:call-template name="ApplyArgs">
  2697. <xsl:with-param name="value" select="."/>
  2698. </xsl:call-template>
  2699. </xsl:template>
  2700. <xsl:template match="w:language" mode="scriptAnchor">
  2701. <xsl:attribute name="language">
  2702. <xsl:value-of select="."/>
  2703. </xsl:attribute>
  2704. </xsl:template>
  2705. <xsl:template match="w:scriptId" mode="scriptAnchor">
  2706. <xsl:attribute name="id">
  2707. <xsl:value-of select="."/>
  2708. </xsl:attribute>
  2709. </xsl:template>
  2710. <xsl:template match="w:scriptText" mode="scriptAnchor">
  2711. <xsl:value-of disable-output-escaping="yes" select="."/>
  2712. </xsl:template>
  2713. <xsl:template match="*" mode="scriptAnchor"/>
  2714. <xsl:template match="w:applet">
  2715. <applet>
  2716. <xsl:apply-templates select="*" mode="applet"/>
  2717. </applet>
  2718. </xsl:template>
  2719. <xsl:template match="w:appletText" mode="applet">
  2720. <xsl:value-of disable-output-escaping="yes" select="."/>
  2721. </xsl:template>
  2722. <xsl:template match="w:args" mode="applet">
  2723. <xsl:call-template name="ApplyArgs">
  2724. <xsl:with-param name="value" select="."/>
  2725. </xsl:call-template>
  2726. </xsl:template>
  2727. <xsl:template match="*" mode="applet"/>
  2728. <xsl:template match="w:txbxContent">
  2729. <xsl:call-template name="DisplayBodyContent">
  2730. <xsl:with-param name="ns.content" select="*"/>
  2731. </xsl:call-template>
  2732. </xsl:template>
  2733. <xsl:template match="WX:pBdrGroup">
  2734. <xsl:variable name="dxaLeft" select="WX:margin-left/@WX:val"/>
  2735. <xsl:variable name="dxaRight" select="WX:margin-right/@WX:val"/>
  2736. <xsl:variable name="ns.borders" select="WX:borders"/>
  2737. <xsl:variable name="bdrStyles">
  2738. <xsl:if test="$ns.borders/WX:top">
  2739. <xsl:text>border-top:</xsl:text>
  2740. <xsl:value-of select="$ns.borders/WX:top/@WX:val"/>
  2741. <xsl:text> </xsl:text>
  2742. <xsl:value-of select="$ns.borders/WX:top/@WX:bdrwidth div 20"/>
  2743. <xsl:text>pt </xsl:text>
  2744. <xsl:call-template name="ConvHexColor">
  2745. <xsl:with-param name="value" select="$ns.borders/WX:top/@WX:color"/>
  2746. </xsl:call-template>
  2747. <xsl:text>;padding-top:</xsl:text>
  2748. <xsl:value-of select="$ns.borders/WX:top/@WX:space"/>
  2749. <xsl:text>pt</xsl:text>
  2750. </xsl:if>
  2751. <xsl:if test="$ns.borders/WX:bottom">
  2752. <xsl:text>;border-bottom:</xsl:text>
  2753. <xsl:value-of select="$ns.borders/WX:bottom/@WX:val"/>
  2754. <xsl:text> </xsl:text>
  2755. <xsl:value-of select="$ns.borders/WX:bottom/@WX:bdrwidth div 20"/>
  2756. <xsl:text>pt </xsl:text>
  2757. <xsl:call-template name="ConvHexColor">
  2758. <xsl:with-param name="value" select="$ns.borders/WX:bottom/@WX:color"/>
  2759. </xsl:call-template>
  2760. <xsl:text>;padding-bottom:</xsl:text>
  2761. <xsl:value-of select="$ns.borders/WX:bottom/@WX:space"/>
  2762. <xsl:text>pt</xsl:text>
  2763. </xsl:if>
  2764. <xsl:if test="$ns.borders/WX:right">
  2765. <xsl:text>;border-right:</xsl:text>
  2766. <xsl:value-of select="$ns.borders/WX:right/@WX:val"/>
  2767. <xsl:text> </xsl:text>
  2768. <xsl:value-of select="$ns.borders/WX:right/@WX:bdrwidth div 20"/>
  2769. <xsl:text>pt </xsl:text>
  2770. <xsl:call-template name="ConvHexColor">
  2771. <xsl:with-param name="value" select="$ns.borders/WX:right/@WX:color"/>
  2772. </xsl:call-template>
  2773. <xsl:text>;padding-right:</xsl:text>
  2774. <xsl:value-of select="$ns.borders/WX:right/@WX:space"/>
  2775. <xsl:text>pt</xsl:text>
  2776. </xsl:if>
  2777. <xsl:if test="$ns.borders/WX:left">
  2778. <xsl:text>;border-left:</xsl:text>
  2779. <xsl:value-of select="$ns.borders/WX:left/@WX:val"/>
  2780. <xsl:text> </xsl:text>
  2781. <xsl:value-of select="$ns.borders/WX:left/@WX:bdrwidth div 20"/>
  2782. <xsl:text>pt </xsl:text>
  2783. <xsl:call-template name="ConvHexColor">
  2784. <xsl:with-param name="value" select="$ns.borders/WX:left/@WX:color"/>
  2785. </xsl:call-template>
  2786. <xsl:text>;padding-left:</xsl:text>
  2787. <xsl:value-of select="$ns.borders/WX:left/@WX:space"/>
  2788. <xsl:text>pt</xsl:text>
  2789. </xsl:if>
  2790. <xsl:if test="$dxaLeft">
  2791. <xsl:text>;margin-left:</xsl:text>
  2792. <xsl:value-of select="$dxaLeft div 20"/>
  2793. <xsl:text>pt</xsl:text>
  2794. </xsl:if>
  2795. <xsl:if test="$dxaRight">
  2796. <xsl:text>;margin-right:</xsl:text>
  2797. <xsl:value-of select="$dxaRight div 20"/>
  2798. <xsl:text>pt</xsl:text>
  2799. </xsl:if>
  2800. <xsl:if test="WX:shd">
  2801. <xsl:text>;background-color:</xsl:text>
  2802. <xsl:call-template name="ConvHexColor">
  2803. <xsl:with-param name="value" select="WX:shd/@WX:bgcolor"/>
  2804. <xsl:with-param name="autoColor" select="$autoColor_bg"/>
  2805. <xsl:with-param name="transparentColor">transparent</xsl:with-param>
  2806. </xsl:call-template>
  2807. </xsl:if>
  2808. </xsl:variable>
  2809. <xsl:choose>
  2810. <xsl:when test="WX:apo">
  2811. <table cellspacing="0" cellpadding="0" hspace="0" vspace="0">
  2812. <xsl:choose>
  2813. <xsl:when test="WX:apo/WX:jc/@WX:val">
  2814. <xsl:attribute name="align">
  2815. <xsl:value-of select="WX:apo/WX:jc/@WX:val"/>
  2816. </xsl:attribute>
  2817. </xsl:when>
  2818. <xsl:otherwise>
  2819. <xsl:attribute name="align">
  2820. <xsl:text>left</xsl:text>
  2821. </xsl:attribute>
  2822. </xsl:otherwise>
  2823. </xsl:choose>
  2824. <xsl:attribute name="style">
  2825. <xsl:if test="WX:apo/WX:width/@WX:val">
  2826. <xsl:text>;width:</xsl:text>
  2827. <xsl:value-of select="WX:apo/WX:width/@WX:val div 20"/>
  2828. <xsl:text>pt</xsl:text>
  2829. </xsl:if>
  2830. <xsl:if test="WX:apo/WX:height/@WX:val">
  2831. <xsl:text>;height:</xsl:text>
  2832. <xsl:value-of select="WX:apo/WX:height/@WX:val div 20"/>
  2833. <xsl:text>pt</xsl:text>
  2834. </xsl:if>
  2835. </xsl:attribute>
  2836. <tr>
  2837. <td valign="top" align="left">
  2838. <xsl:attribute name="style">
  2839. <xsl:if test="WX:apo/WX:vertFromText/@WX:val">
  2840. <xsl:text>;padding-top:</xsl:text>
  2841. <xsl:value-of select="WX:apo/WX:vertFromText/@WX:val div 20"/>
  2842. <xsl:text>pt</xsl:text>
  2843. <xsl:text>;padding-bottom:</xsl:text>
  2844. <xsl:value-of select="WX:apo/WX:vertFromText/@WX:val div 20"/>
  2845. <xsl:text>pt</xsl:text>
  2846. </xsl:if>
  2847. <xsl:if test="WX:apo/WX:horizFromText/@WX:val">
  2848. <xsl:text>;padding-right:</xsl:text>
  2849. <xsl:value-of select="WX:apo/WX:horizFromText/@WX:val div 20"/>
  2850. <xsl:text>pt</xsl:text>
  2851. <xsl:text>;padding-left:</xsl:text>
  2852. <xsl:value-of select="WX:apo/WX:horizFromText/@WX:val div 20"/>
  2853. <xsl:text>pt</xsl:text>
  2854. </xsl:if>
  2855. </xsl:attribute>
  2856. <div>
  2857. <xsl:attribute name="style">
  2858. <xsl:value-of select="$bdrStyles"/>
  2859. </xsl:attribute>
  2860. <div>
  2861. <xsl:attribute name="style">
  2862. <xsl:if test="$dxaLeft">
  2863. <xsl:text>;margin-left:-</xsl:text>
  2864. <xsl:value-of select="$dxaLeft div 20"/>
  2865. <xsl:text>pt</xsl:text>
  2866. </xsl:if>
  2867. <xsl:if test="$dxaRight">
  2868. <xsl:text>;margin-right:-</xsl:text>
  2869. <xsl:value-of select="$dxaRight div 20"/>
  2870. <xsl:text>pt</xsl:text>
  2871. </xsl:if>
  2872. </xsl:attribute>
  2873. <xsl:call-template name="DisplayBodyContent">
  2874. <xsl:with-param name="ns.content" select="*"/>
  2875. </xsl:call-template>
  2876. </div>
  2877. </div>
  2878. </td>
  2879. </tr>
  2880. </table>
  2881. </xsl:when>
  2882. <xsl:otherwise>
  2883. <div>
  2884. <xsl:attribute name="style">
  2885. <xsl:value-of select="$bdrStyles"/>
  2886. </xsl:attribute>
  2887. <div>
  2888. <xsl:attribute name="style">
  2889. <xsl:if test="$dxaLeft">
  2890. <xsl:text>;margin-left:-</xsl:text>
  2891. <xsl:value-of select="$dxaLeft div 20"/>
  2892. <xsl:text>pt</xsl:text>
  2893. </xsl:if>
  2894. <xsl:if test="$dxaRight">
  2895. <xsl:text>;margin-right:-</xsl:text>
  2896. <xsl:value-of select="$dxaRight div 20"/>
  2897. <xsl:text>pt</xsl:text>
  2898. </xsl:if>
  2899. </xsl:attribute>
  2900. <xsl:call-template name="DisplayBodyContent">
  2901. <xsl:with-param name="ns.content" select="*"/>
  2902. </xsl:call-template>
  2903. </div>
  2904. </div>
  2905. </xsl:otherwise>
  2906. </xsl:choose>
  2907. </xsl:template>
  2908. <!-- by sunil for positioning-->
  2909. <xsl:template match="svg">
  2910. <xsl:apply-templates select="*"/>
  2911. <div>
  2912. <xsl:attribute name="style">
  2913. <xsl:text> padding-bottom:5px;</xsl:text>
  2914. </xsl:attribute>
  2915. </div>
  2916. </xsl:template>
  2917. <!--<xsl:template match="br">
  2918. <br></br>
  2919. </xsl:template>-->
  2920. <xsl:template match="w:br">
  2921. <br>
  2922. <xsl:attribute name="clear">
  2923. <xsl:choose>
  2924. <xsl:when test="@w:clear">
  2925. <xsl:value-of select="@w:clear"/>
  2926. </xsl:when>
  2927. <xsl:otherwise>all</xsl:otherwise>
  2928. </xsl:choose>
  2929. </xsl:attribute>
  2930. <xsl:if test="@w:type = 'page'">
  2931. <xsl:attribute name="style">page-break-before:always</xsl:attribute>
  2932. </xsl:if>
  2933. </br>
  2934. </xsl:template>
  2935. <xsl:template match="w:instrText">
  2936. </xsl:template>
  2937. <xsl:template match="w:delText">
  2938. <xsl:if test="/w:document/w:settings/w:trackRevisions">
  2939. <del>
  2940. <xsl:value-of select="."/>
  2941. </del>
  2942. </xsl:if>
  2943. </xsl:template>
  2944. <xsl:template match="w:r//w:t[../w:rPr/WX:sym]">
  2945. <xsl:variable name="p.SymHint" select="../w:rPr/WX:sym"/>
  2946. <span>
  2947. <xsl:attribute name="style">
  2948. font-family:<xsl:value-of select="$p.SymHint/@WX:font"/>
  2949. </xsl:attribute>
  2950. <xsl:choose>
  2951. <xsl:when test="starts-with($p.SymHint/@WX:char, 'F0')">
  2952. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="substring-after($p.SymHint/@WX:char, 'F0')"/><xsl:text>;</xsl:text>
  2953. </xsl:when>
  2954. <xsl:when test="starts-with($p.SymHint/@WX:char, 'f0')">
  2955. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="substring-after($p.SymHint/@WX:char, 'f0')"/><xsl:text>;</xsl:text>
  2956. </xsl:when>
  2957. <xsl:otherwise>
  2958. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="$p.SymHint/@WX:char"/><xsl:text>;</xsl:text>
  2959. </xsl:otherwise>
  2960. </xsl:choose>
  2961. </span>
  2962. </xsl:template>
  2963. <xsl:template match="w:pict">
  2964. <span >
  2965. <xsl:value-of select="."/>
  2966. </span>
  2967. <br />
  2968. </xsl:template>
  2969. <xsl:template match="w:t">
  2970. <xsl:value-of select ="."/>
  2971. </xsl:template>
  2972. <xsl:template match="w:sym">
  2973. <span>
  2974. <xsl:attribute name="style">
  2975. font-family:<xsl:value-of select="@w:font"/>
  2976. </xsl:attribute>
  2977. <xsl:choose>
  2978. <xsl:when test="starts-with(@w:char, 'F0')">
  2979. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="substring-after(@w:char, 'F0')"/><xsl:text>;</xsl:text>
  2980. </xsl:when>
  2981. <xsl:when test="starts-with(@w:char, 'f0')">
  2982. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="substring-after(@w:char, 'f0')"/><xsl:text>;</xsl:text>
  2983. </xsl:when>
  2984. <xsl:otherwise>
  2985. <xsl:text disable-output-escaping="yes">&amp;</xsl:text>#x<xsl:value-of select="@w:char"/><xsl:text>;</xsl:text>
  2986. </xsl:otherwise>
  2987. </xsl:choose>
  2988. </span>
  2989. </xsl:template>
  2990. <xsl:template name="OutputTlcChar">
  2991. <xsl:param name="count" select="0"/>
  2992. <xsl:param name="tlc" select="' '"/>
  2993. <xsl:value-of select="$tlc"/>
  2994. <xsl:if test="$count > 1">
  2995. <xsl:call-template name="OutputTlcChar">
  2996. <xsl:with-param name="count" select="$count - 1"/>
  2997. <xsl:with-param name="tlc" select="$tlc"/>
  2998. </xsl:call-template>
  2999. </xsl:if>
  3000. </xsl:template>
  3001. <xsl:template match="w:tab">
  3002. <!-- Parwati:Commented to fix tab indentation.
  3003. <xsl:call-template name="OutputTlcChar">
  3004. <xsl:with-param name="tlc">
  3005. <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
  3006. </xsl:with-param>
  3007. <xsl:with-param name="count" select="12"/>
  3008. </xsl:call-template>-->
  3009. <!--by default tab value will be 5 inch-->
  3010. <span>
  3011. <xsl:attribute name="style">
  3012. <xsl:choose>
  3013. <xsl:when test="./@w:pos">
  3014. <xsl:choose>
  3015. <xsl:when test="./@w:pos and ./@w:val = 'left'">
  3016. margin-left:
  3017. <xsl:choose>
  3018. <xsl:when test="@w:pos &lt; 0">
  3019. <xsl:value-of select="@w:pos div -20"/>pt;
  3020. </xsl:when>
  3021. <xsl:otherwise>
  3022. <xsl:value-of select="@w:pos div 20"/>pt;
  3023. </xsl:otherwise>
  3024. </xsl:choose>
  3025. </xsl:when>
  3026. <xsl:when test="./@w:pos and ./@w:val = 'right'">
  3027. <xsl:choose>
  3028. <xsl:when test="@w:pos &lt; 0">
  3029. <xsl:value-of select="@w:pos div -20"/>pt;
  3030. </xsl:when>
  3031. <xsl:otherwise>
  3032. <xsl:value-of select="@w:pos div 20"/>pt;
  3033. </xsl:otherwise>
  3034. </xsl:choose>
  3035. </xsl:when>
  3036. </xsl:choose>
  3037. </xsl:when>
  3038. <xsl:otherwise>
  3039. margin-left:26pt
  3040. </xsl:otherwise>
  3041. </xsl:choose>
  3042. </xsl:attribute>
  3043. </span>
  3044. </xsl:template>
  3045. <!-- Parwati modified to correct tab indentation-->
  3046. <xsl:template match="w:softHyphen">
  3047. <xsl:text>&#xAD;</xsl:text>
  3048. </xsl:template>
  3049. <xsl:template match="w:noBreakHyphen">
  3050. <xsl:text disable-output-escaping="yes">&amp;#8209;</xsl:text>
  3051. </xsl:template>
  3052. <xsl:template name="DisplayRContent">
  3053. <xsl:choose>
  3054. <xsl:when test="w:numPr">
  3055. <xsl:choose>
  3056. <xsl:when test="w:numPr[1]/w:ilvl/@isBullet">
  3057. <xsl:text disable-output-escaping="yes">&amp;#8226;&amp;#160;</xsl:text>
  3058. </xsl:when>
  3059. <xsl:when test="w:numPr[1]/w:ilvl/@numFont">
  3060. <span>
  3061. <xsl:attribute name="style">
  3062. font-family:<xsl:value-of select="w:numPr[1]/w:ilvl/@numFont"/>
  3063. </xsl:attribute>
  3064. <xsl:value-of select="w:numPr[1]/w:ilvl/@numString"/>
  3065. </span>
  3066. </xsl:when>
  3067. <xsl:otherwise>
  3068. <xsl:value-of select="w:numPr[1]/w:ilvl/@numString"/>
  3069. </xsl:otherwise>
  3070. </xsl:choose>
  3071. <xsl:if test="w:numPr[1]/WX:t/@WX:wTabAfter">
  3072. <span>
  3073. <xsl:attribute name="style">
  3074. <xsl:text>padding-left:</xsl:text>
  3075. <xsl:value-of select="(w:numPr[1]/WX:t/@WX:wTabAfter div 20)" />
  3076. <xsl:text>pt;</xsl:text>
  3077. </xsl:attribute>
  3078. </span>
  3079. </xsl:if>
  3080. </xsl:when>
  3081. <xsl:otherwise>
  3082. <xsl:apply-templates select="*"/>
  3083. </xsl:otherwise>
  3084. </xsl:choose>
  3085. </xsl:template>
  3086. <xsl:template name="ApplyRPr.once">
  3087. <xsl:param name="rStyleId"/>
  3088. <xsl:param name="b.bidi"/>
  3089. <xsl:param name="prsR"/>
  3090. <xsl:variable name="b.complexScript">
  3091. <xsl:choose>
  3092. <xsl:when test="w:rPr[1]/w:cs[1] or w:rPr[1]/w:rtl[1]">
  3093. <xsl:value-of select="$on"/>
  3094. </xsl:when>
  3095. <xsl:otherwise>
  3096. <xsl:value-of select="$off"/>
  3097. </xsl:otherwise>
  3098. </xsl:choose>
  3099. </xsl:variable>
  3100. <xsl:if test="$b.complexScript = $on">
  3101. <xsl:variable name="suffix.complexScript">-CS</xsl:variable>
  3102. <xsl:variable name="b.font-weight" select="substring($prsR,$iBCs,1)"/>
  3103. <xsl:variable name="b.font-style" select="substring($prsR,$iICs,1)"/>
  3104. <xsl:variable name="pr.sz" select="substring($prsR,$ISzCs)"/>
  3105. <xsl:choose>
  3106. <xsl:when test="$b.font-style = $on">font-style:italic;</xsl:when>
  3107. <xsl:otherwise>font-style:normal;</xsl:otherwise>
  3108. </xsl:choose>
  3109. <xsl:choose>
  3110. <xsl:when test="$b.font-weight = $on">font-weight:bold;</xsl:when>
  3111. <xsl:otherwise>font-weight:normal;</xsl:otherwise>
  3112. </xsl:choose>
  3113. <xsl:choose>
  3114. <xsl:when test="$pr.sz = ''">font-size:12pt;</xsl:when>
  3115. <xsl:otherwise>
  3116. font-size:<xsl:value-of select="$pr.sz div 2"/>pt;
  3117. </xsl:otherwise>
  3118. </xsl:choose>
  3119. </xsl:if>
  3120. <xsl:if test="not($b.bidi = '')">
  3121. <xsl:choose>
  3122. <xsl:when test="$b.bidi = $on and not($b.complexScript = $on)">direction:ltr;</xsl:when>
  3123. <xsl:when test="not($b.bidi = $on) and $b.complexScript = $on">direction:rtl;</xsl:when>
  3124. </xsl:choose>
  3125. </xsl:if>
  3126. <xsl:if test="substring($prsR,$iEmbossImprint,1) = $on">color:gray;</xsl:if>
  3127. <xsl:variable name="b.line-through" select="substring($prsR,$iStrikeDStrike,1)"/>
  3128. <xsl:variable name="b.underline" select="substring($prsR,$iU_Em,1)"/>
  3129. <xsl:choose>
  3130. <xsl:when test="$b.line-through = $off and $b.underline = $off">text-decoration:none;</xsl:when>
  3131. <xsl:when test="$b.line-through = $on and $b.underline = $on">text-decoration:line-through underline;</xsl:when>
  3132. <xsl:when test="$b.line-through = $on">text-decoration: line-through;</xsl:when>
  3133. <xsl:when test="$b.underline = $on">text-decoration: underline;</xsl:when>
  3134. </xsl:choose>
  3135. <xsl:variable name="fSup" select="substring($prsR,$iSup,1)"/>
  3136. <xsl:variable name="fSub" select="substring($prsR,$iSub,1)"/>
  3137. <xsl:choose>
  3138. <xsl:when test="$fSup = $on and $fSub = $on">vertical-align:baseline;</xsl:when>
  3139. <xsl:when test="$fSub = $on">vertical-align:sub;</xsl:when>
  3140. <xsl:when test="$fSup = $on">vertical-align:super;</xsl:when>
  3141. </xsl:choose>
  3142. <xsl:if test="not($rStyleId='CommentReference')">
  3143. <xsl:if test="substring($prsR,$iVanishWebHidden,1) = $on">display:none;</xsl:if>
  3144. </xsl:if>
  3145. </xsl:template>
  3146. <xsl:template name="RecursiveApplyRPr.class">
  3147. <xsl:if test="w:basedOn">
  3148. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  3149. <xsl:variable name="sParaStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  3150. <xsl:for-each select="$sParaStyleBase">
  3151. <xsl:call-template name="RecursiveApplyRPr.class" />
  3152. </xsl:for-each>
  3153. </xsl:if>
  3154. <xsl:call-template name="ApplyRPr.class"/>
  3155. </xsl:template>
  3156. <xsl:template name="ApplyRPr.class">
  3157. <xsl:for-each select="w:rPr[1]">
  3158. <xsl:choose>
  3159. <xsl:when test="w:highlight">
  3160. background-color:<xsl:call-template name="ConvColor">
  3161. <xsl:with-param name="value" select="w:hightlight[1]/@w:val"/>
  3162. </xsl:call-template>
  3163. <xsl:value-of select="value"/>;
  3164. </xsl:when>
  3165. <xsl:otherwise>
  3166. <xsl:for-each select="w:shd[1]">
  3167. <xsl:call-template name="ApplyShd"/>
  3168. </xsl:for-each>
  3169. </xsl:otherwise>
  3170. </xsl:choose>
  3171. <xsl:apply-templates select="*" mode="rpr"/>
  3172. </xsl:for-each>
  3173. </xsl:template>
  3174. <xsl:template match="w:highlight" mode="rpr">
  3175. background:<xsl:call-template name="ConvColor">
  3176. <xsl:with-param name="value" select="@w:val"/>
  3177. </xsl:call-template>
  3178. <xsl:value-of select="value"/>;
  3179. </xsl:template>
  3180. <xsl:template match="w:color" mode="rpr">
  3181. color:<xsl:call-template name="ConvHexColor">
  3182. <xsl:with-param name="value" select="@w:val"/>
  3183. </xsl:call-template>;
  3184. </xsl:template>
  3185. <xsl:template match="w:rFonts" mode="rpr">
  3186. font-family:<xsl:value-of select="@w:ascii"/>;
  3187. </xsl:template>
  3188. <xsl:template match="w:smallCaps" mode="rpr">
  3189. <xsl:choose>
  3190. <xsl:when test="@w:val = 'off'">font-variant:normal;</xsl:when>
  3191. <xsl:otherwise>font-variant:small-caps;</xsl:otherwise>
  3192. </xsl:choose>
  3193. </xsl:template>
  3194. <xsl:template match="w:eastAsianLayout" mode="rpr">
  3195. <xsl:choose>
  3196. <xsl:when test="@w:vert = 'on'">layout-flow:horizontal;</xsl:when>
  3197. <xsl:when test="@w:vert-compress = 'on'">layout-flow:horizontal;</xsl:when>
  3198. <xsl:when test="@w:vert = 'off' or @w:vert-compress = 'off'">layout-flow:normal;</xsl:when>
  3199. </xsl:choose>
  3200. <xsl:if test="@w:combine = 'lines'">text-combine:lines;</xsl:if>
  3201. </xsl:template>
  3202. <xsl:template match="w:spacing" mode="rpr">
  3203. letter-spacing:<xsl:value-of select="@w:val div 20"/>pt;
  3204. </xsl:template>
  3205. <xsl:template match="w:position" mode="rpr">
  3206. <xsl:variable name="fDropCap">
  3207. <xsl:value-of select="ancestor::w:p[1]/w:pPr/w:framePr/@w:drop-cap"/>
  3208. </xsl:variable>
  3209. <xsl:if test="$fDropCap=''">
  3210. <xsl:text>position:relative;top:</xsl:text>
  3211. <xsl:value-of select="@w:val div -2"/>
  3212. <xsl:text>pt;</xsl:text>
  3213. </xsl:if>
  3214. </xsl:template>
  3215. <xsl:template match="w:fitText" mode="rpr">
  3216. text-fit:<xsl:value-of select="@w:val div 20"/>pt;
  3217. </xsl:template>
  3218. <xsl:template match="w:shadow" mode="rpr">
  3219. <xsl:choose>
  3220. <xsl:when test="@w:val = 'off'">text-shadow:none;</xsl:when>
  3221. <xsl:otherwise>text-shadow:0.2em 0.2em;</xsl:otherwise>
  3222. </xsl:choose>
  3223. </xsl:template>
  3224. <xsl:template match="w:caps" mode="rpr">
  3225. <xsl:choose>
  3226. <xsl:when test="@w:val = 'off'">text-transform:none;</xsl:when>
  3227. <xsl:otherwise>text-transform:uppercase;</xsl:otherwise>
  3228. </xsl:choose>
  3229. </xsl:template>
  3230. <xsl:template match="w:sz" mode="rpr">
  3231. font-size:<xsl:value-of select="@w:val div 2"/>pt;
  3232. </xsl:template>
  3233. <xsl:template match="w:b" mode="rpr">
  3234. <xsl:choose>
  3235. <xsl:when test="@w:val = 'off'">font-weight:normal;</xsl:when>
  3236. <xsl:otherwise>font-weight:bold;</xsl:otherwise>
  3237. </xsl:choose>
  3238. </xsl:template>
  3239. <xsl:template match="w:i" mode="rpr">
  3240. <xsl:choose>
  3241. <xsl:when test="@w:val = 'off'">font-style:normal;</xsl:when>
  3242. <xsl:otherwise>font-style:italic;</xsl:otherwise>
  3243. </xsl:choose>
  3244. </xsl:template>
  3245. <xsl:template match="*" mode="rpr"/>
  3246. <xsl:template name="RecursivePrsUpdateRPr">
  3247. <xsl:param name="prsR" />
  3248. <xsl:param name="rStyleId" />
  3249. <xsl:variable name="myStyle" select="($nsStyles[@w:styleId=$rStyleId])[1]"/>
  3250. <xsl:variable name="prsR.updated">
  3251. <xsl:choose>
  3252. <xsl:when test="$myStyle/w:basedOn">
  3253. <xsl:call-template name="RecursivePrsUpdateRPr">
  3254. <xsl:with-param name="prsR" select="$prsR" />
  3255. <xsl:with-param name= "rStyleId" select="$myStyle/w:basedOn/@w:val" />
  3256. </xsl:call-template>
  3257. </xsl:when>
  3258. <xsl:otherwise>
  3259. <xsl:value-of select="$prsR" />
  3260. </xsl:otherwise>
  3261. </xsl:choose>
  3262. </xsl:variable>
  3263. <xsl:call-template name="PrsUpdateRPr">
  3264. <xsl:with-param name="ndPrContainer" select="$myStyle"/>
  3265. <xsl:with-param name="prsR" select="$prsR.updated"/>
  3266. </xsl:call-template>
  3267. </xsl:template>
  3268. <xsl:template name="PrsGetThemeStyle">
  3269. <xsl:param name="prsR"/>
  3270. <xsl:param name="runTextClass" select="$textClassAscii"/>
  3271. <xsl:if test="not($runTextClass='')">
  3272. <xsl:variable name="themeStyle">
  3273. <xsl:choose>
  3274. <xsl:when test="$runTextClass=$textClassAscii">
  3275. <xsl:value-of select="substring($prsR,$iAsciiTheme,1)"/>
  3276. </xsl:when>
  3277. <xsl:when test="$runTextClass=$textClassAnsi">
  3278. <xsl:value-of select="substring($prsR,$iAnsiTheme,1)"/>
  3279. </xsl:when>
  3280. <xsl:when test="$runTextClass=$textClassEA">
  3281. <xsl:value-of select="substring($prsR,$iEATheme,1)"/>
  3282. </xsl:when>
  3283. <xsl:when test="$runTextClass=$textClassCS">
  3284. <xsl:value-of select="substring($prsR,$iCSTheme,1)"/>
  3285. </xsl:when>
  3286. </xsl:choose>
  3287. </xsl:variable>
  3288. <xsl:choose>
  3289. <xsl:when test="$themeStyle=$minorAscii">
  3290. <xsl:value-of select="$minorAsciiTheme"/>
  3291. </xsl:when>
  3292. <xsl:when test="$themeStyle=$majorAscii">
  3293. <xsl:value-of select="$majorAsciiTheme"/>
  3294. </xsl:when>
  3295. <xsl:when test="$themeStyle=$minorAnsi">
  3296. <xsl:value-of select="$minorAnsiTheme"/>
  3297. </xsl:when>
  3298. <xsl:when test="$themeStyle=$majorAnsi">
  3299. <xsl:value-of select="$majorAnsiTheme"/>
  3300. </xsl:when>
  3301. <xsl:when test="$themeStyle=$minorEA">
  3302. <xsl:value-of select="$minorEATheme"/>
  3303. </xsl:when>
  3304. <xsl:when test="$themeStyle=$majorEA">
  3305. <xsl:value-of select="$majorEATheme"/>
  3306. </xsl:when>
  3307. <xsl:when test="$themeStyle=$minorCS">
  3308. <xsl:value-of select="$minorCSTheme"/>
  3309. </xsl:when>
  3310. <xsl:when test="$themeStyle=$majorCS">
  3311. <xsl:value-of select="$majorCSTheme"/>
  3312. </xsl:when>
  3313. </xsl:choose>
  3314. </xsl:if>
  3315. </xsl:template>
  3316. <xsl:template name="DisplayR">
  3317. <xsl:param name="b.bidi"/>
  3318. <xsl:param name="prsR"/>
  3319. <xsl:param name="runStyleName"/>
  3320. <xsl:variable name="rStyleId" select="string(w:rPr/w:rStyle/@w:val)"/>
  3321. <xsl:variable name="prsR.updated">
  3322. <xsl:variable name="prsR.updated1">
  3323. <xsl:call-template name="RecursivePrsUpdateRPr">
  3324. <xsl:with-param name="rStyleId" select="$rStyleId"/>
  3325. <xsl:with-param name="prsR" select="$prsR"/>
  3326. </xsl:call-template>
  3327. </xsl:variable>
  3328. <xsl:variable name="prsR.updated2">
  3329. <xsl:call-template name="PrsUpdateRPr">
  3330. <xsl:with-param name="prsR" select="$prsR.updated1"/>
  3331. </xsl:call-template>
  3332. </xsl:variable>
  3333. <xsl:variable name="prsRTemp3">
  3334. <xsl:call-template name="PrsGetListPr">
  3335. <xsl:with-param name="type" select="$prrUpdateRPr"/>
  3336. <xsl:with-param name="prsR" select="$prsR.updated2"/>
  3337. </xsl:call-template>
  3338. </xsl:variable>
  3339. <xsl:choose>
  3340. <xsl:when test="$prsRTemp3=''">
  3341. <xsl:value-of select="$prsR.updated2"/>
  3342. </xsl:when>
  3343. <xsl:otherwise>
  3344. <xsl:value-of select="$prsRTemp3"/>
  3345. </xsl:otherwise>
  3346. </xsl:choose>
  3347. </xsl:variable>
  3348. <xsl:variable name="themeStyle">
  3349. <xsl:call-template name="PrsGetThemeStyle">
  3350. <xsl:with-param name="prsR" select="$prsR.updated"/>
  3351. <xsl:with-param name="runTextClass" select="string(./@textClass)"/>
  3352. </xsl:call-template>
  3353. </xsl:variable>
  3354. <xsl:variable name="pr.listSuff">
  3355. <xsl:call-template name="PrsGetListPr">
  3356. <xsl:with-param name="type" select="$prrListSuff"/>
  3357. </xsl:call-template>
  3358. </xsl:variable>
  3359. <xsl:variable name="styleMod">
  3360. <xsl:call-template name="ApplyRPr.class"/>
  3361. <xsl:variable name="numId" select="w:numPr/w:numId/@w:val" />
  3362. <xsl:variable name="ilvl" select="w:numPr/w:ilvl/@w:val" />
  3363. <xsl:variable name="ilstDef" select="$ndLists/w:num[@w:numId=$numId]/w:abstractNumId/@w:val" />
  3364. <xsl:variable name="abstractNum" select="$ndLists/w:abstractNum[@w:abstractNumId=$ilstDef]" />
  3365. <xsl:variable name="isBullets">
  3366. <xsl:for-each select="w:numPr[1]">
  3367. <xsl:call-template name="IsListBullet" />
  3368. </xsl:for-each>
  3369. </xsl:variable>
  3370. <xsl:if test="not($isBullets=$on)">
  3371. <xsl:if test="$abstractNum/w:lvl[@w:ilvl=$ilvl]/w:rPr/w:rFonts/@w:ascii" >
  3372. <xsl:apply-templates select="w:numPr[1]/WX:font[1]" mode="rpr"/>
  3373. </xsl:if>
  3374. <xsl:call-template name="PrsGetListPr">
  3375. <xsl:with-param name="type" select="$prrApplyRPr"/>
  3376. </xsl:call-template>
  3377. <xsl:call-template name="ApplyRPr.once">
  3378. <xsl:with-param name="rStyleId" select="$rStyleId"/>
  3379. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3380. <xsl:with-param name="prsR" select="$prsR.updated"/>
  3381. </xsl:call-template>
  3382. </xsl:if>
  3383. <xsl:if test="$isBullets=$on or ancestor::w:rt">
  3384. <xsl:text>font-style:normal;text-decoration:none;font-weight:normal;</xsl:text>
  3385. </xsl:if>
  3386. </xsl:variable>
  3387. <xsl:choose>
  3388. <xsl:when test="$rStyleId='' and $styleMod=''">
  3389. <xsl:choose>
  3390. <xsl:when test="not($themeStyle='')">
  3391. <span>
  3392. <xsl:attribute name="class">
  3393. <xsl:value-of select="$themeStyle"/>
  3394. <xsl:if test="not($runStyleName='')">
  3395. <xsl:value-of select="' '"/>
  3396. <xsl:value-of select="$runStyleName"/>
  3397. </xsl:if>
  3398. </xsl:attribute>
  3399. <xsl:call-template name="DisplayRContent"/>
  3400. </span>
  3401. </xsl:when>
  3402. <xsl:otherwise>
  3403. <xsl:call-template name="DisplayRContent"/>
  3404. </xsl:otherwise>
  3405. </xsl:choose>
  3406. <xsl:if test="$pr.listSuff = $prListSuff_space">
  3407. <xsl:text> </xsl:text>
  3408. </xsl:if>
  3409. </xsl:when>
  3410. <xsl:otherwise>
  3411. <span>
  3412. <!-- <xsl:if test="not($rStyleId='')">-->
  3413. <xsl:attribute name="class">
  3414. <xsl:if test="not($themeStyle='')">
  3415. <xsl:value-of select="$themeStyle"/>
  3416. <xsl:value-of select="' '"/>
  3417. </xsl:if>
  3418. <xsl:value-of select="$rStyleId"/>
  3419. <xsl:value-of select="$charStyleSuffix"/>
  3420. </xsl:attribute>
  3421. <!-- </xsl:if> -->
  3422. <xsl:if test="not($styleMod='')">
  3423. <xsl:attribute name="style">
  3424. <xsl:value-of select="$styleMod"/>
  3425. </xsl:attribute>
  3426. </xsl:if>
  3427. <xsl:choose>
  3428. <xsl:when test="contains($styleMod, 'vertical-align:super') or contains($styleMod, 'vertical-align:sub')">
  3429. <span>
  3430. <xsl:attribute name="style">font-size:smaller;</xsl:attribute>
  3431. <xsl:call-template name="DisplayRContent"/>
  3432. </span>
  3433. </xsl:when>
  3434. <xsl:otherwise>
  3435. <xsl:call-template name="DisplayRContent"/>
  3436. </xsl:otherwise>
  3437. </xsl:choose>
  3438. </span>
  3439. </xsl:otherwise>
  3440. </xsl:choose>
  3441. </xsl:template>
  3442. <xsl:template match="w:r">
  3443. <xsl:param name="b.bidi" select="''"/>
  3444. <xsl:param name="prsR" select="$prsRDefault"/>
  3445. <xsl:param name="runStyleName"/>
  3446. <!--<xsl:if test="not(w:fldChar or w:instrText)">-->
  3447. <xsl:if test="not(w:fldChar or w:instrText)">
  3448. <xsl:variable name="instrText" select="preceding-sibling::w:r[w:instrText][1]" />
  3449. <xsl:variable name="nInstrText" select="normalize-space(concat($instrText, ' -'))" />
  3450. <xsl:variable name="instruction" select="substring-before($nInstrText, ' ')" />
  3451. <xsl:choose>
  3452. <xsl:when test="translate($instruction, $lowercase, $uppercase)='HYPERLINK'">
  3453. <a>
  3454. <!--<xsl:template match="a">
  3455. <xsl:variable name="anchor-texts">
  3456. <xsl:value-of select="."/>
  3457. </xsl:variable>
  3458. <xsl:apply-templates/>
  3459. <xsl:if test="@href!=$anchor-texts">
  3460. <fo:inline>
  3461. <xsl:text>(</xsl:text>
  3462. <xsl:value-of select="@href"/>
  3463. <xsl:text>)</xsl:text>
  3464. </fo:inline>
  3465. </xsl:if>
  3466. </xsl:template>-->
  3467. <xsl:variable name="href">
  3468. <xsl:choose>
  3469. <xsl:when test="contains($nInstrText,'\l')">
  3470. #<xsl:value-of select="translate(substring-before(substring-after($nInstrText, '\l '),' '),'&quot;', '')"/>
  3471. </xsl:when>
  3472. <xsl:otherwise>
  3473. <xsl:value-of select="translate(substring-before(substring-after($nInstrText, concat($instruction, ' ')),' '),'&quot;', '')"/>
  3474. </xsl:otherwise>
  3475. </xsl:choose>
  3476. </xsl:variable>
  3477. <xsl:if test="not(href='')">
  3478. <xsl:attribute name="href">
  3479. <xsl:value-of select="$href"/>
  3480. </xsl:attribute>
  3481. </xsl:if>
  3482. <xsl:if test="contains($nInstrText,'\t') or contains($nInstrText, '\n')">
  3483. <xsl:attribute name="target">
  3484. <xsl:choose>
  3485. <xsl:when test="contains($nInstrText, '\n')">
  3486. <xsl:text>_new</xsl:text>
  3487. </xsl:when>
  3488. <xsl:otherwise>
  3489. <xsl:value-of select="translate(substring-before(substring-after($nInstrText, '\t '),' '),'&quot;', '')"/>
  3490. </xsl:otherwise>
  3491. </xsl:choose>
  3492. </xsl:attribute>
  3493. </xsl:if>
  3494. <xsl:if test="contains($nInstrText,'\o')">
  3495. <xsl:attribute name="title">
  3496. <xsl:value-of select="substring-before(substring-after($nInstrText, '\o &quot;'),'&quot;')"/>
  3497. </xsl:attribute>
  3498. </xsl:if>
  3499. <xsl:call-template name="DisplayR">
  3500. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3501. <xsl:with-param name="prsR" select="$prsR"/>
  3502. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  3503. </xsl:call-template>
  3504. </a>
  3505. </xsl:when>
  3506. <xsl:otherwise>
  3507. <xsl:call-template name="DisplayR">
  3508. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3509. <xsl:with-param name="prsR" select="$prsR"/>
  3510. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  3511. </xsl:call-template>
  3512. </xsl:otherwise>
  3513. </xsl:choose>
  3514. </xsl:if>
  3515. </xsl:template>
  3516. <!-- Template added to render columns by Parwati -->
  3517. <xsl:template name="ColumnRender">
  3518. <xsl:param name="page"/>
  3519. <xsl:param name="colNum"/>
  3520. <xsl:param name="style"/>
  3521. <xsl:param name="CoverPage"/>
  3522. <xsl:param name="Align"/>
  3523. <xsl:text disable-output-escaping="yes">&lt;/span&gt;</xsl:text>
  3524. <xsl:text disable-output-escaping="yes">&lt;/p&gt;</xsl:text>
  3525. <xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
  3526. <xsl:if test="$page = $on">
  3527. <xsl:text disable-output-escaping="yes">&lt;/tr&gt;</xsl:text>
  3528. <xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
  3529. <xsl:if test="$CoverPage = $on">
  3530. <xsl:text disable-output-escaping="yes">&lt;div style="top:1010px;left:0px;position:absolute;visibility:show;"&gt;</xsl:text>
  3531. </xsl:if>
  3532. <xsl:text disable-output-escaping="yes">&lt;table cellpadding="5px"&gt;</xsl:text>
  3533. <xsl:text disable-output-escaping="yes">&lt;tr&gt;</xsl:text>
  3534. </xsl:if>
  3535. <xsl:text disable-output-escaping="yes">&lt;td valign="top" width="</xsl:text>
  3536. <xsl:value-of select="100 div $colNum"/>
  3537. <xsl:text disable-output-escaping="yes">%"&gt;</xsl:text>
  3538. <xsl:text disable-output-escaping="yes">&lt;p class="</xsl:text>
  3539. <xsl:variable name="pStyleId">
  3540. <xsl:call-template name="GetPStyleId"/>
  3541. </xsl:variable>
  3542. <xsl:value-of select="$pStyleId"/>
  3543. <xsl:value-of select="$paraStyleSuffix"/>
  3544. <xsl:text>" style="text-align:</xsl:text>
  3545. <xsl:choose>
  3546. <xsl:when test="$Align = 'both'">
  3547. <xsl:text>justify</xsl:text>
  3548. </xsl:when>
  3549. <xsl:otherwise>
  3550. <xsl:value-of select="$Align"/>
  3551. </xsl:otherwise>
  3552. </xsl:choose>
  3553. <xsl:text>;</xsl:text>
  3554. <xsl:value-of select="$style"/>
  3555. <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
  3556. <xsl:text disable-output-escaping="yes">&lt;span&gt;</xsl:text>
  3557. </xsl:template>
  3558. <!-- End to template for column rendering -->
  3559. <xsl:template match="w:r[count(preceding-sibling::w:r[w:fldChar/@w:fldCharType='begin']) = count(preceding-sibling::w:r[w:fldChar/@w:fldCharType='end'])]">
  3560. <xsl:param name="b.bidi" select="''"/>
  3561. <xsl:param name="prsR" select="$prsRDefault"/>
  3562. <xsl:param name="runStyleName"/>
  3563. <!-- Changed For rendering column by Parwati-->
  3564. <!-- <xsl:if test="//w:body//w:sectPr//w:cols[@w:num] | //w:body/w:p/w:pPr/w:sectPr/w:cols[@w:num]">
  3565. <xsl:variable name="pageEnd">
  3566. <xsl:choose>
  3567. <xsl:when test="w:lastRenderedPageBreak[@pageNum]">
  3568. <xsl:value-of select="$on"/>
  3569. </xsl:when>
  3570. <xsl:otherwise>
  3571. <xsl:value-of select="$off"/>
  3572. </xsl:otherwise>
  3573. </xsl:choose>
  3574. </xsl:variable> End of Change by Parwati -->
  3575. <xsl:variable name="coverpage">
  3576. <xsl:choose>
  3577. <xsl:when test="./w:lastRenderedPageBreak/@Coverpage">
  3578. <xsl:value-of select="$on"/>
  3579. </xsl:when>
  3580. <xsl:otherwise>
  3581. <xsl:value-of select="$off"/>
  3582. </xsl:otherwise>
  3583. </xsl:choose>
  3584. </xsl:variable>
  3585. <xsl:variable name="columnNo">
  3586. <xsl:value-of select="./w:lastRenderedPageBreak/@colNum"/>
  3587. </xsl:variable>
  3588. <xsl:variable name="columnCount">
  3589. <xsl:value-of select="./w:lastRenderedPageBreak/@colCount"/>
  3590. </xsl:variable>
  3591. <xsl:variable name="pStyleId">
  3592. <xsl:call-template name="GetPStyleId"/>
  3593. </xsl:variable>
  3594. <xsl:variable name="sParaStyleName" select="($nsStyles[@w:styleId=$pStyleId])[1]"/>
  3595. <xsl:variable name="b.bidi1">
  3596. <xsl:choose>
  3597. <xsl:when test="parent::w:pPr[1]/w:rPr[1]/w:rtl[1]">
  3598. <xsl:value-of select="$on"/>
  3599. </xsl:when>
  3600. <xsl:otherwise>
  3601. <xsl:value-of select="$off"/>
  3602. </xsl:otherwise>
  3603. </xsl:choose>
  3604. </xsl:variable>
  3605. <xsl:variable name="prsR.updated">
  3606. <xsl:call-template name="PrsUpdateRPr">
  3607. <xsl:with-param name="ndPrContainer" select="$sParaStyleName"/>
  3608. <xsl:with-param name="prsR" select="$prsR"/>
  3609. </xsl:call-template>
  3610. </xsl:variable>
  3611. <xsl:variable name="prsP.updated1">
  3612. <xsl:call-template name="PrsUpdatePPr">
  3613. <xsl:with-param name="ndPrContainer" select="$sParaStyleName"/>
  3614. <xsl:with-param name="prsP" select="$prsPDefault"/>
  3615. </xsl:call-template>
  3616. </xsl:variable>
  3617. <xsl:variable name="prsP.updated">
  3618. <xsl:call-template name="PrsUpdatePPr">
  3619. <xsl:with-param name="prsP" select="$prsP.updated1"/>
  3620. </xsl:call-template>
  3621. </xsl:variable>
  3622. <xsl:variable name="prsPAccum" select="''"/>
  3623. <xsl:variable name="styleMod">
  3624. <xsl:value-of select="$prsPAccum"/>
  3625. <xsl:for-each select="$sParaStyleName">
  3626. <xsl:call-template name="RecursiveApplyPPr.many"/>
  3627. </xsl:for-each>
  3628. <xsl:call-template name="ApplyPPr.many">
  3629. <xsl:with-param name="cxtSpacing">
  3630. <xsl:variable name="cspacing" select="$sParaStyleName/w:pPr[1]/w:contextualSpacing[1]"/>
  3631. <xsl:if test="$cspacing and not($cspacing/@w:val = 'off')">
  3632. <xsl:if test="following-sibling::*[1]/w:pPr[1]/w:pStyle[1]/@w:val = $pStyleId">
  3633. <xsl:value-of select="$cxtSpacing_top"/>
  3634. </xsl:if>
  3635. <xsl:if test="preceding-sibling::*[1]/w:pPr[1]/w:pStyle[1]/@w:val = $pStyleId">
  3636. <xsl:value-of select="$cxtSpacing_bottom"/>
  3637. </xsl:if>
  3638. </xsl:if>
  3639. </xsl:with-param>
  3640. </xsl:call-template>
  3641. <xsl:call-template name="ApplyPPr.class"/>
  3642. <xsl:variable name="bdrBetween" select="''"/>
  3643. <xsl:call-template name="ApplyPPr.once">
  3644. <xsl:with-param name="b.bidi" select="$b.bidi1"/>
  3645. <xsl:with-param name="prsP" select="$prsP.updated"/>
  3646. <xsl:with-param name="i.bdrRange.this" select="position()"/>
  3647. <xsl:with-param name="i.bdrRange.last" select="last()"/>
  3648. <xsl:with-param name="pr.bdrBetween" select="$bdrBetween"/>
  3649. </xsl:call-template>
  3650. </xsl:variable>
  3651. <xsl:variable name="alignment">
  3652. <xsl:if test="parent::*[1]/w:pPr/w:jc">
  3653. <xsl:value-of select="parent::*[1]/w:pPr/w:jc/@w:val"/>
  3654. </xsl:if>
  3655. </xsl:variable>
  3656. <!-- Added for column rendering by Parwati -->
  3657. <!-- <xsl:if test="//w:body//w:sectPr//w:cols[@w:num] | //w:body/w:p/w:pPr/w:sectPr/w:cols[@w:num] | //w:body//w:sdt//w:sdtContent">
  3658. <xsl:if test="descendant::*[name()='w:lastRenderedPageBreak'][1]/@colNum">
  3659. <xsl:call-template name="ColumnRender">
  3660. <xsl:with-param name="page" select="$pageEnd"></xsl:with-param>
  3661. <xsl:with-param name="colNum" select="$columnNo"></xsl:with-param>
  3662. <xsl:with-param name="style" select="$styleMod"></xsl:with-param>
  3663. <xsl:with-param name="CoverPage" select="$coverpage"></xsl:with-param>
  3664. <xsl:with-param name="Align" select="$alignment"></xsl:with-param>
  3665. </xsl:call-template>
  3666. </xsl:if>
  3667. </xsl:if>
  3668. </xsl:if> -->
  3669. <!-- End of change by Parwati -->
  3670. <xsl:call-template name="DisplayR">
  3671. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3672. <xsl:with-param name="prsR" select="$prsR"/>
  3673. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  3674. </xsl:call-template>
  3675. </xsl:template>
  3676. <xsl:template name="ColumnAddition"> <!-- This is template is added by Parwati to handle columns -->
  3677. <xsl:param name="totalColumns"></xsl:param>
  3678. <xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
  3679. <xsl:text disable-output-escaping="yes">&lt;td colspan="</xsl:text>
  3680. <xsl:value-of select="$totalColumns"/>
  3681. <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
  3682. </xsl:template>
  3683. <xsl:template match="w:pPr">
  3684. <xsl:param name="b.bidi" select="''"/>
  3685. <xsl:param name="prsR" select="$prsRDefault"/>
  3686. <xsl:call-template name="DisplayR">
  3687. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3688. <xsl:with-param name="prsR" select="$prsR"/>
  3689. </xsl:call-template>
  3690. </xsl:template>
  3691. <xsl:template name="DisplayHlink">
  3692. <xsl:param name="b.bidi"/>
  3693. <xsl:param name="prsR"/>
  3694. <a style="text-decoration:none;">
  3695. <xsl:variable name="href">
  3696. <xsl:for-each select="@w:dest">
  3697. <xsl:value-of select="."/>
  3698. </xsl:for-each>
  3699. <xsl:choose>
  3700. <xsl:when test="@w:anchor">#<xsl:value-of select="@w:anchor"/>
  3701. </xsl:when>
  3702. <xsl:when test="@w:bookmark">#<xsl:value-of select="@w:bookmark"/>
  3703. </xsl:when>
  3704. <xsl:when test="@w:arbLocation"># <xsl:value-of select="@w:arbLocation"/>
  3705. </xsl:when>
  3706. </xsl:choose>
  3707. </xsl:variable>
  3708. <xsl:if test="not(href='')">
  3709. <xsl:attribute name="href">
  3710. <xsl:value-of select="$href"/>
  3711. </xsl:attribute>
  3712. </xsl:if>
  3713. <xsl:for-each select="@w:tgtFrame">
  3714. <xsl:attribute name="target">
  3715. <xsl:value-of select="."/>
  3716. </xsl:attribute>
  3717. </xsl:for-each>
  3718. <xsl:for-each select="@w:tooltip">
  3719. <xsl:attribute name="title">
  3720. <xsl:value-of select="."/>
  3721. </xsl:attribute>
  3722. </xsl:for-each>
  3723. <xsl:call-template name="DisplayPContent">
  3724. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3725. <xsl:with-param name="prsR" select="$prsR"/>
  3726. </xsl:call-template>
  3727. </a>
  3728. </xsl:template>
  3729. <xsl:template match="w:hlink | w:hyperlink">
  3730. <xsl:param name="b.bidi" select="''"/>
  3731. <xsl:param name="prsR" select="$prsRDefault"/>
  3732. <xsl:call-template name="DisplayHlink">
  3733. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  3734. <xsl:with-param name="prsR" select="$prsR"/>
  3735. </xsl:call-template>
  3736. </xsl:template>
  3737. <xsl:template name="ApplyPPr.once">
  3738. <xsl:param name="i.bdrRange.this"/>
  3739. <xsl:param name="i.bdrRange.last"/>
  3740. <xsl:param name="pr.bdrBetween"/>
  3741. <xsl:param name="prsP"/>
  3742. <xsl:param name="b.bidi"/>
  3743. <xsl:if test="not($i.bdrRange.this = $i.bdrRange.last)">
  3744. <xsl:call-template name="ApplyBorderPr">
  3745. <xsl:with-param name="pr.bdr" select="$pr.bdrBetween"/>
  3746. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  3747. </xsl:call-template>
  3748. </xsl:if>
  3749. <xsl:if test="not($pr.bdrBetween = '')">
  3750. <xsl:choose>
  3751. <xsl:when test="$i.bdrRange.this = 1">padding:0 0 1pt;</xsl:when>
  3752. <xsl:when test="$i.bdrRange.this = i.bdrRange.last">padding:1pt 0 0;</xsl:when>
  3753. <xsl:otherwise>padding:1pt 0 1pt;</xsl:otherwise>
  3754. </xsl:choose>
  3755. </xsl:if>
  3756. <xsl:choose>
  3757. <xsl:when test="$b.bidi = $off">direction:ltr;unicode-bidi:normal;</xsl:when>
  3758. <xsl:when test="$b.bidi = $on">direction:rtl;unicode-bidi:embed;text-align:right;</xsl:when>
  3759. </xsl:choose>
  3760. <xsl:variable name="nInd" select="substring($prsP,$iInd)"/>
  3761. <xsl:variable name="pr.listInd">
  3762. <xsl:for-each select="w:pPr">
  3763. <xsl:call-template name="PrsGetListPr">
  3764. <xsl:with-param name="type" select="$prrListInd"/>
  3765. </xsl:call-template>
  3766. </xsl:for-each>
  3767. </xsl:variable>
  3768. <xsl:if test="not($nInd='' and $pr.listInd='')">
  3769. <xsl:variable name="nInd.left" select="substring-before($nInd,$sep2)"/>
  3770. <xsl:variable name="temp1" select="substring-after($nInd,$sep2)"/>
  3771. <xsl:variable name="nInd.leftChars" select="substring-before($temp1,$sep2)"/>
  3772. <xsl:variable name="temp2" select="substring-after($temp1,$sep2)"/>
  3773. <xsl:variable name="nInd.right" select="substring-before($temp2,$sep2)"/>
  3774. <xsl:variable name="temp3" select="substring-after($temp2,$sep2)"/>
  3775. <xsl:variable name="nInd.rightChars" select="substring-before($temp3,$sep2)"/>
  3776. <xsl:variable name="temp4" select="substring-after($temp3,$sep2)"/>
  3777. <xsl:variable name="nInd.hanging" select="substring-before($temp4,$sep2)"/>
  3778. <xsl:variable name="temp5" select="substring-after($temp4,$sep2)"/>
  3779. <xsl:variable name="nInd.hangingChars" select="substring-before($temp5,$sep2)"/>
  3780. <xsl:variable name="temp6" select="substring-after($temp5,$sep2)"/>
  3781. <xsl:variable name="nInd.firstLine" select="substring-before($temp6,$sep2)"/>
  3782. <xsl:variable name="nInd.firstLineChars" select="substring-after($temp6,$sep2)"/>
  3783. <xsl:variable name="pr.listInd.left" select="substring-before($pr.listInd,$sep2)"/>
  3784. <xsl:variable name="temp1a" select="substring-after($pr.listInd,$sep2)"/>
  3785. <xsl:variable name="pr.listInd.leftChars" select="substring-before($temp1a,$sep2)"/>
  3786. <xsl:variable name="temp2a" select="substring-after($temp1a,$sep2)"/>
  3787. <xsl:variable name="pr.listInd.hanging" select="substring-before($temp2a,$sep2)"/>
  3788. <xsl:variable name="pr.listInd.hangingChars" select="substring-after($temp2a,$sep2)"/>
  3789. <xsl:variable name="marginSide.before">
  3790. margin-<xsl:choose>
  3791. <xsl:when test="$b.bidi=$on">right</xsl:when>
  3792. <xsl:otherwise>left</xsl:otherwise>
  3793. </xsl:choose>:
  3794. </xsl:variable>
  3795. <xsl:variable name="marginSide.after">
  3796. margin-<xsl:choose>
  3797. <xsl:when test="$b.bidi=$on">left</xsl:when>
  3798. <xsl:otherwise>right</xsl:otherwise>
  3799. </xsl:choose>:
  3800. </xsl:variable>
  3801. <xsl:choose>
  3802. <xsl:when test="not($pr.listInd.left = '')">
  3803. <xsl:value-of select="$marginSide.before"/><xsl:value-of select="$pr.listInd.left div 20"/>pt;
  3804. </xsl:when>
  3805. <xsl:when test="not($pr.listInd.leftChars = '' and $pr.listInd.hangingChars='')">
  3806. <xsl:value-of select="$marginSide.before"/>
  3807. <xsl:variable name="leftchars">
  3808. <xsl:choose>
  3809. <xsl:when test="$pr.listInd.leftChars=''">0</xsl:when>
  3810. <xsl:otherwise>
  3811. <xsl:value-of select="$pr.listInd.leftChars div 100 * 12"/>
  3812. </xsl:otherwise>
  3813. </xsl:choose>
  3814. </xsl:variable>
  3815. <xsl:variable name="hangingchars">
  3816. <xsl:choose>
  3817. <xsl:when test="$pr.listInd.hangingChars=''">0</xsl:when>
  3818. <xsl:otherwise>
  3819. <xsl:value-of select="$pr.listInd.hangingChars div 100 * 12"/>
  3820. </xsl:otherwise>
  3821. </xsl:choose>
  3822. </xsl:variable>
  3823. <xsl:value-of select="$leftchars + $hangingchars"/>
  3824. <xsl:text>pt;</xsl:text>
  3825. </xsl:when>
  3826. <xsl:when test="not($nInd.left = '')"> <!-- Modified by Parwati to handle negative indentation -->
  3827. <xsl:value-of select="$marginSide.before"/>
  3828. <xsl:choose>
  3829. <xsl:when test="$nInd.left &lt; 0">
  3830. 0pt;
  3831. </xsl:when>
  3832. <xsl:otherwise>
  3833. <xsl:value-of select="$nInd.left div 20"/>pt;
  3834. </xsl:otherwise>
  3835. </xsl:choose>
  3836. </xsl:when>
  3837. <xsl:when test="not($nInd.leftChars = '' and $nInd.hangingChars='')">
  3838. <xsl:value-of select="$marginSide.before"/>
  3839. <xsl:variable name="leftchars">
  3840. <xsl:choose>
  3841. <xsl:when test="$nInd.leftChars=''">0</xsl:when>
  3842. <xsl:otherwise>
  3843. <xsl:value-of select="$nInd.leftChars div 100"/>
  3844. </xsl:otherwise>
  3845. </xsl:choose>
  3846. </xsl:variable>
  3847. <xsl:variable name="hangingchars">
  3848. <xsl:choose>
  3849. <xsl:when test="$nInd.hangingChars=''">0</xsl:when>
  3850. <xsl:otherwise>
  3851. <xsl:value-of select="$nInd.hangingChars div 100"/>
  3852. </xsl:otherwise>
  3853. </xsl:choose>
  3854. </xsl:variable>
  3855. <xsl:value-of select="$leftchars + $hangingchars"/>
  3856. <xsl:text>em;</xsl:text>
  3857. </xsl:when>
  3858. </xsl:choose>
  3859. <xsl:choose>
  3860. <xsl:when test="not($nInd.right = '')">
  3861. <xsl:value-of select="$marginSide.after"/><xsl:value-of select="$nInd.right div 20"/>pt;
  3862. </xsl:when>
  3863. <xsl:when test="not($nInd.rightChars = '')">
  3864. <xsl:value-of select="$marginSide.after"/><xsl:value-of select="$nInd.rightChars div 100"/>em;
  3865. </xsl:when>
  3866. </xsl:choose>
  3867. <!-- TEXT INDENTATION FOR TABLE MODIFIED BY PRASAHANTH-->
  3868. <xsl:choose>
  3869. <xsl:when test="not($nInd.hanging='')">
  3870. <xsl:if test="not(../../w:tc)">
  3871. text-indent:<xsl:value-of select="$nInd.hanging div 20"/>pt; <!-- - sign before 20 removed by Parwati -->
  3872. </xsl:if>
  3873. </xsl:when>
  3874. <!-- TEXT INDENTATION FOR TABLE MODIFIED BY PRASAHANTH-->
  3875. <xsl:when test="not($nInd.hangingChars='')">
  3876. text-indent:<xsl:value-of select="$nInd.hangingChars div -100"/>em;
  3877. </xsl:when>
  3878. <xsl:when test="not($nInd.firstLine='')">
  3879. text-indent:<xsl:value-of select="$nInd.firstLine div 20"/>pt;
  3880. </xsl:when>
  3881. <xsl:when test="not($nInd.firstLineChars='')">
  3882. text-indent:<xsl:value-of select="$nInd.firstLineChars div 100"/>em;
  3883. </xsl:when>
  3884. <xsl:when test="not($pr.listInd.hanging='')">
  3885. text-indent:<xsl:value-of select="$pr.listInd.hanging div -20"/>pt;
  3886. </xsl:when>
  3887. <xsl:when test="not($pr.listInd.hangingChars='')">
  3888. text-indent:<xsl:value-of select="$pr.listInd.hangingChars div -100 * 12"/>pt;
  3889. </xsl:when>
  3890. </xsl:choose>
  3891. </xsl:if>
  3892. <xsl:variable name="fTextAutospaceO" select="substring($prsP,$iTextAutospaceO,1)"/>
  3893. <xsl:variable name="fTextAutospaceN" select="substring($prsP,$iTextAutospaceN,1)"/>
  3894. <xsl:choose>
  3895. <xsl:when test="not($fTextAutospaceN = $off) and $fTextAutospaceO = $off">text-autospace:ideograph-numeric;</xsl:when>
  3896. <xsl:when test="not($fTextAutospaceO = $off) and $fTextAutospaceN = $off">text-autospace:ideograph-other;</xsl:when>
  3897. <xsl:when test="$fTextAutospaceO = $off and $fTextAutospaceN = $off">text-autospace:none;</xsl:when>
  3898. </xsl:choose>
  3899. </xsl:template>
  3900. <xsl:template name="ApplyPPr.many">
  3901. <xsl:param name="cxtSpacing" select="$cxtSpacing_all"/>
  3902. <xsl:variable name="spacing" select="w:pPr[1]/w:spacing[1]"/>
  3903. <xsl:choose>
  3904. <xsl:when test="($spacing/@w:before-autospacing and not($spacing/@w:before-autospacing = 'off')) or $cxtSpacing = $cxtSpacing_none or $cxtSpacing = $cxtSpacing_bottom">
  3905. </xsl:when>
  3906. <xsl:when test="$spacing/@w:before">
  3907. margin-top:<xsl:value-of select="$spacing/@w:before div 20"/>pt;
  3908. </xsl:when>
  3909. <xsl:when test="$spacing/@w:before-lines">
  3910. margin-top:<xsl:value-of select="$spacing/@w:before-lines *.12"/>pt;
  3911. </xsl:when>
  3912. </xsl:choose>
  3913. <xsl:choose>
  3914. <xsl:when test="($spacing/@w:after-autospacing and not($spacing/@w:after-autospacing = 'off')) or $cxtSpacing = $cxtSpacing_none or $cxtSpacing = $cxtSpacing_top">
  3915. </xsl:when>
  3916. <xsl:when test="$spacing/@w:after">
  3917. margin-bottom:<xsl:value-of select="$spacing/@w:after div 20"/>pt;
  3918. </xsl:when>
  3919. <xsl:when test="$spacing/@w:after-lines">
  3920. margin-bottom:<xsl:value-of select="$spacing/@w:after-lines *.12"/>pt;
  3921. </xsl:when>
  3922. </xsl:choose>
  3923. <xsl:for-each select="w:pPr[1]">
  3924. <xsl:for-each select="w:snapToGrid[1]">
  3925. <xsl:choose>
  3926. <xsl:when test="@w:val = 'off'">layout-grid-mode:char;</xsl:when>
  3927. <xsl:otherwise>layout-grid-mode:both;</xsl:otherwise>
  3928. </xsl:choose>
  3929. </xsl:for-each>
  3930. <xsl:for-each select="w:keepNext[1]">
  3931. <xsl:choose>
  3932. <xsl:when test="@w:val = 'off'">page-break-after:auto;</xsl:when>
  3933. <xsl:otherwise>page-break-after:avoid;</xsl:otherwise>
  3934. </xsl:choose>
  3935. </xsl:for-each>
  3936. <xsl:for-each select="w:pageBreakBefore[1]">
  3937. <xsl:choose>
  3938. <xsl:when test="@w:val = 'off'">page-break-before:auto;</xsl:when>
  3939. <xsl:otherwise>page-break-before:always;</xsl:otherwise>
  3940. </xsl:choose>
  3941. </xsl:for-each>
  3942. </xsl:for-each>
  3943. </xsl:template>
  3944. <xsl:template name="RecursiveApplyPPr.class">
  3945. <xsl:if test="w:basedOn">
  3946. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  3947. <xsl:variable name="sParaStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  3948. <xsl:for-each select="$sParaStyleBase">
  3949. <xsl:call-template name="RecursiveApplyPPr.class" />
  3950. </xsl:for-each>
  3951. </xsl:if>
  3952. <xsl:call-template name="ApplyPPr.class"/>
  3953. </xsl:template>
  3954. <xsl:template name="ApplyPPr.class">
  3955. <xsl:apply-templates select="w:pPr[1]/*" mode="ppr"/>
  3956. </xsl:template>
  3957. <xsl:template match="w:shd" mode="ppr">
  3958. <xsl:call-template name="ApplyShd"/>
  3959. </xsl:template>
  3960. <xsl:template match="WX:shd" mode="ppr">
  3961. <xsl:call-template name="ApplyShdHint"/>
  3962. </xsl:template>
  3963. <xsl:template match="w:textDirection" mode="ppr">
  3964. <xsl:call-template name="ApplyTextDirection"/>
  3965. </xsl:template>
  3966. <!-- ID 1 Fix linespacing issue - div from 20 to 10-->
  3967. <xsl:template match="w:spacing[@w:lineRule or @w:line]" mode="ppr">
  3968. <xsl:choose>
  3969. <xsl:when test="not(@w:lineRule) or @w:lineRule = 'exact'or @w:lineRule = 'auto'">
  3970. line-height:<xsl:value-of select="@w:line div 10"/>pt;
  3971. </xsl:when>
  3972. </xsl:choose>
  3973. </xsl:template>
  3974. <xsl:template match="w:topLinePunct" mode="ppr">
  3975. <xsl:choose>
  3976. <xsl:when test="@w:val = 'off'">punctuation-trim:none;</xsl:when>
  3977. <xsl:otherwise>punctuation-trim:leading;</xsl:otherwise>
  3978. </xsl:choose>
  3979. </xsl:template>
  3980. <xsl:template match="w:overflowPunct" mode="ppr">
  3981. <xsl:choose>
  3982. <xsl:when test="@w:val = 'off'">punctuation-wrap:simple;</xsl:when>
  3983. <xsl:otherwise>punctuation-wrap:hanging;</xsl:otherwise>
  3984. </xsl:choose>
  3985. </xsl:template>
  3986. <xsl:template match="w:jc" mode="ppr">
  3987. <xsl:choose>
  3988. <xsl:when test="@w:val = 'left'">text-align:left;</xsl:when>
  3989. <xsl:when test="@w:val = 'center'">text-align:center;</xsl:when>
  3990. <xsl:when test="@w:val = 'right'">text-align:right;</xsl:when>
  3991. <xsl:when test="@w:val = 'both'">text-align:justify;text-justify:inter-ideograph;</xsl:when>
  3992. <xsl:when test="@w:val = 'distribute'">text-align:justify;text-justify:distribute-all-lines;</xsl:when>
  3993. <xsl:when test="@w:val = 'low-kashida'">text-align:justify;text-justify:kashida;text-kashida:0%;</xsl:when>
  3994. <xsl:when test="@w:val = 'medium-kashida'">text-align:justify;text-justify:kashida;text-kashida:10%;</xsl:when>
  3995. <xsl:when test="@w:val = 'high-kashida'">text-align:justify;text-justify:kashida;text-kashida:20%;</xsl:when>
  3996. <xsl:when test="@w:val = 'thai-distribute'">text-align:justify;text-justify:inter-cluster;</xsl:when>
  3997. </xsl:choose>
  3998. </xsl:template>
  3999. <xsl:template match="w:textAlignment" mode="ppr">
  4000. <xsl:choose>
  4001. <xsl:when test="@w:val = 'top'">vertical-align:top;</xsl:when>
  4002. <xsl:when test="@w:val = 'center'">vertical-align:middle;</xsl:when>
  4003. <xsl:when test="@w:val = 'baseline'">vertical-align:baseline;</xsl:when>
  4004. <xsl:when test="@w:val = 'bottom'">vertical-align:bottom;</xsl:when>
  4005. <xsl:when test="@w:val = 'auto'">vertical-align:baseline;</xsl:when>
  4006. </xsl:choose>
  4007. </xsl:template>
  4008. <xsl:template match="w:wordWrap" mode="ppr">
  4009. <xsl:choose>
  4010. <xsl:when test="@w:val = 'off'">word-break:break-all;</xsl:when>
  4011. <xsl:otherwise>word-break:normal;</xsl:otherwise>
  4012. </xsl:choose>
  4013. </xsl:template>
  4014. <xsl:template match="*" mode="ppr"/>
  4015. <xsl:template name="DisplayPContent">
  4016. <xsl:param name="b.bidi"/>
  4017. <xsl:param name="prsR"/>
  4018. <xsl:param name="runStyleName"/>
  4019. <xsl:call-template name="DisplayRBorder">
  4020. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  4021. <xsl:with-param name="prsR" select="$prsR"/>
  4022. <xsl:with-param name="runStyleName" select="$runStyleName"/>
  4023. </xsl:call-template>
  4024. <xsl:if test="count(*[not(name()='w:pPr')])=0">
  4025. <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
  4026. </xsl:if>
  4027. </xsl:template>
  4028. <xsl:template name="GetPStyleId">
  4029. <xsl:choose>
  4030. <xsl:when test="w:pPr/w:pStyle/@w:val">
  4031. <xsl:value-of select="w:pPr/w:pStyle/@w:val"/>
  4032. </xsl:when>
  4033. <xsl:otherwise>
  4034. <xsl:value-of select="$paraStyleID_Default"/>
  4035. </xsl:otherwise>
  4036. </xsl:choose>
  4037. </xsl:template>
  4038. <xsl:template name="RecursiveApplyPPr.many">
  4039. <xsl:if test="w:basedOn">
  4040. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  4041. <xsl:variable name="sParaStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  4042. <xsl:for-each select="$sParaStyleBase">
  4043. <xsl:call-template name="RecursiveApplyPPr.many" />
  4044. </xsl:for-each>
  4045. </xsl:if>
  4046. <xsl:call-template name="ApplyPPr.many"/>
  4047. </xsl:template>
  4048. <xsl:template match="w:p">
  4049. <xsl:param name="bdrBetween" select="''"/>
  4050. <xsl:param name="prsPAccum" select="''"/>
  4051. <xsl:param name="prsP" select="$prsPDefault"/>
  4052. <xsl:param name="prsR" select="$prsRDefault"/>
  4053. <xsl:if test="not(w:pPr/w:pStyle/@w:val='z-TopofForm') and not(w:pPr/w:pStyle/@w:val='z-BottomofForm')">
  4054. <p>
  4055. <xsl:variable name="pStyleId">
  4056. <xsl:call-template name="GetPStyleId"/>
  4057. </xsl:variable>
  4058. <xsl:attribute name="class">
  4059. <xsl:value-of select="$pStyleId"/>
  4060. <xsl:value-of select="$paraStyleSuffix"/>
  4061. </xsl:attribute>
  4062. <xsl:variable name="sParaStyleName" select="($nsStyles[@w:styleId=$pStyleId])[1]"/>
  4063. <xsl:variable name="b.bidi">
  4064. <xsl:choose>
  4065. <xsl:when test="w:pPr[1]/w:rPr[1]/w:rtl[1]">
  4066. <xsl:value-of select="$on"/>
  4067. </xsl:when>
  4068. <xsl:otherwise>
  4069. <xsl:value-of select="$off"/>
  4070. </xsl:otherwise>
  4071. </xsl:choose>
  4072. </xsl:variable>
  4073. <xsl:variable name="prsR.updated">
  4074. <xsl:call-template name="PrsUpdateRPr">
  4075. <xsl:with-param name="ndPrContainer" select="$sParaStyleName"/>
  4076. <xsl:with-param name="prsR" select="$prsR"/>
  4077. </xsl:call-template>
  4078. </xsl:variable>
  4079. <xsl:variable name="prsP.updated1">
  4080. <xsl:call-template name="PrsUpdatePPr">
  4081. <xsl:with-param name="ndPrContainer" select="$sParaStyleName"/>
  4082. <xsl:with-param name="prsP" select="$prsP"/>
  4083. </xsl:call-template>
  4084. </xsl:variable>
  4085. <xsl:variable name="prsP.updated">
  4086. <xsl:call-template name="PrsUpdatePPr">
  4087. <xsl:with-param name="prsP" select="$prsP.updated1"/>
  4088. </xsl:call-template>
  4089. </xsl:variable>
  4090. <xsl:variable name="styleMod">
  4091. <xsl:value-of select="$prsPAccum"/>
  4092. <xsl:for-each select="$sParaStyleName">
  4093. <xsl:call-template name="RecursiveApplyPPr.many"/>
  4094. </xsl:for-each>
  4095. <xsl:call-template name="ApplyPPr.many">
  4096. <xsl:with-param name="cxtSpacing">
  4097. <xsl:variable name="cspacing" select="$sParaStyleName/w:pPr[1]/w:contextualSpacing[1]"/>
  4098. <xsl:if test="$cspacing and not($cspacing/@w:val = 'off')">
  4099. <xsl:if test="following-sibling::*[1]/w:pPr[1]/w:pStyle[1]/@w:val = $pStyleId">
  4100. <xsl:value-of select="$cxtSpacing_top"/>
  4101. </xsl:if>
  4102. <xsl:if test="preceding-sibling::*[1]/w:pPr[1]/w:pStyle[1]/@w:val = $pStyleId">
  4103. <xsl:value-of select="$cxtSpacing_bottom"/>
  4104. </xsl:if>
  4105. </xsl:if>
  4106. </xsl:with-param>
  4107. </xsl:call-template>
  4108. <xsl:call-template name="ApplyPPr.class"/>
  4109. <xsl:call-template name="ApplyPPr.once">
  4110. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  4111. <xsl:with-param name="prsP" select="$prsP.updated"/>
  4112. <xsl:with-param name="i.bdrRange.this" select="position()"/>
  4113. <xsl:with-param name="i.bdrRange.last" select="last()"/>
  4114. <xsl:with-param name="pr.bdrBetween" select="$bdrBetween"/>
  4115. </xsl:call-template>
  4116. </xsl:variable>
  4117. <xsl:if test="not($styleMod='')">
  4118. <xsl:attribute name="style">
  4119. <xsl:value-of select="$styleMod"/>
  4120. </xsl:attribute>
  4121. </xsl:if>
  4122. <span>
  4123. <xsl:attribute name="class">
  4124. <xsl:value-of select="$pStyleId"/>
  4125. <xsl:value-of select="$charStyleSuffix"/>
  4126. </xsl:attribute>
  4127. <xsl:call-template name="DisplayPContent">
  4128. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  4129. <xsl:with-param name="prsR" select="$prsR.updated"/>
  4130. <xsl:with-param name="runStyleName">
  4131. <xsl:value-of select="$pStyleId"/>
  4132. <xsl:value-of select="$charStyleSuffix"/>
  4133. </xsl:with-param>
  4134. </xsl:call-template>
  4135. </span>
  4136. </p>
  4137. <!-- <xsl:if test="./w:r/w:lastRenderedPageBreak/@ColumnEnd"> Added by Parwati to handle columns
  4138. <xsl:variable name="columnNo">
  4139. <xsl:value-of select="./w:r/w:lastRenderedPageBreak/@colNum"/>
  4140. </xsl:variable>
  4141. <xsl:call-template name="ColumnAddition">
  4142. <xsl:with-param name="totalColumns" select="$columnNo"></xsl:with-param>
  4143. </xsl:call-template>
  4144. </xsl:if> End -->
  4145. <!--By Sunil svg shapes positioning-->
  4146. <xsl:if test="./w:r/div/svg">
  4147. <!--<br/>
  4148. <br/>-->
  4149. </xsl:if>
  4150. </xsl:if>
  4151. </xsl:template>
  4152. <xsl:template match="w:sdt/w:sdtContent/w:tc/w:p | w:sdt/w:sdtContent/w:p">
  4153. <p>
  4154. <xsl:attribute name="class">
  4155. <xsl:value-of select="./w:pPr/w:pStyle/@w:val"/>
  4156. <xsl:value-of select="$charStyleSuffix"/>
  4157. </xsl:attribute>
  4158. <xsl:attribute name="style">
  4159. text-align:<xsl:value-of select="./w:pPr/w:jc/@w:val"/>
  4160. </xsl:attribute>
  4161. <span>
  4162. <xsl:apply-templates/>
  4163. </span>
  4164. </p>
  4165. </xsl:template>
  4166. <xsl:template name="DisplayBodyContent">
  4167. <xsl:param name="ns.content" select="descendant::*[(parent::WX:sect or parent::WX:sub-section) and not(name()='WX:sub-section')]"/>
  4168. <xsl:param name="prsPAccum" select="''"/>
  4169. <xsl:param name="prsP" select="$prsPDefault"/>
  4170. <xsl:param name="prsR" select="$prsRDefault"/>
  4171. <xsl:apply-templates>
  4172. <xsl:with-param name="ns.content" select="$ns.content"/>
  4173. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  4174. <xsl:with-param name="prsP" select="$prsP"/>
  4175. <xsl:with-param name="prsR" select="$prsR"/>
  4176. </xsl:apply-templates>
  4177. <xsl:if test="count($ns.content)=0">
  4178. <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
  4179. </xsl:if>
  4180. </xsl:template>
  4181. <xsl:template name="RecursiveApplyTcPr.class">
  4182. <xsl:if test="w:basedOn">
  4183. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  4184. <xsl:variable name="sTblStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  4185. <xsl:for-each select="$sTblStyleBase">
  4186. <xsl:call-template name="RecursiveApplyTcPr.class" />
  4187. </xsl:for-each>
  4188. </xsl:if>
  4189. <xsl:call-template name="ApplyTcPr.class"/>
  4190. </xsl:template>
  4191. <xsl:template name="ApplyTcPr.class">
  4192. <xsl:apply-templates select="w:tcPr[1]/*" mode="tcpr"/>
  4193. </xsl:template>
  4194. <xsl:template match="w:shd" mode="tcpr">
  4195. <xsl:call-template name="ApplyShd"/>
  4196. </xsl:template>
  4197. <xsl:template match="w:textDirection" mode="tcpr">
  4198. <xsl:call-template name="ApplyTextDirection"/>
  4199. </xsl:template>
  4200. <xsl:template match="w:tcFitText" mode="tcpr">
  4201. <xsl:if test="not(@w:val = 'off')">text-fit:100%;</xsl:if>
  4202. </xsl:template>
  4203. <xsl:template match="w:vAlign" mode="tcpr">
  4204. <xsl:choose>
  4205. <xsl:when test="@w:val = 'center'">vertical-align:middle;</xsl:when>
  4206. <xsl:when test="@w:val = 'bottom'">vertical-align:bottom;</xsl:when>
  4207. </xsl:choose>
  4208. </xsl:template>
  4209. <xsl:template match="w:noWrap" mode="tcpr">
  4210. <xsl:choose>
  4211. <xsl:when test="@w:val = 'off'">white-space:normal;</xsl:when>
  4212. <xsl:otherwise>white-space:nowrap;</xsl:otherwise>
  4213. </xsl:choose>
  4214. </xsl:template>
  4215. <xsl:template match="w:tcW" mode="tcpr">
  4216. width:<xsl:call-template name="EvalTableWidth"/>;
  4217. </xsl:template>
  4218. <xsl:template match="*" mode="tcpr"/>
  4219. <xsl:template name="ApplyExtraCornerBorders">
  4220. <xsl:param name="cnfType" />
  4221. <xsl:param name="sTblStyleName" />
  4222. <xsl:choose>
  4223. <xsl:when test="$cnfType=$cnfNWCell">
  4224. <xsl:call-template name="ApplyExtraCornerBordersNW">
  4225. <xsl:with-param name="sTblStyle" select="$sTblStyleName" />
  4226. </xsl:call-template>
  4227. </xsl:when>
  4228. <xsl:when test="$cnfType=$cnfNECell">
  4229. <xsl:call-template name="ApplyExtraCornerBordersNE">
  4230. <xsl:with-param name="sTblStyle" select="$sTblStyleName" />
  4231. </xsl:call-template>
  4232. </xsl:when>
  4233. <xsl:when test="$cnfType=$cnfSECell">
  4234. <xsl:call-template name="ApplyExtraCornerBordersSE">
  4235. <xsl:with-param name="sTblStyle" select="$sTblStyleName" />
  4236. </xsl:call-template>
  4237. </xsl:when>
  4238. <xsl:when test="$cnfType=$cnfSWCell">
  4239. <xsl:call-template name="ApplyExtraCornerBordersSW">
  4240. <xsl:with-param name="sTblStyle" select="$sTblStyleName" />
  4241. </xsl:call-template>
  4242. </xsl:when>
  4243. </xsl:choose>
  4244. </xsl:template>
  4245. <xsl:template name="ApplyExtraCornerBordersNW">
  4246. <xsl:param name="sTblStyle" />
  4247. <xsl:variable name="firstColBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfFirstCol][1]/w:tcPr[1]/w:tcBorders[1]" />
  4248. <xsl:variable name="firstRowBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfFirstRow][1]/w:tcPr[1]/w:tcBorders[1]" />
  4249. <xsl:call-template name="ApplyBorderPr">
  4250. <xsl:with-param name="pr.bdr">
  4251. <xsl:for-each select="$firstRowBorders/w:top[1]">
  4252. <xsl:call-template name="GetBorderPr" />
  4253. </xsl:for-each>
  4254. </xsl:with-param>
  4255. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4256. </xsl:call-template>
  4257. <xsl:call-template name="ApplyBorderPr">
  4258. <xsl:with-param name="pr.bdr">
  4259. <xsl:for-each select="$firstColBorders/w:top[1]">
  4260. <xsl:call-template name="GetBorderPr" />
  4261. </xsl:for-each>
  4262. </xsl:with-param>
  4263. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4264. </xsl:call-template>
  4265. <xsl:call-template name="ApplyBorderPr">
  4266. <xsl:with-param name="pr.bdr">
  4267. <xsl:for-each select="$firstRowBorders/w:left[1]">
  4268. <xsl:call-template name="GetBorderPr" />
  4269. </xsl:for-each>
  4270. </xsl:with-param>
  4271. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4272. </xsl:call-template>
  4273. <xsl:call-template name="ApplyBorderPr">
  4274. <xsl:with-param name="pr.bdr">
  4275. <xsl:for-each select="$firstColBorders/w:left[1]">
  4276. <xsl:call-template name="GetBorderPr" />
  4277. </xsl:for-each>
  4278. </xsl:with-param>
  4279. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4280. </xsl:call-template>
  4281. <xsl:call-template name="ApplyBorderPr">
  4282. <xsl:with-param name="pr.bdr">
  4283. <xsl:for-each select="$firstRowBorders/w:right[1]">
  4284. <xsl:call-template name="GetBorderPr" />
  4285. </xsl:for-each>
  4286. </xsl:with-param>
  4287. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4288. </xsl:call-template>
  4289. <xsl:call-template name="ApplyBorderPr">
  4290. <xsl:with-param name="pr.bdr">
  4291. <xsl:for-each select="$firstColBorders/w:right[1]">
  4292. <xsl:call-template name="GetBorderPr" />
  4293. </xsl:for-each>
  4294. </xsl:with-param>
  4295. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4296. </xsl:call-template>
  4297. <xsl:call-template name="ApplyBorderPr">
  4298. <xsl:with-param name="pr.bdr">
  4299. <xsl:for-each select="$firstRowBorders/w:bottom[1]">
  4300. <xsl:call-template name="GetBorderPr" />
  4301. </xsl:for-each>
  4302. </xsl:with-param>
  4303. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4304. </xsl:call-template>
  4305. <xsl:call-template name="ApplyBorderPr">
  4306. <xsl:with-param name="pr.bdr">
  4307. <xsl:for-each select="$firstColBorders/w:bottom[1]">
  4308. <xsl:call-template name="GetBorderPr" />
  4309. </xsl:for-each>
  4310. </xsl:with-param>
  4311. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4312. </xsl:call-template>
  4313. </xsl:template>
  4314. <xsl:template name="ApplyExtraCornerBordersNE">
  4315. <xsl:param name="sTblStyle" />
  4316. <xsl:variable name="lastColBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfLastCol][1]/w:tcPr[1]/w:tcBorders[1]" />
  4317. <xsl:variable name="firstRowBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfFirstRow][1]/w:tcPr[1]/w:tcBorders[1]" />
  4318. <xsl:call-template name="ApplyBorderPr">
  4319. <xsl:with-param name="pr.bdr">
  4320. <xsl:for-each select="$firstRowBorders/w:top[1]">
  4321. <xsl:call-template name="GetBorderPr" />
  4322. </xsl:for-each>
  4323. </xsl:with-param>
  4324. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4325. </xsl:call-template>
  4326. <xsl:call-template name="ApplyBorderPr">
  4327. <xsl:with-param name="pr.bdr">
  4328. <xsl:for-each select="$lastColBorders/w:top[1]">
  4329. <xsl:call-template name="GetBorderPr" />
  4330. </xsl:for-each>
  4331. </xsl:with-param>
  4332. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4333. </xsl:call-template>
  4334. <xsl:call-template name="ApplyBorderPr">
  4335. <xsl:with-param name="pr.bdr">
  4336. <xsl:for-each select="$firstRowBorders/w:left[1]">
  4337. <xsl:call-template name="GetBorderPr" />
  4338. </xsl:for-each>
  4339. </xsl:with-param>
  4340. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4341. </xsl:call-template>
  4342. <xsl:call-template name="ApplyBorderPr">
  4343. <xsl:with-param name="pr.bdr">
  4344. <xsl:for-each select="$lastColBorders/w:left[1]">
  4345. <xsl:call-template name="GetBorderPr" />
  4346. </xsl:for-each>
  4347. </xsl:with-param>
  4348. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4349. </xsl:call-template>
  4350. <xsl:call-template name="ApplyBorderPr">
  4351. <xsl:with-param name="pr.bdr">
  4352. <xsl:for-each select="$firstRowBorders/w:right[1]">
  4353. <xsl:call-template name="GetBorderPr" />
  4354. </xsl:for-each>
  4355. </xsl:with-param>
  4356. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4357. </xsl:call-template>
  4358. <xsl:call-template name="ApplyBorderPr">
  4359. <xsl:with-param name="pr.bdr">
  4360. <xsl:for-each select="$lastColBorders/w:right[1]">
  4361. <xsl:call-template name="GetBorderPr" />
  4362. </xsl:for-each>
  4363. </xsl:with-param>
  4364. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4365. </xsl:call-template>
  4366. <xsl:call-template name="ApplyBorderPr">
  4367. <xsl:with-param name="pr.bdr">
  4368. <xsl:for-each select="$firstRowBorders/w:bottom[1]">
  4369. <xsl:call-template name="GetBorderPr" />
  4370. </xsl:for-each>
  4371. </xsl:with-param>
  4372. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4373. </xsl:call-template>
  4374. <xsl:call-template name="ApplyBorderPr">
  4375. <xsl:with-param name="pr.bdr">
  4376. <xsl:for-each select="$lastColBorders/w:bottom[1]">
  4377. <xsl:call-template name="GetBorderPr" />
  4378. </xsl:for-each>
  4379. </xsl:with-param>
  4380. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4381. </xsl:call-template>
  4382. </xsl:template>
  4383. <xsl:template name="ApplyExtraCornerBordersSE">
  4384. <xsl:param name="sTblStyle" />
  4385. <xsl:variable name="lastColBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfLastCol][1]/w:tcPr[1]/w:tcBorders[1]" />
  4386. <xsl:variable name="lastRowBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfLastRow][1]/w:tcPr[1]/w:tcBorders[1]" />
  4387. <xsl:call-template name="ApplyBorderPr">
  4388. <xsl:with-param name="pr.bdr">
  4389. <xsl:for-each select="$lastRowBorders/w:top[1]">
  4390. <xsl:call-template name="GetBorderPr" />
  4391. </xsl:for-each>
  4392. </xsl:with-param>
  4393. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4394. </xsl:call-template>
  4395. <xsl:call-template name="ApplyBorderPr">
  4396. <xsl:with-param name="pr.bdr">
  4397. <xsl:for-each select="$lastColBorders/w:top[1]">
  4398. <xsl:call-template name="GetBorderPr" />
  4399. </xsl:for-each>
  4400. </xsl:with-param>
  4401. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4402. </xsl:call-template>
  4403. <xsl:call-template name="ApplyBorderPr">
  4404. <xsl:with-param name="pr.bdr">
  4405. <xsl:for-each select="$lastRowBorders/w:left[1]">
  4406. <xsl:call-template name="GetBorderPr" />
  4407. </xsl:for-each>
  4408. </xsl:with-param>
  4409. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4410. </xsl:call-template>
  4411. <xsl:call-template name="ApplyBorderPr">
  4412. <xsl:with-param name="pr.bdr">
  4413. <xsl:for-each select="$lastColBorders/w:left[1]">
  4414. <xsl:call-template name="GetBorderPr" />
  4415. </xsl:for-each>
  4416. </xsl:with-param>
  4417. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4418. </xsl:call-template>
  4419. <xsl:call-template name="ApplyBorderPr">
  4420. <xsl:with-param name="pr.bdr">
  4421. <xsl:for-each select="$lastRowBorders/w:right[1]">
  4422. <xsl:call-template name="GetBorderPr" />
  4423. </xsl:for-each>
  4424. </xsl:with-param>
  4425. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4426. </xsl:call-template>
  4427. <xsl:call-template name="ApplyBorderPr">
  4428. <xsl:with-param name="pr.bdr">
  4429. <xsl:for-each select="$lastColBorders/w:right[1]">
  4430. <xsl:call-template name="GetBorderPr" />
  4431. </xsl:for-each>
  4432. </xsl:with-param>
  4433. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4434. </xsl:call-template>
  4435. <xsl:call-template name="ApplyBorderPr">
  4436. <xsl:with-param name="pr.bdr">
  4437. <xsl:for-each select="$lastColBorders/w:bottom[1]">
  4438. <xsl:call-template name="GetBorderPr" />
  4439. </xsl:for-each>
  4440. </xsl:with-param>
  4441. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4442. </xsl:call-template>
  4443. <xsl:call-template name="ApplyBorderPr">
  4444. <xsl:with-param name="pr.bdr">
  4445. <xsl:for-each select="$lastRowBorders/w:bottom[1]">
  4446. <xsl:call-template name="GetBorderPr" />
  4447. </xsl:for-each>
  4448. </xsl:with-param>
  4449. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4450. </xsl:call-template>
  4451. </xsl:template>
  4452. <xsl:template name="ApplyExtraCornerBordersSW">
  4453. <xsl:param name="sTblStyle" />
  4454. <xsl:variable name="firstColBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfFirstCol][1]/w:tcPr[1]/w:tcBorders[1]" />
  4455. <xsl:variable name="lastRowBorders" select="$sTblStyle/w:tblStylePr[@w:type=$cnfLastRow][1]/w:tcPr[1]/w:tcBorders[1]" />
  4456. <xsl:call-template name="ApplyBorderPr">
  4457. <xsl:with-param name="pr.bdr">
  4458. <xsl:for-each select="$lastRowBorders/w:top[1]">
  4459. <xsl:call-template name="GetBorderPr" />
  4460. </xsl:for-each>
  4461. </xsl:with-param>
  4462. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4463. </xsl:call-template>
  4464. <xsl:call-template name="ApplyBorderPr">
  4465. <xsl:with-param name="pr.bdr">
  4466. <xsl:for-each select="$firstColBorders/w:top[1]">
  4467. <xsl:call-template name="GetBorderPr" />
  4468. </xsl:for-each>
  4469. </xsl:with-param>
  4470. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4471. </xsl:call-template>
  4472. <xsl:call-template name="ApplyBorderPr">
  4473. <xsl:with-param name="pr.bdr">
  4474. <xsl:for-each select="$lastRowBorders/w:left[1]">
  4475. <xsl:call-template name="GetBorderPr" />
  4476. </xsl:for-each>
  4477. </xsl:with-param>
  4478. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4479. </xsl:call-template>
  4480. <xsl:call-template name="ApplyBorderPr">
  4481. <xsl:with-param name="pr.bdr">
  4482. <xsl:for-each select="$firstColBorders/w:left[1]">
  4483. <xsl:call-template name="GetBorderPr" />
  4484. </xsl:for-each>
  4485. </xsl:with-param>
  4486. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  4487. </xsl:call-template>
  4488. <xsl:call-template name="ApplyBorderPr">
  4489. <xsl:with-param name="pr.bdr">
  4490. <xsl:for-each select="$lastRowBorders/w:right[1]">
  4491. <xsl:call-template name="GetBorderPr" />
  4492. </xsl:for-each>
  4493. </xsl:with-param>
  4494. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4495. </xsl:call-template>
  4496. <xsl:call-template name="ApplyBorderPr">
  4497. <xsl:with-param name="pr.bdr">
  4498. <xsl:for-each select="$firstColBorders/w:right[1]">
  4499. <xsl:call-template name="GetBorderPr" />
  4500. </xsl:for-each>
  4501. </xsl:with-param>
  4502. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  4503. </xsl:call-template>
  4504. <xsl:call-template name="ApplyBorderPr">
  4505. <xsl:with-param name="pr.bdr">
  4506. <xsl:for-each select="$lastRowBorders/w:bottom[1]">
  4507. <xsl:call-template name="GetBorderPr" />
  4508. </xsl:for-each>
  4509. </xsl:with-param>
  4510. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4511. </xsl:call-template>
  4512. <xsl:call-template name="ApplyBorderPr">
  4513. <xsl:with-param name="pr.bdr">
  4514. <xsl:for-each select="$firstColBorders/w:bottom[1]">
  4515. <xsl:call-template name="GetBorderPr" />
  4516. </xsl:for-each>
  4517. </xsl:with-param>
  4518. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4519. </xsl:call-template>
  4520. </xsl:template>
  4521. <xsl:template name="ApplyTcBordersFromCnf">
  4522. <xsl:param name="tcBorders" />
  4523. <xsl:param name="sTblStyleName" />
  4524. <xsl:param name="cnfType" />
  4525. <xsl:param name="thisRow"/>
  4526. <xsl:param name="lastRow"/>
  4527. <xsl:param name="bdr.top"/>
  4528. <xsl:param name="bdr.left"/>
  4529. <xsl:param name="bdr.bottom"/>
  4530. <xsl:param name="bdr.right"/>
  4531. <xsl:param name="bdrSide_right.bidi" />
  4532. <xsl:param name="bdrSide_left.bidi" />
  4533. <xsl:variable name="thisBdr.top">
  4534. <xsl:choose>
  4535. <xsl:when test="$tcBorders/w:top">
  4536. <xsl:for-each select="$tcBorders/w:top[1]">
  4537. <xsl:call-template name="GetBorderPr"/>
  4538. </xsl:for-each>
  4539. </xsl:when>
  4540. <xsl:when test="not($cnfType='')">
  4541. <xsl:choose>
  4542. <xsl:when test="$cnfType=$cnfBand1Vert or $cnfType=$cnfBand2Vert or $cnfType=$cnfFirstCol or $cnfType=$cnfLastCol">
  4543. <xsl:variable name="p.cnfFirstRow" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfFirstRow][1]"/>
  4544. <xsl:choose>
  4545. <xsl:when test="$p.cnfFirstRow and $thisRow=2">
  4546. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:top[1]">
  4547. <xsl:call-template name="GetBorderPr"/>
  4548. </xsl:for-each>
  4549. </xsl:when>
  4550. <xsl:when test="not($p.cnfFirstRow) and $thisRow=1">
  4551. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:top[1]">
  4552. <xsl:call-template name="GetBorderPr"/>
  4553. </xsl:for-each>
  4554. </xsl:when>
  4555. <xsl:otherwise>
  4556. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideH[1]">
  4557. <xsl:call-template name="GetBorderPr"/>
  4558. </xsl:for-each>
  4559. </xsl:otherwise>
  4560. </xsl:choose>
  4561. </xsl:when>
  4562. <xsl:otherwise>
  4563. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:top[1]">
  4564. <xsl:call-template name="GetBorderPr"/>
  4565. </xsl:for-each>
  4566. </xsl:otherwise>
  4567. </xsl:choose>
  4568. </xsl:when>
  4569. <xsl:otherwise>
  4570. <xsl:value-of select="$bdr.top"/>
  4571. </xsl:otherwise>
  4572. </xsl:choose>
  4573. </xsl:variable>
  4574. <xsl:variable name="thisBdr.bottom">
  4575. <xsl:choose>
  4576. <xsl:when test="$tcBorders/w:bottom">
  4577. <xsl:for-each select="$tcBorders/w:bottom[1]">
  4578. <xsl:call-template name="GetBorderPr"/>
  4579. </xsl:for-each>
  4580. </xsl:when>
  4581. <xsl:when test="not($cnfType='')">
  4582. <xsl:choose>
  4583. <xsl:when test="$cnfType=$cnfBand1Vert or $cnfType=$cnfBand2Vert or $cnfType=$cnfFirstCol or $cnfType=$cnfLastCol">
  4584. <xsl:variable name="p.cnfLastRow" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfLastRow][1]"/>
  4585. <xsl:choose>
  4586. <xsl:when test="$p.cnfLastRow and $thisRow=$lastRow - 1">
  4587. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1]">
  4588. <xsl:call-template name="GetBorderPr"/>
  4589. </xsl:for-each>
  4590. </xsl:when>
  4591. <xsl:when test="not($p.cnfLastRow) and $thisRow=$lastRow">
  4592. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1]">
  4593. <xsl:call-template name="GetBorderPr"/>
  4594. </xsl:for-each>
  4595. </xsl:when>
  4596. <xsl:otherwise>
  4597. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideH[1]">
  4598. <xsl:call-template name="GetBorderPr"/>
  4599. </xsl:for-each>
  4600. </xsl:otherwise>
  4601. </xsl:choose>
  4602. </xsl:when>
  4603. <xsl:otherwise>
  4604. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1]">
  4605. <xsl:call-template name="GetBorderPr"/>
  4606. </xsl:for-each>
  4607. </xsl:otherwise>
  4608. </xsl:choose>
  4609. </xsl:when>
  4610. <xsl:otherwise>
  4611. <xsl:value-of select="$bdr.bottom"/>
  4612. </xsl:otherwise>
  4613. </xsl:choose>
  4614. </xsl:variable>
  4615. <xsl:variable name="thisBdr.left">
  4616. <xsl:choose>
  4617. <xsl:when test="$tcBorders/w:left">
  4618. <xsl:for-each select="$tcBorders/w:left[1]">
  4619. <xsl:call-template name="GetBorderPr"/>
  4620. </xsl:for-each>
  4621. </xsl:when>
  4622. <xsl:when test="not($cnfType='')">
  4623. <xsl:choose>
  4624. <xsl:when test="$cnfType=$cnfBand1Horz or $cnfType=$cnfBand2Horz">
  4625. <xsl:variable name="p.cnfFirstCol" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfFirstCol][1]"/>
  4626. <xsl:choose>
  4627. <xsl:when test="$p.cnfFirstCol and position()=2">
  4628. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:left[1]">
  4629. <xsl:call-template name="GetBorderPr"/>
  4630. </xsl:for-each>
  4631. </xsl:when>
  4632. <xsl:when test="not($p.cnfFirstCol) and position()=1">
  4633. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:left[1]">
  4634. <xsl:call-template name="GetBorderPr"/>
  4635. </xsl:for-each>
  4636. </xsl:when>
  4637. <xsl:otherwise>
  4638. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideV[1]">
  4639. <xsl:call-template name="GetBorderPr"/>
  4640. </xsl:for-each>
  4641. </xsl:otherwise>
  4642. </xsl:choose>
  4643. </xsl:when>
  4644. <xsl:when test="$cnfType=$cnfFirstRow or $cnfType=$cnfLastRow">
  4645. <xsl:choose>
  4646. <xsl:when test="position()=1">
  4647. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:left[1]">
  4648. <xsl:call-template name="GetBorderPr"/>
  4649. </xsl:for-each>
  4650. </xsl:when>
  4651. <xsl:otherwise>
  4652. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideV[1]">
  4653. <xsl:call-template name="GetBorderPr"/>
  4654. </xsl:for-each>
  4655. </xsl:otherwise>
  4656. </xsl:choose>
  4657. </xsl:when>
  4658. <xsl:otherwise>
  4659. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:left[1]">
  4660. <xsl:call-template name="GetBorderPr"/>
  4661. </xsl:for-each>
  4662. </xsl:otherwise>
  4663. </xsl:choose>
  4664. </xsl:when>
  4665. <xsl:otherwise>
  4666. <xsl:value-of select="$bdr.left"/>
  4667. </xsl:otherwise>
  4668. </xsl:choose>
  4669. </xsl:variable>
  4670. <xsl:variable name="thisBdr.right">
  4671. <xsl:choose>
  4672. <xsl:when test="$tcBorders/w:right">
  4673. <xsl:for-each select="$tcBorders/w:right[1]">
  4674. <xsl:call-template name="GetBorderPr"/>
  4675. </xsl:for-each>
  4676. </xsl:when>
  4677. <xsl:when test="not($cnfType='')">
  4678. <xsl:choose>
  4679. <xsl:when test="$cnfType=$cnfBand1Horz or $cnfType=$cnfBand2Horz">
  4680. <xsl:variable name="p.cnfLastCol" select="$sTblStyleName/w:tblStylePr[@w:type=$cnfLastCol][1]"/>
  4681. <xsl:choose>
  4682. <xsl:when test="$p.cnfLastCol and position()=last() - 1">
  4683. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:right[1]">
  4684. <xsl:call-template name="GetBorderPr"/>
  4685. </xsl:for-each>
  4686. </xsl:when>
  4687. <xsl:when test="not($p.cnfLastCol) and position()=last()">
  4688. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:right[1]">
  4689. <xsl:call-template name="GetBorderPr"/>
  4690. </xsl:for-each>
  4691. </xsl:when>
  4692. <xsl:otherwise>
  4693. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideV[1]">
  4694. <xsl:call-template name="GetBorderPr"/>
  4695. </xsl:for-each>
  4696. </xsl:otherwise>
  4697. </xsl:choose>
  4698. </xsl:when>
  4699. <xsl:when test="$cnfType=$cnfFirstRow or $cnfType=$cnfLastRow">
  4700. <xsl:choose>
  4701. <xsl:when test="position()=last()">
  4702. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:right[1]">
  4703. <xsl:call-template name="GetBorderPr"/>
  4704. </xsl:for-each>
  4705. </xsl:when>
  4706. <xsl:otherwise>
  4707. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:insideV[1]">
  4708. <xsl:call-template name="GetBorderPr"/>
  4709. </xsl:for-each>
  4710. </xsl:otherwise>
  4711. </xsl:choose>
  4712. </xsl:when>
  4713. <xsl:otherwise>
  4714. <xsl:for-each select="$sTblStyleName/w:tblStylePr[@w:type=$cnfType][1]/w:tcPr[1]/w:tcBorders[1]/w:right[1]">
  4715. <xsl:call-template name="GetBorderPr"/>
  4716. </xsl:for-each>
  4717. </xsl:otherwise>
  4718. </xsl:choose>
  4719. </xsl:when>
  4720. <xsl:otherwise>
  4721. <xsl:value-of select="$bdr.right"/>
  4722. </xsl:otherwise>
  4723. </xsl:choose>
  4724. </xsl:variable>
  4725. <xsl:call-template name="ApplyBorderPr">
  4726. <xsl:with-param name="pr.bdr" select="$thisBdr.top"/>
  4727. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4728. </xsl:call-template>
  4729. <xsl:call-template name="ApplyBorderPr">
  4730. <xsl:with-param name="pr.bdr" select="$thisBdr.right"/>
  4731. <xsl:with-param name="bdrSide" select="$bdrSide_right.bidi"/>
  4732. </xsl:call-template>
  4733. <xsl:call-template name="ApplyBorderPr">
  4734. <xsl:with-param name="pr.bdr" select="$thisBdr.bottom"/>
  4735. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4736. </xsl:call-template>
  4737. <xsl:call-template name="ApplyBorderPr">
  4738. <xsl:with-param name="pr.bdr" select="$thisBdr.left"/>
  4739. <xsl:with-param name="bdrSide" select="$bdrSide_left.bidi"/>
  4740. </xsl:call-template>
  4741. </xsl:template>
  4742. <xsl:template name="ApplyTcPr.once">
  4743. <xsl:param name="cellspacing"/>
  4744. <xsl:param name="cellpadding.default"/>
  4745. <xsl:param name="cellpadding.custom"/>
  4746. <xsl:param name="bdr.top"/>
  4747. <xsl:param name="bdr.left"/>
  4748. <xsl:param name="bdr.bottom"/>
  4749. <xsl:param name="bdr.right"/>
  4750. <xsl:param name="bdr.insideV"/>
  4751. <xsl:param name="thisRow"/>
  4752. <xsl:param name="lastRow"/>
  4753. <xsl:param name="sTblStyleName"/>
  4754. <xsl:param name="cnfRow"/>
  4755. <xsl:param name="cnfCol"/>
  4756. <xsl:param name="b.bidivisual"/>
  4757. <xsl:variable name="cnfType">
  4758. <xsl:if test="not($cnfRow='' and $cnfCol='')">
  4759. <xsl:call-template name="GetCnfType">
  4760. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  4761. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  4762. </xsl:call-template>
  4763. </xsl:if>
  4764. </xsl:variable>
  4765. <xsl:variable name="cnfTypeRow">
  4766. <xsl:if test="not($cnfRow='')">
  4767. <xsl:call-template name="GetCnfTypeRow">
  4768. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  4769. </xsl:call-template>
  4770. </xsl:if>
  4771. </xsl:variable>
  4772. <xsl:variable name="cnfTypeCol">
  4773. <xsl:if test="not($cnfCol='')">
  4774. <xsl:call-template name="GetCnfTypeCol">
  4775. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  4776. </xsl:call-template>
  4777. </xsl:if>
  4778. </xsl:variable>
  4779. <xsl:variable name="tcborders" select="w:tcPr[1]/w:tcBorders[1]"/>
  4780. <xsl:variable name="bdrSide_left.bidi">
  4781. <xsl:choose>
  4782. <xsl:when test="$b.bidivisual = $on">
  4783. <xsl:value-of select="$bdrSide_right"/>
  4784. </xsl:when>
  4785. <xsl:otherwise>
  4786. <xsl:value-of select="$bdrSide_left"/>
  4787. </xsl:otherwise>
  4788. </xsl:choose>
  4789. </xsl:variable>
  4790. <xsl:variable name="bdrSide_right.bidi">
  4791. <xsl:choose>
  4792. <xsl:when test="$b.bidivisual = $on">
  4793. <xsl:value-of select="$bdrSide_left"/>
  4794. </xsl:when>
  4795. <xsl:otherwise>
  4796. <xsl:value-of select="$bdrSide_right"/>
  4797. </xsl:otherwise>
  4798. </xsl:choose>
  4799. </xsl:variable>
  4800. <xsl:for-each select="$sTblStyleName/w:tblPr[1]/w:tblBorders[1]">
  4801. <xsl:call-template name="ApplyBorderPr">
  4802. <xsl:with-param name="pr.bdr" select="$bdr.top"/>
  4803. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  4804. </xsl:call-template>
  4805. <xsl:call-template name="ApplyBorderPr">
  4806. <xsl:with-param name="pr.bdr" select="$bdr.bottom"/>
  4807. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  4808. </xsl:call-template>
  4809. <xsl:call-template name="ApplyBorderPr">
  4810. <xsl:with-param name="pr.bdr" select="$bdr.right"/>
  4811. <xsl:with-param name="bdrSide" select="$bdrSide_right.bidi"/>
  4812. </xsl:call-template>
  4813. <xsl:call-template name="ApplyBorderPr">
  4814. <xsl:with-param name="pr.bdr" select="$bdr.left"/>
  4815. <xsl:with-param name="bdrSide" select="$bdrSide_left.bidi"/>
  4816. </xsl:call-template>
  4817. </xsl:for-each>
  4818. <xsl:call-template name="ApplyExtraCornerBorders">
  4819. <xsl:with-param name="cnfType" select="$cnfType" />
  4820. <xsl:with-param name="sTblStyleName" select="$sTblStyleName" />
  4821. </xsl:call-template>
  4822. <xsl:call-template name="ApplyTcBordersFromCnf">
  4823. <xsl:with-param name="cnfType" select="$cnfTypeRow" />
  4824. <xsl:with-param name="sTblStyleName" select="$sTblStyleName" />
  4825. <xsl:with-param name="tcBorders" select="$tcborders" />
  4826. <xsl:with-param name="bdrSide_right.bidi" select="$bdrSide_right.bidi" />
  4827. <xsl:with-param name="bdrSide_left.bidi" select="$bdrSide_left.bidi" />
  4828. <xsl:with-param name="thisRow" select="$thisRow"/>
  4829. <xsl:with-param name="lastRow" select="$lastRow"/>
  4830. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  4831. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  4832. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  4833. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  4834. </xsl:call-template>
  4835. <xsl:call-template name="ApplyTcBordersFromCnf">
  4836. <xsl:with-param name="cnfType" select="$cnfTypeCol" />
  4837. <xsl:with-param name="sTblStyleName" select="$sTblStyleName" />
  4838. <xsl:with-param name="tcBorders" select="$tcborders" />
  4839. <xsl:with-param name="bdrSide_right.bidi" select="$bdrSide_right.bidi" />
  4840. <xsl:with-param name="bdrSide_left.bidi" select="$bdrSide_left.bidi" />
  4841. <xsl:with-param name="thisRow" select="$thisRow"/>
  4842. <xsl:with-param name="lastRow" select="$lastRow"/>
  4843. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  4844. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  4845. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  4846. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  4847. </xsl:call-template>
  4848. <xsl:variable name="cellpadding.custom.merged">
  4849. <xsl:variable name="temp.direct">
  4850. <xsl:for-each select="w:tcPr[1]/w:tcMar[1]">
  4851. <xsl:call-template name="ApplyCellMar"/>
  4852. </xsl:for-each>
  4853. </xsl:variable>
  4854. <xsl:value-of select="$temp.direct"/>
  4855. <xsl:if test="$temp.direct=''">
  4856. <xsl:variable name="temp.cnf">
  4857. <xsl:for-each select="$sTblStyleName">
  4858. <xsl:call-template name="GetCnfPr.cell">
  4859. <xsl:with-param name="type" select="$prrCustomCellpadding"/>
  4860. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  4861. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  4862. </xsl:call-template>
  4863. </xsl:for-each>
  4864. </xsl:variable>
  4865. <xsl:value-of select="$temp.cnf"/>
  4866. <xsl:if test="$temp.cnf=''">
  4867. <xsl:value-of select="$cellpadding.custom"/>
  4868. </xsl:if>
  4869. </xsl:if>
  4870. </xsl:variable>
  4871. <xsl:variable name="cellpadding.default.merged">
  4872. <xsl:variable name="temp.cnf">
  4873. <xsl:for-each select="$sTblStyleName">
  4874. <xsl:call-template name="GetCnfPr.cell">
  4875. <xsl:with-param name="type" select="$prrDefaultCellpadding"/>
  4876. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  4877. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  4878. </xsl:call-template>
  4879. </xsl:for-each>
  4880. </xsl:variable>
  4881. <xsl:value-of select="$temp.cnf"/>
  4882. <xsl:if test="$temp.cnf=''">
  4883. <xsl:value-of select="$cellpadding.default"/>
  4884. </xsl:if>
  4885. </xsl:variable>
  4886. <xsl:choose>
  4887. <xsl:when test="$cellpadding.custom.merged = 'none' and not($cellpadding.default.merged='')">
  4888. <xsl:value-of select="$cellpadding.default.merged"/>
  4889. </xsl:when>
  4890. <xsl:when test="not($cellpadding.custom.merged='')">
  4891. <xsl:value-of select="$cellpadding.custom.merged"/>
  4892. </xsl:when>
  4893. <xsl:when test="not($cellpadding.default.merged='')">
  4894. <xsl:value-of select="$cellpadding.default.merged"/>
  4895. </xsl:when>
  4896. </xsl:choose>
  4897. </xsl:template>
  4898. <xsl:template match="w:tc">
  4899. <xsl:param name="sTblStyleName" select="($nsStyles[@w:styleId=$tblStyleID_Default])[1]"/>
  4900. <xsl:param name="prsPAccum"/>
  4901. <xsl:param name="prsP"/>
  4902. <xsl:param name="prsR"/>
  4903. <xsl:param name="cellspacing"/>
  4904. <xsl:param name="cellpadding.default"/>
  4905. <xsl:param name="cellpadding.custom"/>
  4906. <xsl:param name="bdr.top"/>
  4907. <xsl:param name="bdr.left"/>
  4908. <xsl:param name="bdr.bottom"/>
  4909. <xsl:param name="bdr.right"/>
  4910. <xsl:param name="bdr.insideV"/>
  4911. <xsl:param name="bdr.insideH"/>
  4912. <xsl:param name="thisRow"/>
  4913. <xsl:param name="lastRow"/>
  4914. <xsl:param name="cnfRow"/>
  4915. <xsl:param name="b.bidivisual"/>
  4916. <xsl:variable name="cnfCol" select="string(w:tcPr[1]/w:cnfStyle[1]/@w:val)"/>
  4917. <xsl:variable name="vmerge" select="w:tcPr[1]/w:vMerge[1]"/>
  4918. <xsl:variable name="me" select="." />
  4919. <xsl:variable name="tblCount" select="count(ancestor::w:tbl)" />
  4920. <xsl:variable name="meInContext" select="ancestor::w:tr[1]/*[count($me|descendant-or-self::*)=count(descendant-or-self::*)]" />
  4921. <xsl:variable name="before" select="count($meInContext/preceding-sibling::*[descendant-or-self::*[name()='w:tc' and (count(ancestor::w:tbl)=$tblCount)]])" />
  4922. <xsl:variable name="after" select="count($meInContext/following-sibling::*[descendant-or-self::*[name()='w:tc' and (count(ancestor::w:tbl)=$tblCount)]])" />
  4923. <!-- TO FIX THE COVERPAGE issue added by Shbuh
  4924. <xsl:variable name="tStyleId" />
  4925. <xsl:attribute name="class">
  4926. <xsl:value-of select="$tStyleId"/>
  4927. <xsl:value-of select="$tblStyleSuffix"/>
  4928. </xsl:attribute>
  4929. <xsl:variable name="sTblStyleName" select="($nsStyles[@w:styleId=$tStyleId])[1]"/>
  4930. TO FIX THE COVERPAGE issue added by Shbuha-->
  4931. <xsl:if test="not($vmerge and not($vmerge/@w:val))">
  4932. <td>
  4933. <xsl:attribute name="class">
  4934. <xsl:value-of select="$sTblStyleName/@w:styleId"/>
  4935. <xsl:value-of select="$cellStyleSuffix"/>
  4936. </xsl:attribute>
  4937. <xsl:for-each select="w:tcPr[1]/w:gridSpan[1]/@w:val">
  4938. <xsl:attribute name="colspan">
  4939. <xsl:value-of select="."/>
  4940. </xsl:attribute>
  4941. </xsl:for-each>
  4942. <xsl:variable name="rowspan">
  4943. <xsl:choose>
  4944. <xsl:when test="not($vmerge)">1</xsl:when>
  4945. <xsl:otherwise>
  4946. <xsl:variable name="myRow" select="ancestor::w:tr[1]" />
  4947. <xsl:variable name="myRowInContext" select="$myRow/ancestor::w:tbl[1]/*[count($myRow|descendant-or-self::*)=count(descendant-or-self::*)]" />
  4948. <xsl:variable name="belowMe" select="$myRowInContext/following-sibling::*//w:tc[count(ancestor::w:tbl)=$tblCount][$before + 1]" />
  4949. <xsl:variable name="NextRestart" select="($belowMe//w:tcPr/w:vMerge[@w:val='restart'])[1]" />
  4950. <xsl:variable name="NextRestartInContext" select="$NextRestart/ancestor::w:tbl[1]/*[count($NextRestart|descendant-or-self::*)=count(descendant-or-self::*)]" />
  4951. <xsl:variable name="mergesAboveMe" select="count($myRowInContext/preceding-sibling::*[(descendant-or-self::*[name()='w:tc'])[$before + 1][descendant-or-self::*[name()='w:vMerge']]])" />
  4952. <xsl:variable name="mergesAboveNextRestart" select="count($NextRestartInContext/preceding-sibling::*[(descendant-or-self::*[name()='w:tc'])[$before + 1][descendant-or-self::*[name()='w:vMerge']]])" />
  4953. <xsl:choose>
  4954. <xsl:when test="$NextRestart">
  4955. <xsl:value-of select="$mergesAboveNextRestart - $mergesAboveMe"/>
  4956. </xsl:when>
  4957. <xsl:when test="$vmerge/@w:val">
  4958. <xsl:value-of select="count($belowMe[descendant-or-self::*[name()='w:vMerge']]) + 1" />
  4959. </xsl:when>
  4960. <xsl:otherwise>1</xsl:otherwise>
  4961. </xsl:choose>
  4962. </xsl:otherwise>
  4963. </xsl:choose>
  4964. </xsl:variable>
  4965. <xsl:if test="$vmerge">
  4966. <xsl:attribute name="rowspan">
  4967. <xsl:value-of select="$rowspan"/>
  4968. </xsl:attribute>
  4969. </xsl:if>
  4970. <xsl:variable name="lastRow.updated" select="$lastRow - $rowspan + 1"/>
  4971. <xsl:variable name="bdr.bottom.updated">
  4972. <xsl:choose>
  4973. <xsl:when test="$cellspacing='' and $thisRow=$lastRow.updated">
  4974. <xsl:value-of select="$bdr.bottom"/>
  4975. </xsl:when>
  4976. <xsl:otherwise>
  4977. <xsl:value-of select="$bdr.insideH"/>
  4978. </xsl:otherwise>
  4979. </xsl:choose>
  4980. </xsl:variable>
  4981. <xsl:variable name="bdr.left.updated">
  4982. <xsl:choose>
  4983. <xsl:when test="$cellspacing='' and $before=0">
  4984. <xsl:value-of select="$bdr.left"/>
  4985. </xsl:when>
  4986. <xsl:otherwise>
  4987. <xsl:value-of select="$bdr.insideV"/>
  4988. </xsl:otherwise>
  4989. </xsl:choose>
  4990. </xsl:variable>
  4991. <xsl:variable name="bdr.right.updated">
  4992. <xsl:choose>
  4993. <xsl:when test="$cellspacing='' and $after=0">
  4994. <xsl:value-of select="$bdr.right"/>
  4995. </xsl:when>
  4996. <xsl:otherwise>
  4997. <xsl:value-of select="$bdr.insideV"/>
  4998. </xsl:otherwise>
  4999. </xsl:choose>
  5000. </xsl:variable>
  5001. <xsl:attribute name="style">
  5002. <xsl:if test="not($cnfRow='' and $cnfCol='')">
  5003. <xsl:for-each select="$sTblStyleName">
  5004. <xsl:call-template name="GetCnfPr.all">
  5005. <xsl:with-param name="type" select="$prrApplyTcPr"/>
  5006. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5007. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  5008. </xsl:call-template>
  5009. </xsl:for-each>
  5010. </xsl:if>
  5011. <xsl:call-template name="ApplyTcPr.class"/>
  5012. <xsl:call-template name="ApplyTcPr.once">
  5013. <xsl:with-param name="thisRow" select="$thisRow"/>
  5014. <xsl:with-param name="lastRow" select="$lastRow.updated"/>
  5015. <xsl:with-param name="cellspacing" select="$cellspacing"/>
  5016. <xsl:with-param name="cellpadding.default" select="$cellpadding.default"/>
  5017. <xsl:with-param name="cellpadding.custom" select="$cellpadding.custom"/>
  5018. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  5019. <xsl:with-param name="bdr.left" select="$bdr.left.updated"/>
  5020. <xsl:with-param name="bdr.right" select="$bdr.right.updated"/>
  5021. <xsl:with-param name="bdr.bottom" select="$bdr.bottom.updated"/>
  5022. <xsl:with-param name="bdr.insideV" select="$bdr.insideV"/>
  5023. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5024. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5025. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  5026. <xsl:with-param name="b.bidivisual" select="$b.bidivisual"/>
  5027. </xsl:call-template>
  5028. </xsl:attribute>
  5029. <xsl:choose>
  5030. <xsl:when test="$cnfRow='' and $cnfCol=''">
  5031. <xsl:call-template name="DisplayBodyContent">
  5032. <xsl:with-param name="ns.content" select="*"/>
  5033. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5034. <xsl:with-param name="prsP" select="$prsP"/>
  5035. <xsl:with-param name="prsR" select="$prsR"/>
  5036. </xsl:call-template>
  5037. </xsl:when>
  5038. <xsl:otherwise>
  5039. <xsl:call-template name="WrapCnf">
  5040. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5041. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5042. <xsl:with-param name="cnfCol" select="$cnfCol"/>
  5043. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5044. <xsl:with-param name="prsP" select="$prsP"/>
  5045. <xsl:with-param name="prsR" select="$prsR"/>
  5046. </xsl:call-template>
  5047. </xsl:otherwise>
  5048. </xsl:choose>
  5049. </td>
  5050. </xsl:if>
  5051. </xsl:template>
  5052. <xsl:template name="RecursiveApplyTrPr.class">
  5053. <xsl:if test="w:basedOn">
  5054. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  5055. <xsl:variable name="sTblStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  5056. <xsl:for-each select="$sTblStyleBase">
  5057. <xsl:call-template name="RecursiveApplyTrPr.class" />
  5058. </xsl:for-each>
  5059. </xsl:if>
  5060. <xsl:call-template name="ApplyTrPr.class"/>
  5061. </xsl:template>
  5062. <xsl:template name="ApplyTrPr.class">
  5063. <xsl:for-each select="w:trPr">
  5064. <xsl:text>height:</xsl:text>
  5065. <xsl:choose>
  5066. <xsl:when test="w:trHeight/@w:val">
  5067. <xsl:value-of select="w:trHeight[1]/@w:val div 20"/>pt
  5068. </xsl:when>
  5069. <xsl:otherwise>0</xsl:otherwise>
  5070. </xsl:choose>
  5071. <xsl:text>;</xsl:text>
  5072. <xsl:for-each select="w:cantSplit[1]">
  5073. <xsl:choose>
  5074. <xsl:when test="@w:val = 'off'">page-break-inside:auto;</xsl:when>
  5075. <xsl:otherwise>page-break-inside:avoid;</xsl:otherwise>
  5076. </xsl:choose>
  5077. </xsl:for-each>
  5078. </xsl:for-each>
  5079. </xsl:template>
  5080. <xsl:template name="DisplayEmptyCell">
  5081. <xsl:param name="i" select="1"/>
  5082. <td colspan="$i"></td>
  5083. </xsl:template>
  5084. <xsl:template match="w:tr">
  5085. <xsl:param name="sTblStyleName"/>
  5086. <xsl:param name="prsPAccum"/>
  5087. <xsl:param name="prsP"/>
  5088. <xsl:param name="prsR"/>
  5089. <xsl:param name="cellspacing"/>
  5090. <xsl:param name="cellpadding.default"/>
  5091. <xsl:param name="cellpadding.custom"/>
  5092. <xsl:param name="bdr.top"/>
  5093. <xsl:param name="bdr.left"/>
  5094. <xsl:param name="bdr.bottom"/>
  5095. <xsl:param name="bdr.right"/>
  5096. <xsl:param name="bdr.insideH"/>
  5097. <xsl:param name="bdr.insideV"/>
  5098. <xsl:param name="b.bidivisual"/>
  5099. <tr>
  5100. <xsl:attribute name="class">
  5101. <xsl:value-of select="$sTblStyleName/@w:styleId"/>
  5102. <xsl:value-of select="$rowStyleSuffix"/>
  5103. </xsl:attribute>
  5104. <xsl:variable name="cnfRow" select="string(w:trPr[1]/w:cnfStyle[1]/@w:val)"/>
  5105. <xsl:variable name="styleMod">
  5106. <xsl:if test="not($cnfRow='')">
  5107. <xsl:for-each select="$sTblStyleName">
  5108. <xsl:call-template name="GetCnfPr.row">
  5109. <xsl:with-param name="type" select="$prrCantSplit"/>
  5110. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5111. </xsl:call-template>
  5112. </xsl:for-each>
  5113. </xsl:if>
  5114. <xsl:call-template name="ApplyTrPr.class"/>
  5115. </xsl:variable>
  5116. <xsl:if test="not($styleMod='')">
  5117. <xsl:attribute name="style">
  5118. <xsl:value-of select="$styleMod"/>
  5119. </xsl:attribute>
  5120. </xsl:if>
  5121. <xsl:variable name="me" select="." />
  5122. <xsl:variable name="tblCount" select="count(ancestor::w:tbl)" />
  5123. <xsl:variable name="meInContext" select="ancestor::w:tbl[1]/*[count($me|descendant-or-self::*)=count(descendant-or-self::*)]" />
  5124. <xsl:variable name="before" select="count($meInContext/preceding-sibling::*[descendant-or-self::*[name()='w:tr' and (count(ancestor::w:tbl)=$tblCount)]])" />
  5125. <xsl:variable name="after" select="count($meInContext/following-sibling::*[descendant-or-self::*[name()='w:tr' and (count(ancestor::w:tbl)=$tblCount)]])" />
  5126. <xsl:variable name="thisRow" select="$before + 1"/>
  5127. <xsl:variable name="lastRow" select="$before + $after + 1"/>
  5128. <xsl:variable name="bdr.top.updated">
  5129. <xsl:choose>
  5130. <xsl:when test="$cellspacing='' and $thisRow=1">
  5131. <xsl:value-of select="$bdr.top"/>
  5132. </xsl:when>
  5133. <xsl:otherwise>
  5134. <xsl:value-of select="$bdr.insideH"/>
  5135. </xsl:otherwise>
  5136. </xsl:choose>
  5137. </xsl:variable>
  5138. <xsl:for-each select="w:trPr[1]/w:gridBefore[1]/@w:val">
  5139. <xsl:call-template name="DisplayEmptyCell">
  5140. <xsl:with-param name="i">
  5141. <xsl:value-of select="."/>
  5142. </xsl:with-param>
  5143. </xsl:call-template>
  5144. </xsl:for-each>
  5145. <xsl:apply-templates select="*[not(name()='w:trPr')]">
  5146. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5147. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5148. <xsl:with-param name="prsP" select="$prsP"/>
  5149. <xsl:with-param name="prsR" select="$prsR"/>
  5150. <xsl:with-param name="thisRow" select="$thisRow"/>
  5151. <xsl:with-param name="lastRow" select="$lastRow"/>
  5152. <xsl:with-param name="cellspacing" select="$cellspacing"/>
  5153. <xsl:with-param name="cellpadding.default" select="$cellpadding.default"/>
  5154. <xsl:with-param name="cellpadding.custom" select="$cellpadding.custom"/>
  5155. <xsl:with-param name="bdr.top" select="$bdr.top.updated"/>
  5156. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  5157. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  5158. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  5159. <xsl:with-param name="bdr.insideV" select="$bdr.insideV"/>
  5160. <xsl:with-param name="bdr.insideH" select="$bdr.insideH"/>
  5161. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5162. <xsl:with-param name="b.bidivisual" select="$b.bidivisual"/>
  5163. </xsl:apply-templates>
  5164. <xsl:for-each select="w:trPr[1]/w:gridAfter[1]/@w:val">
  5165. <xsl:call-template name="DisplayEmptyCell">
  5166. <xsl:with-param name="i">
  5167. <xsl:value-of select="."/>
  5168. </xsl:with-param>
  5169. </xsl:call-template>
  5170. </xsl:for-each>
  5171. </tr>
  5172. </xsl:template>
  5173. <xsl:template name="RecursiveApplyTblPr.class">
  5174. <xsl:if test="w:basedOn">
  5175. <xsl:variable name="baseStyleName" select="w:basedOn[1]/@w:val" />
  5176. <xsl:variable name="sTblStyleBase" select="($nsStyles[@w:styleId=$baseStyleName])[1]"/>
  5177. <xsl:for-each select="$sTblStyleBase">
  5178. <xsl:call-template name="RecursiveApplyTblPr.class" />
  5179. </xsl:for-each>
  5180. </xsl:if>
  5181. <xsl:call-template name="ApplyTblPr.class"/>
  5182. </xsl:template>
  5183. <xsl:template name="ApplyTblPr.class">
  5184. <xsl:for-each select="w:tblPr[1]">
  5185. <xsl:if test="w:tblpPr/@w:topFromText">
  5186. margin-top:<xsl:value-of select="w:tblpPr/@w:topFromText[1] div 20"/>pt;
  5187. </xsl:if>
  5188. <xsl:if test="w:tblpPr/@w:rightFromText">
  5189. margin-right:<xsl:value-of select="w:tblpPr/@w:rightFromText[1] div 20"/>pt;
  5190. </xsl:if>
  5191. <xsl:if test="w:tblpPr/@w:bottomFromText">
  5192. margin-bottom:<xsl:value-of select="w:tblpPr/@w:bottomFromText[1] div 20"/>pt;
  5193. </xsl:if>
  5194. <xsl:if test="w:tblpPr/@w:leftFromText">
  5195. margin-left:<xsl:value-of select="w:tblpPr/@w:leftFromText[1] div 20"/>pt;
  5196. </xsl:if>
  5197. <xsl:for-each select="w:tblW[1]">
  5198. <xsl:if test="@w:type != 'auto'">
  5199. width:<xsl:call-template name="EvalTableWidth"/>;
  5200. </xsl:if>
  5201. </xsl:for-each>
  5202. </xsl:for-each>
  5203. </xsl:template>
  5204. <xsl:template name="tblCore">
  5205. <table>
  5206. <xsl:variable name="tStyleId">
  5207. <xsl:choose>
  5208. <xsl:when test="w:tblPr[1]/w:tblStyle[1]/@w:val">
  5209. <xsl:value-of select="w:tblPr[1]/w:tblStyle[1]/@w:val"/>
  5210. </xsl:when>
  5211. <xsl:otherwise>
  5212. <xsl:value-of select="$tblStyleID_Default"/>
  5213. </xsl:otherwise>
  5214. </xsl:choose>
  5215. </xsl:variable>
  5216. <xsl:attribute name="class">
  5217. <xsl:value-of select="$tStyleId"/>
  5218. <xsl:value-of select="$tblStyleSuffix"/>
  5219. </xsl:attribute>
  5220. <xsl:variable name="sTblStyleName" select="($nsStyles[@w:styleId=$tStyleId])[1]"/>
  5221. <xsl:variable name="cellspacingTEMP">
  5222. <xsl:call-template name="GetSingleTblPr">
  5223. <xsl:with-param name="type" select="$prrCellspacing"/>
  5224. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5225. </xsl:call-template>
  5226. </xsl:variable>
  5227. <xsl:variable name="cellspacing">
  5228. <xsl:choose>
  5229. <xsl:when test="$cellspacingTEMP='0'"></xsl:when>
  5230. <xsl:otherwise>
  5231. <xsl:value-of select="$cellspacingTEMP"/>
  5232. </xsl:otherwise>
  5233. </xsl:choose>
  5234. </xsl:variable>
  5235. <xsl:variable name="cellpadding.default">
  5236. <xsl:call-template name="GetSingleTblPr">
  5237. <xsl:with-param name="type" select="$prrDefaultCellpadding"/>
  5238. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5239. </xsl:call-template>
  5240. </xsl:variable>
  5241. <xsl:variable name="cellpadding.custom">
  5242. <xsl:for-each select="$sTblStyleName/w:tcPr[1]/w:tcMar[1]">
  5243. <xsl:call-template name="ApplyCellMar"/>
  5244. </xsl:for-each>
  5245. </xsl:variable>
  5246. <xsl:variable name="tblInd">
  5247. <xsl:call-template name="GetSingleTblPr">
  5248. <xsl:with-param name="type" select="$prrTblInd"/>
  5249. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5250. </xsl:call-template>
  5251. </xsl:variable>
  5252. <xsl:variable name="bdr.top">
  5253. <xsl:call-template name="GetSingleTblPr">
  5254. <xsl:with-param name="type" select="$prrBdrPr_top"/>
  5255. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5256. </xsl:call-template>
  5257. </xsl:variable>
  5258. <xsl:variable name="bdr.left">
  5259. <xsl:call-template name="GetSingleTblPr">
  5260. <xsl:with-param name="type" select="$prrBdrPr_left"/>
  5261. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5262. </xsl:call-template>
  5263. </xsl:variable>
  5264. <xsl:variable name="bdr.bottom">
  5265. <xsl:call-template name="GetSingleTblPr">
  5266. <xsl:with-param name="type" select="$prrBdrPr_bottom"/>
  5267. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5268. </xsl:call-template>
  5269. </xsl:variable>
  5270. <xsl:variable name="bdr.right">
  5271. <xsl:call-template name="GetSingleTblPr">
  5272. <xsl:with-param name="type" select="$prrBdrPr_right"/>
  5273. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5274. </xsl:call-template>
  5275. </xsl:variable>
  5276. <xsl:variable name="bdr.insideH">
  5277. <xsl:call-template name="GetSingleTblPr">
  5278. <xsl:with-param name="type" select="$prrBdrPr_insideH"/>
  5279. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5280. </xsl:call-template>
  5281. </xsl:variable>
  5282. <xsl:variable name="bdr.insideV">
  5283. <xsl:call-template name="GetSingleTblPr">
  5284. <xsl:with-param name="type" select="$prrBdrPr_insideV"/>
  5285. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5286. </xsl:call-template>
  5287. </xsl:variable>
  5288. <xsl:variable name="b.bidivisual">
  5289. <xsl:for-each select="w:tblPr[1]/w:bidiVisual[1]">
  5290. <xsl:value-of select="$on"/>
  5291. </xsl:for-each>
  5292. </xsl:variable>
  5293. <xsl:variable name="align">
  5294. <xsl:for-each select="w:tblPr[1]/w:tblpPr[1]/@w:tblpXSpec">
  5295. <xsl:value-of select="."/>
  5296. </xsl:for-each>
  5297. </xsl:variable>
  5298. <xsl:if test="not($align='')">
  5299. <xsl:attribute name="align">
  5300. <xsl:choose>
  5301. <xsl:when test="$align = 'right' or $align = 'outside'">right</xsl:when>
  5302. <xsl:otherwise>left</xsl:otherwise>
  5303. </xsl:choose>
  5304. </xsl:attribute>
  5305. </xsl:if>
  5306. <xsl:attribute name="cellspacing">
  5307. <xsl:choose>
  5308. <xsl:when test="$cellspacing=''">0</xsl:when>
  5309. <xsl:otherwise>
  5310. <xsl:value-of select="($cellspacing div 1440) * $pixelsPerInch"/>
  5311. </xsl:otherwise>
  5312. </xsl:choose>
  5313. </xsl:attribute>
  5314. <xsl:if test="$cellspacing=''">
  5315. <xsl:attribute name="cellspacing">0</xsl:attribute>
  5316. </xsl:if>
  5317. <xsl:variable name="styleMod">
  5318. <xsl:call-template name="ApplyTblPr.class"/>
  5319. <xsl:choose>
  5320. <xsl:when test="$cellspacing=''">border-collapse:collapse;</xsl:when>
  5321. <xsl:otherwise>
  5322. <xsl:text>border-collapse:separate;</xsl:text>
  5323. <xsl:call-template name="ApplyBorderPr">
  5324. <xsl:with-param name="pr.bdr" select="$bdr.top"/>
  5325. <xsl:with-param name="bdrSide" select="$bdrSide_top"/>
  5326. </xsl:call-template>
  5327. <xsl:call-template name="ApplyBorderPr">
  5328. <xsl:with-param name="pr.bdr" select="$bdr.left"/>
  5329. <xsl:with-param name="bdrSide" select="$bdrSide_left"/>
  5330. </xsl:call-template>
  5331. <xsl:call-template name="ApplyBorderPr">
  5332. <xsl:with-param name="pr.bdr" select="$bdr.bottom"/>
  5333. <xsl:with-param name="bdrSide" select="$bdrSide_bottom"/>
  5334. </xsl:call-template>
  5335. <xsl:call-template name="ApplyBorderPr">
  5336. <xsl:with-param name="pr.bdr" select="$bdr.right"/>
  5337. <xsl:with-param name="bdrSide" select="$bdrSide_right"/>
  5338. </xsl:call-template>
  5339. </xsl:otherwise>
  5340. </xsl:choose>
  5341. <xsl:if test="$b.bidivisual=$on">direction:rtl;</xsl:if>
  5342. <xsl:if test="not(w:tblPr/w:tblpPr)">
  5343. <xsl:text>margin-</xsl:text>
  5344. <xsl:choose>
  5345. <xsl:when test="$b.bidivisual=$on">right</xsl:when>
  5346. <xsl:otherwise>left</xsl:otherwise>
  5347. </xsl:choose>
  5348. <xsl:text>:</xsl:text>
  5349. <xsl:value-of select="$tblInd"/>
  5350. <xsl:text>;</xsl:text>
  5351. </xsl:if>
  5352. </xsl:variable>
  5353. <xsl:if test="not($styleMod='')">
  5354. <xsl:attribute name="style">
  5355. <xsl:value-of select="$styleMod"/>
  5356. </xsl:attribute>
  5357. </xsl:if>
  5358. <xsl:variable name="prsPAccum">
  5359. <xsl:for-each select="$sTblStyleName">
  5360. <xsl:call-template name="ApplyPPr.many"/>
  5361. </xsl:for-each>
  5362. </xsl:variable>
  5363. <xsl:variable name="prsR">
  5364. <xsl:call-template name="PrsUpdateRPr">
  5365. <xsl:with-param name="ndPrContainer" select="$sTblStyleName"/>
  5366. </xsl:call-template>
  5367. </xsl:variable>
  5368. <xsl:variable name="prsP">
  5369. <xsl:call-template name="PrsUpdatePPr">
  5370. <xsl:with-param name="ndPrContainer" select="$sTblStyleName"/>
  5371. </xsl:call-template>
  5372. </xsl:variable>
  5373. <xsl:apply-templates select="*[not(name()='w:tblPr' or name()='w:tblGrid')]">
  5374. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5375. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5376. <xsl:with-param name="prsP" select="$prsP"/>
  5377. <xsl:with-param name="prsR" select="$prsR"/>
  5378. <xsl:with-param name="cellspacing" select="$cellspacing"/>
  5379. <xsl:with-param name="cellpadding.default" select="$cellpadding.default"/>
  5380. <xsl:with-param name="cellpadding.custom" select="$cellpadding.custom"/>
  5381. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  5382. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  5383. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  5384. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  5385. <xsl:with-param name="bdr.insideH" select="$bdr.insideH"/>
  5386. <xsl:with-param name="bdr.insideV" select="$bdr.insideV"/>
  5387. <xsl:with-param name="b.bidivisual" select="$b.bidivisual"/>
  5388. </xsl:apply-templates>
  5389. <xsl:for-each select="w:tblGrid[1]">
  5390. <!--<xsl:text disable-output-escaping="yes">&lt;![if !supportMisalignedColumns]&gt;</xsl:text>-->
  5391. <tr height="0">
  5392. <xsl:for-each select="w:gridCol">
  5393. <xsl:variable name="gridStyle">
  5394. margin:0;padding:0;border:none;width:<xsl:call-template name="EvalTableWidth"/>;
  5395. </xsl:variable>
  5396. <td style="{$gridStyle}"/>
  5397. </xsl:for-each>
  5398. </tr>
  5399. <!--<xsl:text disable-output-escaping="yes">&lt;![endif]&gt;</xsl:text>-->
  5400. </xsl:for-each>
  5401. </table>
  5402. </xsl:template>
  5403. <xsl:template match="w:tbl[w:tblPr/w:jc/@w:val]">
  5404. <xsl:variable name="p.Jc" select="w:tblPr/w:jc/@w:val"/>
  5405. <div>
  5406. <xsl:attribute name="align">
  5407. <xsl:value-of select="$p.Jc"/>
  5408. </xsl:attribute>
  5409. <xsl:call-template name="tblCore"/>
  5410. </div>
  5411. </xsl:template>
  5412. <xsl:template match="w:tbl">
  5413. <xsl:call-template name="tblCore"/>
  5414. </xsl:template>
  5415. <xsl:template name="hrCore">
  5416. <xsl:param name="p.Hr"/>
  5417. <hr>
  5418. <xsl:attribute name="style">
  5419. <xsl:value-of select="substring-after($p.Hr/@style, ';')"/>
  5420. </xsl:attribute>
  5421. <xsl:attribute name="align">
  5422. <xsl:value-of select="$p.Hr/@o:hralign"/>
  5423. </xsl:attribute>
  5424. <xsl:if test="$p.Hr/@o:hrnoshade='t'">
  5425. <xsl:attribute name="noshade">
  5426. <xsl:text>1</xsl:text>
  5427. </xsl:attribute>
  5428. <xsl:attribute name="color">
  5429. <xsl:value-of select="$p.Hr/@fillcolor"/>
  5430. </xsl:attribute>
  5431. </xsl:if>
  5432. <xsl:if test="$p.Hr/@o:hrpct">
  5433. <xsl:attribute name="width">
  5434. <xsl:value-of select="$p.Hr/@o:hrpct div 10"/>
  5435. <xsl:text>%</xsl:text>
  5436. </xsl:attribute>
  5437. </xsl:if>
  5438. </hr>
  5439. </xsl:template>
  5440. <xsl:template match="w:p[w:r[1]//v:rect/@o:hrstd and not(w:r[2])]">
  5441. <xsl:call-template name="hrCore">
  5442. <xsl:with-param name="p.Hr" select="w:r//v:rect"/>
  5443. </xsl:call-template>
  5444. </xsl:template>
  5445. <xsl:template match="v:rect[@o:hrstd]">
  5446. <xsl:call-template name="hrCore">
  5447. <xsl:with-param name="p.Hr" select="."/>
  5448. </xsl:call-template>
  5449. </xsl:template>
  5450. <xsl:template match="w:body">
  5451. <xsl:attribute name="style">
  5452. <xsl:variable name="divBody" select="/w:document/w:divs/w:div[w:bodyDiv/@w:val='on']"/>
  5453. <xsl:variable name="dxaBodyLeft">
  5454. <xsl:value-of select="$divBody/w:marLeft/@w:val"/>
  5455. </xsl:variable>
  5456. <xsl:variable name="dxaBodyRight">
  5457. <xsl:value-of select="$divBody/w:marRight/@w:val"/>
  5458. </xsl:variable>
  5459. <xsl:if test="not($dxaBodyLeft='' or $dxaBodyLeft=0)">
  5460. <xsl:text>margin-left:</xsl:text>
  5461. <xsl:value-of select="$dxaBodyLeft div 20"/>
  5462. <xsl:text>pt;</xsl:text>
  5463. </xsl:if>
  5464. <xsl:if test="not($dxaBodyRight='' or $dxaBodyRight=0)">
  5465. <xsl:text>margin-right:</xsl:text>
  5466. <xsl:value-of select="$dxaBodyRight div 20"/>
  5467. <xsl:text>pt;</xsl:text>
  5468. </xsl:if>
  5469. </xsl:attribute>
  5470. <xsl:apply-templates select="*"/>
  5471. </xsl:template>
  5472. <xsl:template match="w:font">
  5473. <xsl:text>@font-face{font-family:"</xsl:text>
  5474. <xsl:value-of select="@w:name"/>
  5475. <xsl:text>";panose-1:</xsl:text>
  5476. <xsl:variable name="panose1">
  5477. <xsl:call-template name="ConvertHexToDec">
  5478. <xsl:with-param name="value" select="w:panose-1[1]/@w:val"/>
  5479. <xsl:with-param name="i" select="2"/>
  5480. <xsl:with-param name="s" select="2"/>
  5481. </xsl:call-template>
  5482. </xsl:variable>
  5483. <xsl:value-of select="substring($panose1,2)"/>
  5484. <xsl:text>;}</xsl:text>
  5485. </xsl:template>
  5486. <xsl:template name="MakeRStyle">
  5487. <xsl:text>.</xsl:text>
  5488. <xsl:value-of select="@w:styleId"/>
  5489. <xsl:value-of select="$charStyleSuffix"/>
  5490. <xsl:text>{</xsl:text>
  5491. <xsl:call-template name="MakeRStyleCore"/>
  5492. <xsl:text>}
  5493. </xsl:text>
  5494. </xsl:template>
  5495. <xsl:template name="MakeRStyleCore">
  5496. <xsl:if test="w:basedOn/@w:val">
  5497. <xsl:variable name="sBasedOn">
  5498. <xsl:value-of select="w:basedOn/@w:val"/>
  5499. </xsl:variable>
  5500. <xsl:for-each select="$nsStyles[@w:styleId=$sBasedOn]">
  5501. <xsl:call-template name="MakeRStyleCore"/>
  5502. </xsl:for-each>
  5503. </xsl:if>
  5504. <xsl:call-template name="ApplyRPr.class"/>
  5505. </xsl:template>
  5506. <xsl:template name="MakePStyle">
  5507. <xsl:text>.</xsl:text>
  5508. <xsl:value-of select="@w:styleId"/>
  5509. <xsl:value-of select="$paraStyleSuffix"/>
  5510. <xsl:text>{
  5511. </xsl:text>
  5512. <xsl:call-template name="MakePStyleCore"/>
  5513. <xsl:text>}
  5514. </xsl:text>
  5515. <xsl:call-template name="MakeRStyle"/>
  5516. </xsl:template>
  5517. <xsl:template name="MakePStyleCore">
  5518. <xsl:param name="beforeAutospace" select="$off" />
  5519. <xsl:param name="afterAutospace" select="$off" />
  5520. <xsl:variable name="spacing" select="w:pPr[1]/w:spacing[1]"/>
  5521. <xsl:variable name="beforeAutospaceHere">
  5522. <xsl:choose>
  5523. <xsl:when test="$spacing/@w:before-autospacing = 'on'">
  5524. <xsl:value-of select="$on" />
  5525. </xsl:when>
  5526. <xsl:otherwise>
  5527. <xsl:value-of select="$beforeAutospace" />
  5528. </xsl:otherwise>
  5529. </xsl:choose>
  5530. </xsl:variable>
  5531. <xsl:variable name="afterAutospaceHere">
  5532. <xsl:choose>
  5533. <xsl:when test="$spacing/@w:after-autospacing = 'on'">
  5534. <xsl:value-of select="$on" />
  5535. </xsl:when>
  5536. <xsl:otherwise>
  5537. <xsl:value-of select="$afterAutospace" />
  5538. </xsl:otherwise>
  5539. </xsl:choose>
  5540. </xsl:variable>
  5541. <xsl:choose>
  5542. <xsl:when test="w:basedOn/@w:val">
  5543. <xsl:variable name="sBasedOn">
  5544. <xsl:value-of select="w:basedOn/@w:val"/>
  5545. </xsl:variable>
  5546. <xsl:for-each select="$nsStyles[@w:styleId=$sBasedOn]">
  5547. <xsl:call-template name="MakePStyleCore">
  5548. <xsl:with-param name="beforeAutospace" select="$beforeAutospaceHere" />
  5549. <xsl:with-param name="afterAutospace" select="$afterAutospaceHere" />
  5550. </xsl:call-template>
  5551. </xsl:for-each>
  5552. </xsl:when>
  5553. <xsl:otherwise>
  5554. <xsl:text>margin-left:</xsl:text>
  5555. <xsl:value-of select="$paraMarginDefaultLeft"/>
  5556. <xsl:text>;margin-right:</xsl:text>
  5557. <xsl:value-of select="$paraMarginDefaultRight"/>
  5558. <xsl:if test="not($beforeAutospace = $on)" >
  5559. <xsl:if test="(not($spacing/@w:before-autospacing) or $spacing/@w:before-autospacing = 'off')">
  5560. <xsl:text>;margin-top:</xsl:text>
  5561. <xsl:value-of select="$paraMarginDefaultTop"/>
  5562. </xsl:if>
  5563. </xsl:if>
  5564. <xsl:if test="not($afterAutospace = $on)" >
  5565. <xsl:if test="(not($spacing/@w:after-autospacing) or $spacing/@w:after-autospacing = 'off')">
  5566. <xsl:text>;margin-bottom:</xsl:text>
  5567. <xsl:value-of select="$paraMarginDefaultBottom"/>
  5568. </xsl:if>
  5569. </xsl:if>
  5570. <xsl:text>;font-size:10.0pt;font-family:"Times New Roman";</xsl:text>
  5571. <xsl:for-each select="/w:document[1]/w:styles[1]/w:docDefaults/w:pPrDefault">
  5572. <xsl:call-template name="ApplyPPr.many"/>
  5573. </xsl:for-each>
  5574. </xsl:otherwise>
  5575. </xsl:choose>
  5576. <xsl:call-template name="ApplyPPr.class"/>
  5577. </xsl:template>
  5578. <xsl:template name="MakeTblStyle">
  5579. <xsl:variable name="styleId" select="@w:styleId"/>
  5580. <xsl:text>.</xsl:text>
  5581. <xsl:value-of select="$styleId"/>
  5582. <xsl:value-of select="$tblStyleSuffix"/>
  5583. <xsl:text>{</xsl:text>
  5584. <xsl:call-template name="RecursiveApplyTblPr.class"/>
  5585. <xsl:text>} </xsl:text>
  5586. <xsl:text>.</xsl:text>
  5587. <xsl:value-of select="$styleId"/>
  5588. <xsl:value-of select="$rowStyleSuffix"/>
  5589. <xsl:text>{</xsl:text>
  5590. <xsl:call-template name="RecursiveApplyTrPr.class"/>
  5591. <xsl:text>} </xsl:text>
  5592. <xsl:text>.</xsl:text>
  5593. <xsl:value-of select="$styleId"/>
  5594. <xsl:value-of select="$cellStyleSuffix"/>
  5595. <xsl:text>{vertical-align:top;</xsl:text>
  5596. <xsl:call-template name="RecursiveApplyTcPr.class"/>
  5597. <xsl:call-template name="RecursiveApplyPPr.class"/>
  5598. <xsl:call-template name="RecursiveApplyRPr.class"/>
  5599. <xsl:text>} </xsl:text>
  5600. <xsl:for-each select="w:tblStylePr">
  5601. <xsl:text>.</xsl:text><xsl:value-of select="$styleId"/>-<xsl:value-of select="@w:type"/>
  5602. <xsl:text>{vertical-align:top;</xsl:text>
  5603. <xsl:call-template name="ApplyPPr.class"/>
  5604. <xsl:call-template name="ApplyRPr.class"/>
  5605. <xsl:text>} </xsl:text>
  5606. </xsl:for-each>
  5607. </xsl:template>
  5608. <xsl:template match="w:style">
  5609. <xsl:choose>
  5610. <xsl:when test="@w:type = 'character'">
  5611. <xsl:call-template name="MakeRStyle"/>
  5612. </xsl:when>
  5613. <xsl:when test="@w:type = 'paragraph'">
  5614. <xsl:call-template name="MakePStyle"/>
  5615. </xsl:when>
  5616. <xsl:when test="@w:type = 'table'">
  5617. <xsl:call-template name="MakeTblStyle"/>
  5618. </xsl:when>
  5619. </xsl:choose>
  5620. </xsl:template>
  5621. <xsl:template match="a:fontScheme">
  5622. .<xsl:value-of select="$minorAsciiTheme"/>{font-family:<xsl:value-of select="./a:minorFont/a:latin/@typeface" />;}
  5623. .<xsl:value-of select="$majorAsciiTheme"/>{font-family:<xsl:value-of select="./a:majorFont/a:latin/@typeface" />;}
  5624. .<xsl:value-of select="$minorAnsiTheme"/>{font-family:<xsl:value-of select="./a:minorFont/a:latin/@typeface" />;}
  5625. .<xsl:value-of select="$majorAnsiTheme"/>{font-family:<xsl:value-of select="./a:majorFont/a:latin/@typeface" />;}
  5626. .<xsl:value-of select="$minorEATheme"/>{font-family:<xsl:value-of select="./a:minorFont/a:ea/@typeface" />;}
  5627. .<xsl:value-of select="$majorEATheme"/>{font-family:<xsl:value-of select="./a:majorFont/a:ea/@typeface" />;}
  5628. .<xsl:value-of select="$minorCSTheme"/>{font-family:<xsl:value-of select="./a:minorFont/a:cs/@typeface" />;}
  5629. .<xsl:value-of select="$majorCSTheme"/>{font-family:<xsl:value-of select="./a:majorFont/a:cs/@typeface" />;}
  5630. </xsl:template>
  5631. <xsl:template match="w:bookmarkStart">
  5632. <a name="{@w:name}"/>
  5633. </xsl:template>
  5634. <xsl:template match="w:ins">
  5635. <xsl:param name="b.bidi"/>
  5636. <xsl:param name="prsR"/>
  5637. <ins>
  5638. <xsl:call-template name="DisplayPContent">
  5639. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  5640. <xsl:with-param name="prsR" select="$prsR"/>
  5641. </xsl:call-template>
  5642. </ins>
  5643. </xsl:template>
  5644. <xsl:template match="w:del">
  5645. <xsl:param name="b.bidi"/>
  5646. <xsl:param name="prsR"/>
  5647. <xsl:if test="/w:document/w:settings/w:trackRevisions">
  5648. <del>
  5649. <xsl:call-template name="DisplayPContent">
  5650. <xsl:with-param name="b.bidi" select="$b.bidi"/>
  5651. <xsl:with-param name="prsR" select="$prsR"/>
  5652. </xsl:call-template>
  5653. </del>
  5654. </xsl:if>
  5655. </xsl:template>
  5656. <xsl:template match="aml:annotation[@w:type='Word.Comment']">
  5657. <xsl:variable name="id" select="@aml:id + 1"/>
  5658. <a class="msocomanchor" id="_anchor_{$id}" onmouseover="msoCommentShow('_anchor_{$id}','_com_{$id}')" onmouseout="msoCommentHide('_com_{$id}')" href="#_msocom_{$id}" language="JavaScript" name="_msoanchor_{$id}">
  5659. <xsl:value-of select="concat('[',@w:initials,$id,']')"/>
  5660. </a>
  5661. </xsl:template>
  5662. <xsl:template name="DisplayAnnotationText">
  5663. <xsl:variable name="id" select="@aml:id + 1"/>
  5664. <div id="_com_{$id}" class="msocomtxt" language="JavaScript" onmouseover="msoCommentShow('_anchor_{$id}','_com_{$id}')" onmouseout="msoCommentHide('_com_{$id}')">
  5665. <a name="_msocom_{$id}"></a>
  5666. <a href="#_msoanchor_{$id}" class="msocomoff">
  5667. <xsl:value-of select="concat('[',@w:initials,$id,']')"/>
  5668. </a>
  5669. <xsl:for-each select="aml:content">
  5670. <xsl:call-template name="DisplayBodyContent">
  5671. <xsl:with-param name="ns.content" select="*"/>
  5672. </xsl:call-template>
  5673. </xsl:for-each>
  5674. </div>
  5675. </xsl:template>
  5676. <xsl:template name="DisplayAnnotationScript">
  5677. <!-- <xsl:text disable-output-escaping="yes">&lt;![if !supportAnnotations]&gt;</xsl:text> -->
  5678. <style id="dynCom" type="text/css"></style>
  5679. <script type="text/javascript" language="JavaScript">
  5680. <xsl:comment>
  5681. <xsl:text disable-output-escaping="yes">
  5682. function msoCommentShow(anchor_id, com_id)
  5683. {
  5684. if(msoBrowserCheck())
  5685. {
  5686. c = document.all(com_id);
  5687. a = document.all(anchor_id);
  5688. if (null != c &amp;&amp; null == c.length &amp;&amp; null != a &amp;&amp; null == a.length)
  5689. {
  5690. var cw = c.offsetWidth;
  5691. var ch = c.offsetHeight;
  5692. var aw = a.offsetWidth;
  5693. var ah = a.offsetHeight;
  5694. var x = a.offsetLeft;
  5695. var y = a.offsetTop;
  5696. var el = a;
  5697. while (el.tagName != "BODY")
  5698. {
  5699. el = el.offsetParent;
  5700. x = x + el.offsetLeft;
  5701. y = y + el.offsetTop;
  5702. }
  5703. var bw = document.body.clientWidth;
  5704. var bh = document.body.clientHeight;
  5705. var bsl = document.body.scrollLeft;
  5706. var bst = document.body.scrollTop;
  5707. if (x + cw + ah / 2 > bw + bsl &amp;&amp; x + aw - ah / 2 - cw >= bsl )
  5708. { c.style.left = x + aw - ah / 2 - cw; }
  5709. else
  5710. { c.style.left = x + ah / 2; }
  5711. if (y + ch + ah / 2 > bh + bst &amp;&amp; y + ah / 2 - ch >= bst )
  5712. { c.style.top = y + ah / 2 - ch; }
  5713. else
  5714. { c.style.top = y + ah / 2; }
  5715. c.style.visibility = "visible";
  5716. } } }
  5717. function msoCommentHide(com_id)
  5718. {
  5719. if(msoBrowserCheck())
  5720. {
  5721. c = document.all(com_id);
  5722. if (null != c &amp;&amp; null == c.length)
  5723. {
  5724. c.style.visibility = "hidden";
  5725. c.style.left = -1000;
  5726. c.style.top = -1000;
  5727. } }
  5728. }
  5729. function msoBrowserCheck()
  5730. {
  5731. ms = navigator.appVersion.indexOf("MSIE");
  5732. vers = navigator.appVersion.substring(ms + 5, ms + 6);
  5733. ie4 = (ms > 0) &amp;&amp; (parseInt(vers) >= 4);
  5734. return ie4;
  5735. }
  5736. if (msoBrowserCheck())
  5737. {
  5738. document.styleSheets.dynCom.addRule(".msocomanchor","background: infobackground");
  5739. document.styleSheets.dynCom.addRule(".msocomoff","display: none");
  5740. document.styleSheets.dynCom.addRule(".msocomtxt","visibility: hidden");
  5741. document.styleSheets.dynCom.addRule(".msocomtxt","position: absolute");
  5742. document.styleSheets.dynCom.addRule(".msocomtxt","top: -1000");
  5743. document.styleSheets.dynCom.addRule(".msocomtxt","left: -1000");
  5744. document.styleSheets.dynCom.addRule(".msocomtxt","width: 33%");
  5745. document.styleSheets.dynCom.addRule(".msocomtxt","background: infobackground");
  5746. document.styleSheets.dynCom.addRule(".msocomtxt","color: infotext");
  5747. document.styleSheets.dynCom.addRule(".msocomtxt","border-top: 1pt solid threedlightshadow");
  5748. document.styleSheets.dynCom.addRule(".msocomtxt","border-right: 2pt solid threedshadow");
  5749. document.styleSheets.dynCom.addRule(".msocomtxt","border-bottom: 2pt solid threedshadow");
  5750. document.styleSheets.dynCom.addRule(".msocomtxt","border-left: 1pt solid threedlightshadow");
  5751. document.styleSheets.dynCom.addRule(".msocomtxt","padding: 3pt 3pt 3pt 3pt");
  5752. document.styleSheets.dynCom.addRule(".msocomtxt","z-index: 100");
  5753. }
  5754. </xsl:text>
  5755. </xsl:comment>
  5756. </script>
  5757. <!--<xsl:text disable-output-escaping="yes">&lt;![endif]&gt;</xsl:text>-->
  5758. </xsl:template>
  5759. <xsl:template name="copyElements">
  5760. <xsl:param name="sTblStyleName"/>
  5761. <xsl:param name="prsPAccum"/>
  5762. <xsl:param name="prsP"/>
  5763. <xsl:param name="prsR"/>
  5764. <xsl:param name="cellspacing"/>
  5765. <xsl:param name="cellpadding.default"/>
  5766. <xsl:param name="cellpadding.custom"/>
  5767. <xsl:param name="bdr.top"/>
  5768. <xsl:param name="bdr.left"/>
  5769. <xsl:param name="bdr.bottom"/>
  5770. <xsl:param name="bdr.right"/>
  5771. <xsl:param name="bdr.insideV"/>
  5772. <xsl:param name="bdr.insideH"/>
  5773. <xsl:param name="thisRow"/>
  5774. <xsl:param name="lastRow"/>
  5775. <xsl:param name="cnfRow"/>
  5776. <xsl:param name="b.bidivisual"/>
  5777. <xsl:element name="{name()}" namespace="{namespace-uri()}">
  5778. <xsl:for-each select="@*">
  5779. <xsl:attribute name="{name()}" namespace="{namespace-uri()}">
  5780. <xsl:value-of select="."/>
  5781. </xsl:attribute>
  5782. </xsl:for-each>
  5783. <xsl:apply-templates>
  5784. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5785. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5786. <xsl:with-param name="prsP" select="$prsP"/>
  5787. <xsl:with-param name="prsR" select="$prsR"/>
  5788. <xsl:with-param name="cellspacing" select="$cellspacing"/>
  5789. <xsl:with-param name="cellpadding.default" select="$cellpadding.default"/>
  5790. <xsl:with-param name="cellpadding.custom" select="$cellpadding.custom"/>
  5791. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  5792. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  5793. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  5794. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  5795. <xsl:with-param name="bdr.insideV" select="$bdr.insideV"/>
  5796. <xsl:with-param name="bdr.insideH" select="$bdr.insideH"/>
  5797. <xsl:with-param name="thisRow" select="$thisRow"/>
  5798. <xsl:with-param name="lastRow" select="$lastRow"/>
  5799. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5800. <xsl:with-param name="b.bidivisual" select="$b.bidivisual"/>
  5801. </xsl:apply-templates>
  5802. </xsl:element>
  5803. </xsl:template>
  5804. <xsl:template match="*">
  5805. <xsl:param name="sTblStyleName"/>
  5806. <xsl:param name="prsPAccum"/>
  5807. <xsl:param name="prsP"/>
  5808. <xsl:param name="prsR"/>
  5809. <xsl:param name="cellspacing"/>
  5810. <xsl:param name="cellpadding.default"/>
  5811. <xsl:param name="cellpadding.custom"/>
  5812. <xsl:param name="bdr.top"/>
  5813. <xsl:param name="bdr.left"/>
  5814. <xsl:param name="bdr.bottom"/>
  5815. <xsl:param name="bdr.right"/>
  5816. <xsl:param name="bdr.insideV"/>
  5817. <xsl:param name="bdr.insideH"/>
  5818. <xsl:param name="thisRow"/>
  5819. <xsl:param name="lastRow"/>
  5820. <xsl:param name="cnfRow"/>
  5821. <xsl:param name="b.bidivisual"/>
  5822. <xsl:call-template name="copyElements">
  5823. <xsl:with-param name="sTblStyleName" select="$sTblStyleName"/>
  5824. <xsl:with-param name="prsPAccum" select="$prsPAccum"/>
  5825. <xsl:with-param name="prsP" select="$prsP"/>
  5826. <xsl:with-param name="prsR" select="$prsR"/>
  5827. <xsl:with-param name="cellspacing" select="$cellspacing"/>
  5828. <xsl:with-param name="cellpadding.default" select="$cellpadding.default"/>
  5829. <xsl:with-param name="cellpadding.custom" select="$cellpadding.custom"/>
  5830. <xsl:with-param name="bdr.top" select="$bdr.top"/>
  5831. <xsl:with-param name="bdr.left" select="$bdr.left"/>
  5832. <xsl:with-param name="bdr.bottom" select="$bdr.bottom"/>
  5833. <xsl:with-param name="bdr.right" select="$bdr.right"/>
  5834. <xsl:with-param name="bdr.insideV" select="$bdr.insideV"/>
  5835. <xsl:with-param name="bdr.insideH" select="$bdr.insideH"/>
  5836. <xsl:with-param name="thisRow" select="$thisRow"/>
  5837. <xsl:with-param name="lastRow" select="$lastRow"/>
  5838. <xsl:with-param name="cnfRow" select="$cnfRow"/>
  5839. <xsl:with-param name="b.bidivisual" select="$b.bidivisual"/>
  5840. </xsl:call-template>
  5841. </xsl:template>
  5842. <xsl:template match="v:*">
  5843. <xsl:choose>
  5844. <xsl:when test=".//w10:wrap[@type='topAndBottom']">
  5845. <o:wrapblock>
  5846. <xsl:call-template name="copyElements"/>
  5847. </o:wrapblock>
  5848. <br style="mso-ignore:vglayout" clear='ALL'/>
  5849. </xsl:when>
  5850. <xsl:otherwise>
  5851. <xsl:call-template name="copyElements"/>
  5852. </xsl:otherwise>
  5853. </xsl:choose>
  5854. </xsl:template>
  5855. <xsl:template match="w:ruby">
  5856. <ruby>
  5857. <xsl:attribute name="lang">
  5858. <xsl:value-of select="w:rubyPr/w:lid/@w:val" />
  5859. </xsl:attribute>
  5860. <xsl:attribute name="style">
  5861. <xsl:variable name="align" select="w:rubyPr/w:rubyAlign/@w:val" />
  5862. <xsl:text>ruby-align:</xsl:text>
  5863. <xsl:choose>
  5864. <xsl:when test="$align='rightVertical'">
  5865. <xsl:text>auto</xsl:text>
  5866. </xsl:when>
  5867. <xsl:when test="$align='distributeLetter'">
  5868. <xsl:text>distribute-letter</xsl:text>
  5869. </xsl:when>
  5870. <xsl:when test="$align='distributeSpace'">
  5871. <xsl:text>distribute-space</xsl:text>
  5872. </xsl:when>
  5873. <xsl:otherwise>
  5874. <xsl:value-of select="$align" />
  5875. </xsl:otherwise>
  5876. </xsl:choose>
  5877. </xsl:attribute>
  5878. <span>
  5879. <xsl:if test="w:rubyPr/w:hpsBaseText">
  5880. <xsl:attribute name="style">
  5881. <xsl:text>font-size:</xsl:text>
  5882. <xsl:value-of select="w:rubyPr/w:hpsBaseText/@w:val" />
  5883. <xsl:text>pt;</xsl:text>
  5884. </xsl:attribute>
  5885. </xsl:if>
  5886. <xsl:apply-templates select="w:rubyBase/w:r"/>
  5887. </span>
  5888. <rt>
  5889. <span>
  5890. <xsl:if test="w:rubyPr/w:hps">
  5891. <xsl:attribute name="style">
  5892. <xsl:text>font-size:</xsl:text>
  5893. <xsl:value-of select="w:rubyPr/w:hps/@w:val div 2" />
  5894. <xsl:text>pt;</xsl:text>
  5895. </xsl:attribute>
  5896. <xsl:apply-templates select="w:rt/w:r/w:t"/>
  5897. <!--<xsl:apply-templates select="w:r/w:t"/>-->
  5898. </xsl:if>
  5899. </span>
  5900. </rt>
  5901. </ruby>
  5902. </xsl:template>
  5903. <xsl:template match="w:footnote">
  5904. <xsl:variable name="me" select="." />
  5905. <xsl:variable name="meInContext" select="ancestor::w:r[1]/*[count($me|descendant-or-self::*)=count(descendant-or-self::*)]" />
  5906. <xsl:variable name="start">
  5907. <xsl:choose>
  5908. <xsl:when test="$ndDocPr/w:footnotePr/w:numStart">
  5909. <xsl:value-of select="$ndDocPr/w:footnotePr/w:numStart/@w:val" />
  5910. </xsl:when>
  5911. <xsl:otherwise>
  5912. <xsl:value-of select="1" />
  5913. </xsl:otherwise>
  5914. </xsl:choose>
  5915. </xsl:variable>
  5916. <xsl:variable name="position" select="count($meInContext/preceding::*[name()='w:footnote' and ancestor::w:body]) + $start" />
  5917. <sup>
  5918. <a>
  5919. <xsl:attribute name="name">
  5920. <xsl:value-of select="$footnoteRefLink" />
  5921. <xsl:value-of select="$position" />
  5922. </xsl:attribute>
  5923. <xsl:attribute name="href"><xsl:text>#</xsl:text>
  5924. <xsl:value-of select="$footnoteLink" />
  5925. <xsl:value-of select="$position" />
  5926. </xsl:attribute>
  5927. <xsl:text>[</xsl:text>
  5928. <xsl:value-of select="$position" />
  5929. <xsl:text>]</xsl:text>
  5930. </a>
  5931. </sup>
  5932. </xsl:template>
  5933. <xsl:template match="w:endnote">
  5934. <xsl:variable name="me" select="." />
  5935. <xsl:variable name="meInContext" select="ancestor::w:r[1]/*[count($me|descendant-or-self::*)=count(descendant-or-self::*)]" />
  5936. <xsl:variable name="start">
  5937. <xsl:choose>
  5938. <xsl:when test="$ndDocPr/w:endnotePr/w:numStart">
  5939. <xsl:value-of select="$ndDocPr/w:endnotePr/w:numStart/@w:val" />
  5940. </xsl:when>
  5941. <xsl:otherwise>
  5942. <xsl:value-of select="1" />
  5943. </xsl:otherwise>
  5944. </xsl:choose>
  5945. </xsl:variable>
  5946. <xsl:variable name="position" select="count($meInContext/preceding::*[name()='w:endnote' and ancestor::w:body]) + $start" />
  5947. <sup>
  5948. <a>
  5949. <xsl:attribute name="name">
  5950. <xsl:value-of select="$endnoteRefLink" />
  5951. <xsl:value-of select="$position" />
  5952. </xsl:attribute>
  5953. <xsl:attribute name="href"><xsl:text>#</xsl:text>
  5954. <xsl:value-of select="$endnoteLink" />
  5955. <xsl:value-of select="$position" />
  5956. </xsl:attribute>
  5957. <xsl:text>[</xsl:text>
  5958. <xsl:value-of select="$position" />
  5959. <xsl:text>]</xsl:text>
  5960. </a>
  5961. </sup>
  5962. </xsl:template>
  5963. <xsl:template name="IsListBullet">
  5964. <xsl:variable name="numId" select="w:numId/@w:val"/>
  5965. <xsl:variable name="ilvl" select="w:ilvl/@w:val"/>
  5966. <xsl:variable name="list" select="$ndLists/w:num[@w:numId=$numId][1]"/>
  5967. <xsl:variable name="nfc">
  5968. <xsl:choose>
  5969. <xsl:when test="$ndLists/w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  5970. <xsl:for-each select="$ndLists/w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  5971. <xsl:choose>
  5972. <xsl:when test="$list/w:lvlOverride[@w:ilvl=$ilvl]/w:numFmt">
  5973. <xsl:value-of select="$list/w:lvlOverride[@w:ilvl=$ilvl]/w:numFmt/@w:val" />
  5974. </xsl:when>
  5975. <xsl:otherwise>
  5976. <xsl:value-of select="$ndLists/w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]/w:numFmt/@w:val" />
  5977. </xsl:otherwise>
  5978. </xsl:choose>
  5979. </xsl:for-each>
  5980. </xsl:when>
  5981. <xsl:when test="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  5982. <xsl:for-each select="$list/w:lvlOverride[@w:ilvl=$ilvl]">
  5983. <xsl:value-of select="w:numFmt/@w:val" />
  5984. </xsl:for-each>
  5985. </xsl:when>
  5986. <xsl:when test="$ndLists/w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:listStyleLink">
  5987. <xsl:variable name="linkedStyleId" select="$ndLists/w:abstractNum[@w:abstractNumId=$list/w:abstractNumId/@w:val][1]/w:listStyleLink/@w:val" />
  5988. <xsl:variable name="linkedStyle" select="$nsStyles[@w:styleId=$linkedStyleId]" />
  5989. <xsl:variable name="linkedList" select="w:num[@w:numId=$linkedStyle/w:pPr/w:numPr/w:numId/@w:val]" />
  5990. <xsl:for-each select="$ndLists/w:abstractNum[@w:abstractNumId=$linkedList/w:abstractNumId/@w:val][1]/w:lvl[@w:ilvl=$ilvl][1]">
  5991. <xsl:value-of select="w:numFmt/@w:val" />
  5992. </xsl:for-each>
  5993. </xsl:when>
  5994. </xsl:choose>
  5995. </xsl:variable>
  5996. <xsl:if test="$nfc=$nfcBullet">
  5997. <xsl:value-of select="$on" />
  5998. </xsl:if>
  5999. </xsl:template>
  6000. <xsl:template match="w:fldSimple">
  6001. <xsl:apply-templates/>
  6002. </xsl:template>
  6003. <xsl:template match="w:*"/>
  6004. <xsl:template match="o:WordFieldCodes"/>
  6005. <xsl:template match="w:cfChunk">
  6006. <xsl:apply-templates />
  6007. </xsl:template>
  6008. <xsl:template match="w:sdt">
  6009. <xsl:apply-templates />
  6010. </xsl:template>
  6011. <xsl:template match="w:sdtContent">
  6012. <xsl:apply-templates />
  6013. </xsl:template>
  6014. <xsl:template match="w:smartTag">
  6015. <xsl:apply-templates />
  6016. </xsl:template>
  6017. <!--this template is added now
  6018. <xsl:template match="w:background" mode="rpr">
  6019. bgcolor=<xsl:call-template name="ConvHexColor">
  6020. <xsl:with-param name="value" select="@w:color"/>
  6021. </xsl:call-template>;
  6022. </xsl:template>
  6023. -->
  6024. <xsl:template match="/w:document">
  6025. <html>
  6026. <head>
  6027. <xsl:for-each select="$ndOfficeDocPr/o:HyperlinkBase[1]">
  6028. <base href="{(.)}"/>
  6029. </xsl:for-each>
  6030. <xsl:call-template name="DisplayAnnotationScript"/>
  6031. <!--<xsl:comment>-->
  6032. <!--<xsl:text disable-output-escaping="yes">[if !mso]&gt;</xsl:text>-->
  6033. <xsl:text disable-output-escaping="yes">&lt;style&gt;</xsl:text>
  6034. <xsl:text>
  6035. v\:* {behavior:url(#default#VML);}
  6036. o\:* {behavior:url(#default#VML);}
  6037. w10\:* {behavior:url(#default#VML);}
  6038. .shape {behavior:url(#default#VML);}
  6039. </xsl:text>
  6040. <xsl:text disable-output-escaping="yes">&lt;/style&gt;</xsl:text>
  6041. <!--<xsl:text disable-output-escaping="yes">&lt;![endif]</xsl:text>-->
  6042. <!-- </xsl:comment> -->
  6043. <style>
  6044. <!-- <xsl:comment> -->
  6045. <xsl:apply-templates select="w:fonts[1]/w:font"/>
  6046. del {text-decoration:line-through;color:red;}
  6047. <xsl:choose>
  6048. <xsl:when test="/w:document/w:settings/w:trackRevisions">
  6049. ins {text-decoration:underline;color:teal;}
  6050. </xsl:when>
  6051. <xsl:otherwise>
  6052. ins {text-decoration:none;}
  6053. </xsl:otherwise>
  6054. </xsl:choose>
  6055. <xsl:apply-templates select="a:theme/a:themeElements/a:fontScheme"/>
  6056. <xsl:apply-templates select="$nsStyles"/>
  6057. <!-- </xsl:comment> -->
  6058. </style>
  6059. </head>
  6060. <body>
  6061. <xsl:if test="w:background/@w:color">
  6062. <xsl:variable name="color"> <!-- Added by Parwati to handle Background Page Color-->
  6063. <xsl:text>#</xsl:text>
  6064. </xsl:variable>
  6065. <xsl:attribute name="bgcolor">
  6066. <xsl:value-of select="$color"/>
  6067. <xsl:value-of select="w:background/@w:color"/>
  6068. </xsl:attribute>
  6069. </xsl:if>
  6070. <!-- Added for column rendering by Parwati
  6071. <xsl:if test="//w:body//w:sectPr//w:cols[@w:num] | //w:body/w:p/w:pPr/w:sectPr/w:cols[@w:num] | //w:body/w:sdt/w:sdtContent">
  6072. <xsl:text disable-output-escaping="yes">&lt;table cellpadding="5px"&gt;</xsl:text>
  6073. <xsl:text disable-output-escaping="yes">&lt;tr&gt;</xsl:text>
  6074. <xsl:text disable-output-escaping="yes">&lt;td valign="top"&gt;</xsl:text>
  6075. </xsl:if>
  6076. End of change by Parwati -->
  6077. <xsl:apply-templates select="w:body|w:cfChunk"/>
  6078. <xsl:if test="//v:background">
  6079. <xsl:for-each select="//v:background[1]">
  6080. <xsl:call-template name="copyElements" />
  6081. </xsl:for-each>
  6082. </xsl:if>
  6083. <xsl:for-each select="//aml:annotation[@w:type='Word.Comment']">
  6084. <xsl:call-template name="DisplayAnnotationText"/>
  6085. </xsl:for-each>
  6086. <xsl:if test="//w:body//w:footnote">
  6087. <xsl:variable name="start">
  6088. <xsl:choose>
  6089. <xsl:when test="$ndDocPr/w:footnotePr/w:numStart">
  6090. <xsl:value-of select="$ndDocPr/w:footnotePr/w:numStart/@w:val" />
  6091. </xsl:when>
  6092. <xsl:otherwise>
  6093. <xsl:value-of select="0" />
  6094. </xsl:otherwise>
  6095. </xsl:choose>
  6096. </xsl:variable>
  6097. <hr align="left" size="1" width="33%" />
  6098. <xsl:for-each select="//w:body//w:footnote">
  6099. <a>
  6100. <xsl:attribute name="href">
  6101. <xsl:text>#</xsl:text>
  6102. <xsl:value-of select="$footnoteRefLink" />
  6103. <xsl:value-of select="position() + $start" />
  6104. </xsl:attribute>
  6105. <xsl:attribute name="target">
  6106. <xsl:text>_self</xsl:text>
  6107. </xsl:attribute>
  6108. <xsl:attribute name="name">
  6109. <xsl:value-of select="$footnoteLink" />
  6110. <xsl:value-of select="position() + $start" />
  6111. </xsl:attribute>
  6112. <xsl:text>[</xsl:text>
  6113. <xsl:value-of select="position() + $start" />
  6114. <xsl:text>]</xsl:text>
  6115. </a>
  6116. <xsl:apply-templates select="*" />
  6117. </xsl:for-each>
  6118. </xsl:if>
  6119. <xsl:if test="//w:body//w:endnote">
  6120. <xsl:variable name="start">
  6121. <xsl:choose>
  6122. <xsl:when test="$ndDocPr/w:endnotePr/w:numStart">
  6123. <xsl:value-of select="$ndDocPr/w:endnotePr/w:numStart/@w:val" />
  6124. </xsl:when>
  6125. <xsl:otherwise>
  6126. <xsl:value-of select="0" />
  6127. </xsl:otherwise>
  6128. </xsl:choose>
  6129. </xsl:variable>
  6130. <hr align="left" size="1" width="33%" />
  6131. <xsl:for-each select="//w:body//w:endnote">
  6132. <a>
  6133. <xsl:attribute name="href">
  6134. <xsl:text>#</xsl:text>
  6135. <xsl:value-of select="$endnoteRefLink" />
  6136. <xsl:value-of select="position() + $start" />
  6137. </xsl:attribute>
  6138. <xsl:attribute name="target">
  6139. <xsl:text>_self</xsl:text>
  6140. </xsl:attribute>
  6141. <xsl:attribute name="name">
  6142. <xsl:value-of select="$endnoteLink" />
  6143. <xsl:value-of select="position() + $start" />
  6144. </xsl:attribute>
  6145. <xsl:text>[</xsl:text>
  6146. <xsl:value-of select="position() + $start" />
  6147. <xsl:text>]</xsl:text>
  6148. </a>
  6149. <xsl:apply-templates select="*" />
  6150. </xsl:for-each>
  6151. </xsl:if>
  6152. <!-- Added for column rendering by Parwati
  6153. <xsl:if test="//w:body/w:sectPr/w:cols/@w:num | //w:body/w:p/w:pPr/w:sectPr/w:cols[@w:num] | //w:body/w:sdt/w:sdtContent">
  6154. <xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
  6155. <xsl:text disable-output-escaping="yes">&lt;/tr&gt;</xsl:text>
  6156. <xsl:text disable-output-escaping="yes">&lt;/table&gt;</xsl:text>
  6157. </xsl:if>
  6158. End of change by Parwati -->
  6159. <!--<xsl:if test="//w:body//w:sdt//w:sdtContent and //w:body/w:p/w:r/w:lastRenderedPageBreak"> --><!-- For coverpage Added by Parwati--><!--
  6160. <xsl:text disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
  6161. </xsl:if>-->
  6162. </body>
  6163. </html>
  6164. </xsl:template>
  6165. <xsl:template match="w:drawing">
  6166. <xsl:variable name="w">
  6167. <xsl:value-of select=".//wp:extent/@cx"/>
  6168. </xsl:variable>
  6169. <xsl:variable name="h">
  6170. <xsl:value-of select=".//wp:extent/@cy"/>
  6171. </xsl:variable>
  6172. <img src="?image={.//a:blip/@r:embed[1]}">
  6173. <xsl:attribute name="width">
  6174. <xsl:value-of select="number($w) div 9525"/>px
  6175. </xsl:attribute>
  6176. <xsl:attribute name="height">
  6177. <xsl:value-of select="number($h) div 9525"/>px
  6178. </xsl:attribute>
  6179. </img>
  6180. </xsl:template>
  6181. <xsl:template match="w:customXml">
  6182. <xsl:apply-templates select="*"/>
  6183. </xsl:template>
  6184. <xsl:template match="/">
  6185. <!--ADDED for Equations -->
  6186. <xsl:if test="$pmathml">
  6187. <xsl:processing-instruction name="xml-stylesheet"
  6188. >type="text/xsl" href="<xsl:value-of select="$pmathml"/>"</xsl:processing-instruction>
  6189. </xsl:if>
  6190. <xsl:if test="$dtd">
  6191. <xsl:text disable-output-escaping="yes"><![CDATA[
  6192. <!DOCTYPE html SYSTEM "]]></xsl:text>
  6193. <xsl:value-of select="$dtd"/>
  6194. <xsl:text disable-output-escaping="yes"><![CDATA[" [
  6195. <!ENTITY % MATHML.prefixed "INCLUDE" >
  6196. <!ENTITY % MATHML.prefix "mml" >
  6197. ]>
  6198. ]]>
  6199. </xsl:text>
  6200. </xsl:if>
  6201. <!--ADDED for Equations -->
  6202. <xsl:apply-templates select="*"/>
  6203. </xsl:template>
  6204. <!--ADDED FOR MATHML SUPPORT BY SHUBHA -->
  6205. <!-- Every single unicode character that is recognized by OMML as an operator -->
  6206. <xsl:variable name="sOperators"
  6207. select="concat(
  6208. '&#x0021;&#x0022;&#x0028;&#x0029;&#x002B;&#x002C;&#x002D;&#x002F;&#x2AFE;&#x003A;&#x003B;&#x003C;',
  6209. '&#x003D;&#x003E;&#x003F;&#x005B;&#x005C;&#x005D;&#x007B;&#x007C;&#x007D;&#x00A1;&#x00AC;&#x00B1;',
  6210. '&#x00B7;&#x00BF;&#x00D7;&#x00F7;&#x2000;&#x2001;&#x2002;&#x2003;&#x2004;&#x2005;&#x2006;&#x2009;',
  6211. '&#x200A;&#x2010;&#x2012;&#x2013;&#x2014;&#x2016;&#x2020;&#x2021;&#x2022;&#x2024;&#x2025;&#x2026;',
  6212. '&#x203C;&#x2040;&#x204E;&#x204F;&#x2050;&#x205f;&#x2061;&#x2062;&#x2063;&#x2140;&#x2190;&#x2191;',
  6213. '&#x2192;&#x2193;&#x2194;&#x2195;&#x2196;&#x2197;&#x2198;&#x2199;&#x219A;&#x219B;&#x219C;&#x219D;',
  6214. '&#x219E;&#x219F;&#x21A0;&#x21A1;&#x21A2;&#x21A3;&#x21A4;&#x21A5;&#x21A6;&#x21A7;&#x21A8;&#x21A9;',
  6215. '&#x21AA;&#x21AB;&#x21AC;&#x21AD;&#x21AE;&#x21AF;&#x21B0;&#x21B1;&#x21B2;&#x21B3;&#x21B6;&#x21B7;',
  6216. '&#x21BA;&#x21BB;&#x21BC;&#x21BD;&#x21BE;&#x21BF;&#x21C0;&#x21C1;&#x21C2;&#x21C3;&#x21C4;&#x21C5;',
  6217. '&#x21C6;&#x21C7;&#x21C8;&#x21C9;&#x21CA;&#x21CB;&#x21CC;&#x21CD;&#x21CE;&#x21CF;&#x21D0;&#x21D1;',
  6218. '&#x21D2;&#x21D3;&#x21D4;&#x21D5;&#x21D6;&#x21D7;&#x21D8;&#x21D9;&#x21DA;&#x21DB;&#x21DC;&#x21DD;',
  6219. '&#x21DE;&#x21DF;&#x21E0;&#x21E1;&#x21E2;&#x21E3;&#x21E4;&#x21E5;&#x21E6;&#x21E7;&#x21E8;&#x21E9;',
  6220. '&#x21F4;&#x21F5;&#x21F6;&#x21F7;&#x21F8;&#x21F9;&#x21FA;&#x21FB;&#x21FC;&#x21FD;&#x21FE;&#x21FF;',
  6221. '&#x2200;&#x2201;&#x2202;&#x2203;&#x2204;&#x2206;&#x2207;&#x2208;&#x2209;&#x220A;&#x220B;&#x220C;',
  6222. '&#x220D;&#x220F;&#x2210;&#x2211;&#x2212;&#x2213;&#x2214;&#x2215;&#x2216;&#x2217;&#x2218;&#x2219;',
  6223. '&#x221A;&#x221B;&#x221C;&#x221D;&#x2223;&#x2224;&#x2225;&#x2226;&#x2227;&#x2228;&#x2229;&#x222A;',
  6224. '&#x222B;&#x222C;&#x222D;&#x222E;&#x222F;&#x2230;&#x2231;&#x2232;&#x2233;&#x2234;&#x2235;&#x2236;',
  6225. '&#x2237;&#x2238;&#x2239;&#x223A;&#x223B;&#x223C;&#x223D;&#x223E;&#x2240;&#x2241;&#x2242;&#x2243;',
  6226. '&#x2244;&#x2245;&#x2246;&#x2247;&#x2248;&#x2249;&#x224A;&#x224B;&#x224C;&#x224D;&#x224E;&#x224F;',
  6227. '&#x2250;&#x2251;&#x2252;&#x2253;&#x2254;&#x2255;&#x2256;&#x2257;&#x2258;&#x2259;&#x225A;&#x225B;',
  6228. '&#x225C;&#x225D;&#x225E;&#x225F;&#x2260;&#x2261;&#x2262;&#x2263;&#x2264;&#x2265;&#x2266;&#x2267;',
  6229. '&#x2268;&#x2269;&#x226A;&#x226B;&#x226C;&#x226D;&#x226E;&#x226F;&#x2270;&#x2271;&#x2272;&#x2273;',
  6230. '&#x2274;&#x2275;&#x2276;&#x2277;&#x2278;&#x2279;&#x227A;&#x227B;&#x227C;&#x227D;&#x227E;&#x227F;',
  6231. '&#x2280;&#x2281;&#x2282;&#x2283;&#x2284;&#x2285;&#x2286;&#x2287;&#x2288;&#x2289;&#x228A;&#x228B;',
  6232. '&#x228C;&#x228D;&#x228E;&#x228F;&#x2290;&#x2291;&#x2292;&#x2293;&#x2294;&#x2295;&#x2296;&#x2297;',
  6233. '&#x2298;&#x2299;&#x229A;&#x229B;&#x229C;&#x229D;&#x229E;&#x229F;&#x22A0;&#x22A1;&#x22A2;&#x22A3;',
  6234. '&#x22A5;&#x22A6;&#x22A7;&#x22A8;&#x22A9;&#x22AA;&#x22AB;&#x22AC;&#x22AD;&#x22AE;&#x22AF;&#x22B0;',
  6235. '&#x22B1;&#x22B2;&#x22B3;&#x22B4;&#x22B5;&#x22B6;&#x22B7;&#x22B8;&#x22B9;&#x22BA;&#x22BB;&#x22BC;',
  6236. '&#x22BD;&#x22C0;&#x22C1;&#x22C2;&#x22C3;&#x22C4;&#x22C5;&#x22C6;&#x22C7;&#x22C8;&#x22C9;&#x22CA;',
  6237. '&#x22CB;&#x22CC;&#x22CD;&#x22CE;&#x22CF;&#x22D0;&#x22D1;&#x22D2;&#x22D3;&#x22D4;&#x22D5;&#x22D6;',
  6238. '&#x22D7;&#x22D8;&#x22D9;&#x22DA;&#x22DB;&#x22DC;&#x22DD;&#x22DE;&#x22DF;&#x22E0;&#x22E1;&#x22E2;',
  6239. '&#x22E3;&#x22E4;&#x22E5;&#x22E6;&#x22E7;&#x22E8;&#x22E9;&#x22EA;&#x22EB;&#x22EC;&#x22ED;&#x22EE;',
  6240. '&#x22EF;&#x22F0;&#x22F1;&#x22F2;&#x22F3;&#x22F4;&#x22F5;&#x22F6;&#x22F7;&#x22F8;&#x22F9;&#x22FA;',
  6241. '&#x22FB;&#x22FC;&#x22FD;&#x22FE;&#x22FF;&#x2305;&#x2306;&#x2308;&#x2309;&#x230A;&#x230B;&#x231C;',
  6242. '&#x231D;&#x231E;&#x231F;&#x2322;&#x2323;&#x2329;&#x232A;&#x233D;&#x233F;&#x23B0;&#x23B1;&#x25B2;',
  6243. '&#x25B3;&#x25B4;&#x25B5;&#x25B6;&#x25B7;&#x25B8;&#x25B9;&#x25BC;&#x25BD;&#x25BE;&#x25BF;&#x25C0;',
  6244. '&#x25C1;&#x25C2;&#x25C3;&#x25C4;&#x25C5;&#x25CA;&#x25CB;&#x25E6;&#x25EB;&#x25EC;&#x25F8;&#x25F9;',
  6245. '&#x25FA;&#x25FB;&#x25FC;&#x25FD;&#x25FE;&#x25FF;&#x2605;&#x2606;&#x2772;&#x2773;&#x27D1;&#x27D2;',
  6246. '&#x27D3;&#x27D4;&#x27D5;&#x27D6;&#x27D7;&#x27D8;&#x27D9;&#x27DA;&#x27DB;&#x27DC;&#x27DD;&#x27DE;',
  6247. '&#x27DF;&#x27E0;&#x27E1;&#x27E2;&#x27E3;&#x27E4;&#x27E5;&#x27E6;&#x27E7;&#x27E8;&#x27E9;&#x27EA;',
  6248. '&#x27EB;&#x27F0;&#x27F1;&#x27F2;&#x27F3;&#x27F4;&#x27F5;&#x27F6;&#x27F7;&#x27F8;&#x27F9;&#x27FA;',
  6249. '&#x27FB;&#x27FC;&#x27FD;&#x27FE;&#x27FF;&#x2900;&#x2901;&#x2902;&#x2903;&#x2904;&#x2905;&#x2906;',
  6250. '&#x2907;&#x2908;&#x2909;&#x290A;&#x290B;&#x290C;&#x290D;&#x290E;&#x290F;&#x2910;&#x2911;&#x2912;',
  6251. '&#x2913;&#x2914;&#x2915;&#x2916;&#x2917;&#x2918;&#x2919;&#x291A;&#x291B;&#x291C;&#x291D;&#x291E;',
  6252. '&#x291F;&#x2920;&#x2921;&#x2922;&#x2923;&#x2924;&#x2925;&#x2926;&#x2927;&#x2928;&#x2929;&#x292A;',
  6253. '&#x292B;&#x292C;&#x292D;&#x292E;&#x292F;&#x2930;&#x2931;&#x2932;&#x2933;&#x2934;&#x2935;&#x2936;',
  6254. '&#x2937;&#x2938;&#x2939;&#x293A;&#x293B;&#x293C;&#x293D;&#x293E;&#x293F;&#x2940;&#x2941;&#x2942;',
  6255. '&#x2943;&#x2944;&#x2945;&#x2946;&#x2947;&#x2948;&#x2949;&#x294A;&#x294B;&#x294C;&#x294D;&#x294E;',
  6256. '&#x294F;&#x2950;&#x2951;&#x2952;&#x2953;&#x2954;&#x2955;&#x2956;&#x2957;&#x2958;&#x2959;&#x295A;',
  6257. '&#x295B;&#x295C;&#x295D;&#x295E;&#x295F;&#x2960;&#x2961;&#x2962;&#x2963;&#x2964;&#x2965;&#x2966;',
  6258. '&#x2967;&#x2968;&#x2969;&#x296A;&#x296B;&#x296C;&#x296D;&#x296E;&#x296F;&#x2970;&#x2971;&#x2972;',
  6259. '&#x2973;&#x2974;&#x2975;&#x2976;&#x2977;&#x2978;&#x2979;&#x297A;&#x297B;&#x297C;&#x297D;&#x297E;',
  6260. '&#x297F;&#x2980;&#x2982;&#x2983;&#x2984;&#x2985;&#x2986;&#x2987;&#x2988;&#x2989;&#x298A;&#x298B;',
  6261. '&#x298C;&#x298D;&#x298E;&#x298F;&#x2990;&#x2991;&#x2992;&#x2993;&#x2994;&#x2995;&#x2996;&#x2997;',
  6262. '&#x2998;&#x2999;&#x299A;&#x29B6;&#x29B7;&#x29B8;&#x29B9;&#x29C0;&#x29C1;&#x29C4;&#x29C5;&#x29C6;',
  6263. '&#x29C7;&#x29C8;&#x29CE;&#x29CF;&#x29D0;&#x29D1;&#x29D2;&#x29D3;&#x29D4;&#x29D5;&#x29D6;&#x29D7;',
  6264. '&#x29D8;&#x29D9;&#x29DA;&#x29DB;&#x29DF;&#x29E1;&#x29E2;&#x29E3;&#x29E4;&#x29E5;&#x29E6;&#x29EB;',
  6265. '&#x29F4;&#x29F5;&#x29F6;&#x29F7;&#x29F8;&#x29F9;&#x29FA;&#x29FB;&#x29FC;&#x29FD;&#x29FE;&#x29FF;',
  6266. '&#x2A00;&#x2A01;&#x2A02;&#x2A03;&#x2A04;&#x2A05;&#x2A06;&#x2A07;&#x2A08;&#x2A09;&#x2A0A;&#x2A0B;',
  6267. '&#x2A0C;&#x2A0D;&#x2A0E;&#x2A0F;&#x2A10;&#x2A11;&#x2A12;&#x2A13;&#x2A14;&#x2A15;&#x2A16;&#x2A17;',
  6268. '&#x2A18;&#x2A19;&#x2A1A;&#x2A1B;&#x2A1C;&#x2A1D;&#x2A1E;&#x2A1F;&#x2A20;&#x2A21;&#x2A22;&#x2A23;',
  6269. '&#x2A24;&#x2A25;&#x2A26;&#x2A27;&#x2A28;&#x2A29;&#x2A2A;&#x2A2B;&#x2A2C;&#x2A2D;&#x2A2E;&#x2A2F;',
  6270. '&#x2A30;&#x2A31;&#x2A32;&#x2A33;&#x2A34;&#x2A35;&#x2A36;&#x2A37;&#x2A38;&#x2A39;&#x2A3A;&#x2A3B;',
  6271. '&#x2A3C;&#x2A3D;&#x2A3E;&#x2A3F;&#x2A40;&#x2A41;&#x2A42;&#x2A43;&#x2A44;&#x2A45;&#x2A46;&#x2A47;',
  6272. '&#x2A48;&#x2A49;&#x2A4A;&#x2A4B;&#x2A4C;&#x2A4D;&#x2A4E;&#x2A4F;&#x2A50;&#x2A51;&#x2A52;&#x2A53;',
  6273. '&#x2A54;&#x2A55;&#x2A56;&#x2A57;&#x2A58;&#x2A59;&#x2A5A;&#x2A5B;&#x2A5C;&#x2A5D;&#x2A5E;&#x2A5F;',
  6274. '&#x2A60;&#x2A61;&#x2A62;&#x2A63;&#x2A64;&#x2A65;&#x2A66;&#x2A67;&#x2A68;&#x2A69;&#x2A6A;&#x2A6B;',
  6275. '&#x2A6C;&#x2A6D;&#x2A6E;&#x2A6F;&#x2A70;&#x2A71;&#x2A72;&#x2A73;&#x2A74;&#x2A75;&#x2A76;&#x2A77;',
  6276. '&#x2A78;&#x2A79;&#x2A7A;&#x2A7B;&#x2A7C;&#x2A7D;&#x2A7E;&#x2A7F;&#x2A80;&#x2A81;&#x2A82;&#x2A83;',
  6277. '&#x2A84;&#x2A85;&#x2A86;&#x2A87;&#x2A88;&#x2A89;&#x2A8A;&#x2A8B;&#x2A8C;&#x2A8D;&#x2A8E;&#x2A8F;',
  6278. '&#x2A90;&#x2A91;&#x2A92;&#x2A93;&#x2A94;&#x2A95;&#x2A96;&#x2A97;&#x2A98;&#x2A99;&#x2A9A;&#x2A9B;',
  6279. '&#x2A9C;&#x2A9D;&#x2A9E;&#x2A9F;&#x2AA0;&#x2AA1;&#x2AA2;&#x2AA3;&#x2AA4;&#x2AA5;&#x2AA6;&#x2AA7;',
  6280. '&#x2AA8;&#x2AA9;&#x2AAA;&#x2AAB;&#x2AAC;&#x2AAD;&#x2AAE;&#x2AAF;&#x2AB0;&#x2AB1;&#x2AB2;&#x2AB3;',
  6281. '&#x2AB4;&#x2AB5;&#x2AB6;&#x2AB7;&#x2AB8;&#x2AB9;&#x2ABA;&#x2ABB;&#x2ABC;&#x2ABD;&#x2ABE;&#x2ABF;',
  6282. '&#x2AC0;&#x2AC1;&#x2AC2;&#x2AC3;&#x2AC4;&#x2AC5;&#x2AC6;&#x2AC7;&#x2AC8;&#x2AC9;&#x2ACA;&#x2ACB;',
  6283. '&#x2ACC;&#x2ACD;&#x2ACE;&#x2ACF;&#x2AD0;&#x2AD1;&#x2AD2;&#x2AD3;&#x2AD4;&#x2AD5;&#x2AD6;&#x2AD7;',
  6284. '&#x2AD8;&#x2AD9;&#x2ADA;&#x2ADB;&#x2ADC;&#x2ADD;&#x2ADE;&#x2ADF;&#x2AE0;&#x2AE2;&#x2AE3;&#x2AE4;',
  6285. '&#x2AE5;&#x2AE6;&#x2AE7;&#x2AE8;&#x2AE9;&#x2AEA;&#x2AEB;&#x2AEC;&#x2AED;&#x2AEE;&#x2AEF;&#x2AF0;',
  6286. '&#x2AF2;&#x2AF3;&#x2AF4;&#x2AF5;&#x2AF6;&#x2AF7;&#x2AF8;&#x2AF9;&#x2AFA;&#x2AFB;&#x2AFC;&#x2AFD;')" />
  6287. <!-- A string of '-'s repeated exactly as many times as the operators above -->
  6288. <xsl:variable name="sMinuses">
  6289. <xsl:call-template name="SRepeatChar">
  6290. <xsl:with-param name="cchRequired" select="string-length($sOperators)" />
  6291. <xsl:with-param name="ch" select="'-'" />
  6292. </xsl:call-template>
  6293. </xsl:variable>
  6294. <!-- Every single unicode character that is recognized by OMML as a number -->
  6295. <xsl:variable name="sNumbers" select="'0123456789'"/>
  6296. <!-- A string of '0's repeated exactly as many times as the list of numbers above -->
  6297. <xsl:variable name="sOnes">
  6298. <xsl:call-template name="SRepeatChar">
  6299. <xsl:with-param name="cchRequired" select="string-length($sNumbers)" />
  6300. <xsl:with-param name="ch" select="'1'" />
  6301. </xsl:call-template>
  6302. </xsl:variable>
  6303. <!-- %%Template: SReplace
  6304. Replace all occurences of sOrig in sInput with sReplacement
  6305. and return the resulting string. -->
  6306. <xsl:template name="SReplace">
  6307. <xsl:param name="sInput" />
  6308. <xsl:param name="sOrig" />
  6309. <xsl:param name="sReplacement" />
  6310. <xsl:choose>
  6311. <xsl:when test="not(contains($sInput, $sOrig))">
  6312. <xsl:value-of select="$sInput" />
  6313. </xsl:when>
  6314. <xsl:otherwise>
  6315. <xsl:variable name="sBefore" select="substring-before($sInput, $sOrig)" />
  6316. <xsl:variable name="sAfter" select="substring-after($sInput, $sOrig)" />
  6317. <xsl:variable name="sAfterProcessed">
  6318. <xsl:call-template name="SReplace">
  6319. <xsl:with-param name="sInput" select="$sAfter" />
  6320. <xsl:with-param name="sOrig" select="$sOrig" />
  6321. <xsl:with-param name="sReplacement" select="$sReplacement" />
  6322. </xsl:call-template>
  6323. </xsl:variable>
  6324. <xsl:value-of select="concat($sBefore, concat($sReplacement, $sAfterProcessed))" />
  6325. </xsl:otherwise>
  6326. </xsl:choose>
  6327. </xsl:template>
  6328. <!-- -->
  6329. <xsl:template match="m:e | m:den | m:num | m:lim | m:sup | m:sub">
  6330. <xsl:choose>
  6331. <!-- If there is no scriptLevel speified, just call through -->
  6332. <xsl:when test="not(m:argPr[last()]/m:scrLvl/@m:val)">
  6333. <!-- DPC make sure only one element returned -->
  6334. <mml:mrow><xsl:apply-templates select="*" /></mml:mrow>
  6335. </xsl:when>
  6336. <!-- Otherwise, create an mstyle and set the script level -->
  6337. <xsl:otherwise>
  6338. <mml:mstyle>
  6339. <xsl:attribute name="scriptlevel">
  6340. <xsl:value-of select="m:argPr[last()]/m:scrLvl/@m:val" />
  6341. </xsl:attribute>
  6342. <xsl:apply-templates select="*" />
  6343. </mml:mstyle>
  6344. </xsl:otherwise>
  6345. </xsl:choose>
  6346. </xsl:template>
  6347. <!--
  6348. MS stylesheet uses DOE which is (a) unevil, (b) non necessary, and (c) breaks the pass through a temporay tree to get rid of namespace nodes.
  6349. repeat the templates here without doe (and without double quoting amp)
  6350. -->
  6351. <xsl:template match="m:nary">
  6352. <xsl:variable name="sLowerCaseSubHide">
  6353. <xsl:choose>
  6354. <xsl:when test="count(m:naryPr[last()]/m:subHide) = 0">
  6355. <xsl:text>off</xsl:text>
  6356. </xsl:when>
  6357. <xsl:otherwise>
  6358. <xsl:value-of select="translate(m:naryPr[last()]/m:subHide/@m:val,
  6359. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6360. 'abcdefghijklmnopqrstuvwxyz')" />
  6361. </xsl:otherwise>
  6362. </xsl:choose>
  6363. </xsl:variable>
  6364. <xsl:variable name="sLowerCaseSupHide">
  6365. <xsl:choose>
  6366. <xsl:when test="count(m:naryPr[last()]/m:supHide) = 0">
  6367. <xsl:text>off</xsl:text>
  6368. </xsl:when>
  6369. <xsl:otherwise>
  6370. <xsl:value-of select="translate(m:naryPr[last()]/m:supHide/@m:val,
  6371. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6372. 'abcdefghijklmnopqrstuvwxyz')" />
  6373. </xsl:otherwise>
  6374. </xsl:choose>
  6375. </xsl:variable>
  6376. <xsl:choose>
  6377. <xsl:when test="not($sLowerCaseSupHide='off') and
  6378. not($sLowerCaseSubHide='off')">
  6379. <mml:mo>
  6380. <xsl:choose>
  6381. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6382. m:naryPr[last()]/m:chr/@m:val=''">
  6383. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6384. </xsl:when>
  6385. <xsl:otherwise>
  6386. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6387. </xsl:otherwise>
  6388. </xsl:choose>
  6389. </mml:mo>
  6390. </xsl:when>
  6391. <xsl:when test="not($sLowerCaseSubHide='off')">
  6392. <xsl:choose>
  6393. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  6394. <mml:msup>
  6395. <mml:mo>
  6396. <xsl:choose>
  6397. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6398. m:naryPr[last()]/m:chr/@m:val=''">
  6399. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6400. </xsl:when>
  6401. <xsl:otherwise>
  6402. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6403. </xsl:otherwise>
  6404. </xsl:choose>
  6405. </mml:mo>
  6406. <xsl:apply-templates select="m:sup[1]" />
  6407. </mml:msup>
  6408. </xsl:when>
  6409. <xsl:otherwise>
  6410. <mml:mover>
  6411. <mml:mo>
  6412. <xsl:choose>
  6413. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6414. m:naryPr[last()]/m:chr/@m:val=''">
  6415. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6416. </xsl:when>
  6417. <xsl:otherwise>
  6418. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6419. </xsl:otherwise>
  6420. </xsl:choose>
  6421. </mml:mo>
  6422. <xsl:apply-templates select="m:sup[1]" />
  6423. </mml:mover>
  6424. </xsl:otherwise>
  6425. </xsl:choose>
  6426. </xsl:when>
  6427. <xsl:when test="not($sLowerCaseSupHide='off')">
  6428. <xsl:choose>
  6429. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  6430. <mml:msub>
  6431. <mml:mo>
  6432. <xsl:choose>
  6433. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6434. m:naryPr[last()]/m:chr/@m:val=''">
  6435. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6436. </xsl:when>
  6437. <xsl:otherwise>
  6438. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6439. </xsl:otherwise>
  6440. </xsl:choose>
  6441. </mml:mo>
  6442. <xsl:apply-templates select="m:sub[1]" />
  6443. </mml:msub>
  6444. </xsl:when>
  6445. <xsl:otherwise>
  6446. <mml:munder>
  6447. <mml:mo>
  6448. <xsl:choose>
  6449. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6450. m:naryPr[last()]/m:chr/@m:val=''">
  6451. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6452. </xsl:when>
  6453. <xsl:otherwise>
  6454. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6455. </xsl:otherwise>
  6456. </xsl:choose>
  6457. </mml:mo>
  6458. <xsl:apply-templates select="m:sub[1]" />
  6459. </mml:munder>
  6460. </xsl:otherwise>
  6461. </xsl:choose>
  6462. </xsl:when>
  6463. <xsl:otherwise>
  6464. <xsl:choose>
  6465. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  6466. <mml:msubsup>
  6467. <mml:mo>
  6468. <xsl:choose>
  6469. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6470. m:naryPr[last()]/m:chr/@m:val=''">
  6471. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6472. </xsl:when>
  6473. <xsl:otherwise>
  6474. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6475. </xsl:otherwise>
  6476. </xsl:choose>
  6477. </mml:mo>
  6478. <xsl:apply-templates select="m:sub[1]" />
  6479. <xsl:apply-templates select="m:sup[1]" />
  6480. </mml:msubsup>
  6481. </xsl:when>
  6482. <xsl:otherwise>
  6483. <mml:munderover>
  6484. <mml:mo>
  6485. <xsl:choose>
  6486. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  6487. m:naryPr[last()]/m:chr/@m:val=''">
  6488. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  6489. </xsl:when>
  6490. <xsl:otherwise>
  6491. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  6492. </xsl:otherwise>
  6493. </xsl:choose>
  6494. </mml:mo>
  6495. <xsl:apply-templates select="m:sub[1]" />
  6496. <xsl:apply-templates select="m:sup[1]" />
  6497. </mml:munderover>
  6498. </xsl:otherwise>
  6499. </xsl:choose>
  6500. </xsl:otherwise>
  6501. </xsl:choose>
  6502. <mml:mrow>
  6503. <xsl:apply-templates select="m:e[1]" />
  6504. </mml:mrow>
  6505. </xsl:template>
  6506. <!--<xsl:template name="CreateGroupChr">
  6507. <xsl:variable name="sLowerCasePos" select="translate(m:groupChrPr[last()]/m:pos/@m:val,
  6508. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6509. 'abcdefghijklmnopqrstuvwxyz')" />
  6510. <xsl:choose>
  6511. <xsl:when test="$sLowerCasePos!='top' or
  6512. not(m:groupChrPr[last()]/m:pos/@m:val) or
  6513. m:groupChrPr[last()]/m:pos/@m:val=''">
  6514. <mml:munder>
  6515. <xsl:apply-templates select="m:e[1]" />
  6516. <mml:mo>
  6517. <xsl:choose>
  6518. <xsl:when test="string-length(m:groupChrPr[last()]/m:chr/@m:val) &gt;= 1">
  6519. <xsl:value-of select="substring(m:groupChrPr[last()]/m:chr/@m:val,1,1)" />
  6520. </xsl:when>
  6521. <xsl:otherwise>
  6522. <xsl:text disable-output-escaping="no">&#x023DF;</xsl:text>
  6523. </xsl:otherwise>
  6524. </xsl:choose>
  6525. </mml:mo>
  6526. </mml:munder>
  6527. </xsl:when>
  6528. <xsl:otherwise>
  6529. <mml:mover>
  6530. <xsl:apply-templates select="m:e[1]" />
  6531. <mml:mo>
  6532. <xsl:choose>
  6533. <xsl:when test="string-length(m:groupChrPr[last()]/m:chr/@m:val) &gt;= 1">
  6534. <xsl:value-of select="substring(m:groupChrPr[last()]/m:chr/@m:val,1,1)" />
  6535. </xsl:when>
  6536. <xsl:otherwise>
  6537. <xsl:text disable-output-escaping="no">&#x023DF;</xsl:text>
  6538. </xsl:otherwise>
  6539. </xsl:choose>
  6540. </mml:mo>
  6541. </mml:mover>
  6542. </xsl:otherwise>
  6543. </xsl:choose>
  6544. </xsl:template>-->
  6545. <xsl:template match="m:sSub">
  6546. <mml:msub>
  6547. <mml:mrow>
  6548. <xsl:apply-templates select="m:e[1]" />
  6549. </mml:mrow>
  6550. <mml:mrow>
  6551. <xsl:apply-templates select="m:sub[1]" />
  6552. </mml:mrow>
  6553. </mml:msub>
  6554. </xsl:template>
  6555. <xsl:template match="m:sSup">
  6556. <mml:msup>
  6557. <mml:mrow>
  6558. <xsl:apply-templates select="m:e[1]" />
  6559. </mml:mrow>
  6560. <mml:mrow>
  6561. <xsl:apply-templates select="m:sup[1]" />
  6562. </mml:mrow>
  6563. </mml:msup>
  6564. </xsl:template>
  6565. <xsl:template match="m:sSubSup">
  6566. <mml:msubsup>
  6567. <mml:mrow>
  6568. <xsl:apply-templates select="m:e[1]" />
  6569. </mml:mrow>
  6570. <mml:mrow>
  6571. <xsl:apply-templates select="m:sub[1]" />
  6572. </mml:mrow>
  6573. <mml:mrow>
  6574. <xsl:apply-templates select="m:sup[1]" />
  6575. </mml:mrow>
  6576. </mml:msubsup>
  6577. </xsl:template>
  6578. <xsl:template match="m:groupChr">
  6579. <xsl:variable name="sLowerCaseOpEmu" select="translate(m:groupChrPr[last()]/m:opEmu/@m:val,
  6580. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6581. 'abcdefghijklmnopqrstuvwxyz')" />
  6582. <xsl:choose>
  6583. <xsl:when test="$sLowerCaseOpEmu='on'">
  6584. <mml:mrow>
  6585. <xsl:call-template name="CreateGroupChr" />
  6586. </mml:mrow>
  6587. </xsl:when>
  6588. <xsl:otherwise>
  6589. <xsl:call-template name="CreateGroupChr" />
  6590. </xsl:otherwise>
  6591. </xsl:choose>
  6592. </xsl:template>
  6593. <!--Display cos,sin -->
  6594. <xsl:template name="fName">
  6595. <xsl:for-each select="m:fName/*">
  6596. <xsl:apply-templates select="." />
  6597. </xsl:for-each>
  6598. </xsl:template>
  6599. <xsl:template match="m:func">
  6600. <mml:mrow>
  6601. <mml:mrow>
  6602. <xsl:call-template name="fName" />
  6603. </mml:mrow>
  6604. <mml:mo>&#x02061;</mml:mo>
  6605. <xsl:apply-templates select="*[position() &gt; 1]" />
  6606. </mml:mrow>
  6607. </xsl:template>
  6608. <!-- %%Template: match m:f
  6609. m:f maps directly to mfrac.
  6610. -->
  6611. <xsl:template match="m:f">
  6612. <mml:mfrac>
  6613. <xsl:call-template name="CreateMathMLFracProp">
  6614. <xsl:with-param name="type" select="m:fPr[last()]/m:type/@m:val" />
  6615. <xsl:with-param name="baseJc" select="m:fPr[last()]/m:baseJc/@m:val" />
  6616. <xsl:with-param name="numJc" select="m:fPr[last()]/m:numJc/@m:val" />
  6617. <xsl:with-param name="denJc" select="m:fPr[last()]/m:type/@m:val" />
  6618. </xsl:call-template>
  6619. <mml:mrow><xsl:apply-templates select="m:num[1]" /></mml:mrow>
  6620. <mml:mrow><xsl:apply-templates select="m:den[1]" /></mml:mrow>
  6621. </mml:mfrac>
  6622. </xsl:template>
  6623. <!-- %%Template: CreateMathMLFracProp
  6624. Make fraction properties based on supplied parameters.
  6625. OMML differentiates between a linear fraction and a skewed
  6626. one. For MathML, we write both as bevelled.
  6627. -->
  6628. <xsl:template name="CreateMathMLFracProp">
  6629. <xsl:param name="type" />
  6630. <xsl:param name="baseJc" />
  6631. <xsl:param name="numJc" />
  6632. <xsl:param name="denJc" />
  6633. <xsl:variable name="sLowerCaseType" select="translate($type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />
  6634. <xsl:variable name="sLowerCaseNumJc" select="translate($numJc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />
  6635. <xsl:variable name="sLowerCaseDenJc" select="translate($denJc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />
  6636. <xsl:if test="$sLowerCaseType='skw' or $sLowerCaseType='lin'">
  6637. <xsl:attribute name="bevelled">true</xsl:attribute>
  6638. </xsl:if>
  6639. <xsl:if test="$sLowerCaseType='nobar'">
  6640. <xsl:attribute name="linethickness">0pt</xsl:attribute>
  6641. </xsl:if>
  6642. <xsl:choose>
  6643. <xsl:when test="sLowerCaseNumJc='right'">
  6644. <xsl:attribute name="numalign">right</xsl:attribute>
  6645. </xsl:when>
  6646. <xsl:when test="sLowerCaseNumJc='left'">
  6647. <xsl:attribute name="numalign">left</xsl:attribute>
  6648. </xsl:when>
  6649. </xsl:choose>
  6650. <xsl:choose>
  6651. <xsl:when test="sLowerCaseDenJc='right'">
  6652. <xsl:attribute name="numalign">right</xsl:attribute>
  6653. </xsl:when>
  6654. <xsl:when test="sLowerCaseDenJc='left'">
  6655. <xsl:attribute name="numalign">left</xsl:attribute>
  6656. </xsl:when>
  6657. </xsl:choose>
  6658. </xsl:template>
  6659. <xsl:template match="m:bar">
  6660. <xsl:variable name="sLowerCasePos" select="translate(m:barPr/m:pos/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6661. 'abcdefghijklmnopqrstuvwxyz')" />
  6662. <xsl:choose>
  6663. <xsl:when test="$sLowerCasePos!='bot' or
  6664. not($sLowerCasePos) or
  6665. $sLowerCasePos='' ">
  6666. <mml:mover>
  6667. <xsl:attribute name="accent">true</xsl:attribute>
  6668. <xsl:apply-templates select="m:e[1]" />
  6669. <mml:mo>
  6670. <xsl:text disable-output-escaping="yes">&amp;#x000AF;</xsl:text>
  6671. </mml:mo>
  6672. </mml:mover>
  6673. </xsl:when>
  6674. <xsl:otherwise>
  6675. <mml:munder>
  6676. <xsl:apply-templates select="m:e[1]" />
  6677. <mml:mo>
  6678. <xsl:text disable-output-escaping="yes">&amp;#x00332;</xsl:text>
  6679. </mml:mo>
  6680. </mml:munder>
  6681. </xsl:otherwise>
  6682. </xsl:choose>
  6683. </xsl:template>
  6684. <!-- %%Template match m:d
  6685. Process a delimiter.
  6686. -->
  6687. <xsl:template match="m:d">
  6688. <mml:mfenced>
  6689. <!-- open: default is ( for both OMML and MathML -->
  6690. <xsl:if test="m:dPr[1]/m:begChr/@m:val and not(m:dPr[1]/m:begChr/@m:val ='(')">
  6691. <xsl:attribute name="open">
  6692. <xsl:value-of select="m:dPr[1]/m:begChr/@m:val" />
  6693. </xsl:attribute>
  6694. </xsl:if>
  6695. <!-- close: default is ) for both OMML and MathML -->
  6696. <xsl:if test="m:dPr[1]/m:endChr/@m:val and not(m:dPr[1]/m:endChr/@m:val =')')">
  6697. <xsl:attribute name="close">
  6698. <xsl:value-of select="m:dPr[1]/m:endChr/@m:val" />
  6699. </xsl:attribute>
  6700. </xsl:if>
  6701. <!-- separator: the default is ',' for MathML, and '|' for OMML -->
  6702. <xsl:choose>
  6703. <!-- Matches MathML default. Write nothing -->
  6704. <xsl:when test="m:dPr[1]/m:sepChr/@m:val = ','" />
  6705. <!-- OMML default: | -->
  6706. <xsl:when test="not(m:dPr[1]/m:sepChr/@m:val)">
  6707. <xsl:attribute name="separators">
  6708. <xsl:value-of select="'|'" />
  6709. </xsl:attribute>
  6710. </xsl:when>
  6711. <xsl:otherwise>
  6712. <xsl:attribute name="separators">
  6713. <xsl:value-of select="m:dPr[1]/m:sepChr/@m:val" />
  6714. </xsl:attribute>
  6715. </xsl:otherwise>
  6716. </xsl:choose>
  6717. <!-- now write all the children. Put each one into an mrow
  6718. just in case it produces multiple runs, etc -->
  6719. <xsl:for-each select="m:e">
  6720. <mml:mrow>
  6721. <xsl:apply-templates select="." />
  6722. </mml:mrow>
  6723. </xsl:for-each>
  6724. </mml:mfenced>
  6725. </xsl:template>
  6726. <xsl:template match="m:r">
  6727. <xsl:variable name="sLowerCaseNor" select="translate(child::m:rPr[last()]/m:nor/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6728. 'abcdefghijklmnopqrstuvwxyz')" />
  6729. <xsl:choose>
  6730. <xsl:when test="$sLowerCaseNor='on'">
  6731. <mml:mtext>
  6732. <xsl:value-of select=".//m:t" />
  6733. </mml:mtext>
  6734. </xsl:when>
  6735. <xsl:otherwise>
  6736. <xsl:for-each select=".//m:t">
  6737. <xsl:call-template name="ParseMt">
  6738. <xsl:with-param name="sToParse" select="text()" />
  6739. <xsl:with-param name="mscr" select="../m:rPr[last()]/m:scr/@m:val" />
  6740. <xsl:with-param name="msty" select="../m:rPr[last()]/m:sty/@m:val" />
  6741. <xsl:with-param name="mnor" select="../m:rPr[last()]/m:nor/@m:val" />
  6742. </xsl:call-template>
  6743. </xsl:for-each>
  6744. </xsl:otherwise>
  6745. </xsl:choose>
  6746. </xsl:template>
  6747. <xsl:template name="CreateAttributesforToken">
  6748. <xsl:param name="mscr" />
  6749. <xsl:param name="msty" />
  6750. <xsl:param name="mnor" />
  6751. <xsl:param name="nCharToPrint" />
  6752. <xsl:param name="sTokenType" />
  6753. <xsl:variable name="sLowerCaseNor" select="translate($mnor, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  6754. 'abcdefghijklmnopqrstuvwxyz')" />
  6755. <xsl:choose>
  6756. <xsl:when test="$sLowerCaseNor = 'on'">
  6757. <xsl:attribute name="mathvariant">normal</xsl:attribute>
  6758. </xsl:when>
  6759. <xsl:otherwise>
  6760. <xsl:variable name="mathvariant">
  6761. <xsl:choose>
  6762. <!-- numbers don't care -->
  6763. <xsl:when test="$sTokenType='mn'" />
  6764. <xsl:when test="$mscr='monospace'">monospace</xsl:when>
  6765. <xsl:when test="$mscr='sans-serif' and $msty='i'">sans-serif-italic</xsl:when>
  6766. <xsl:when test="$mscr='sans-serif' and $msty='b'">bold-sans-serif</xsl:when>
  6767. <xsl:when test="$mscr='sans-serif'">sans-serif</xsl:when>
  6768. <xsl:when test="$mscr='fraktur' and $msty='b'">bold-fraktur</xsl:when>
  6769. <xsl:when test="$mscr='fraktur'">fraktur</xsl:when>
  6770. <xsl:when test="$mscr='double-struck'">double-struck</xsl:when>
  6771. <xsl:when test="$mscr='script' and $msty='b'">bold-script</xsl:when>
  6772. <xsl:when test="$mscr='script'">script</xsl:when>
  6773. <xsl:when test="($mscr='roman' or not($mscr) or $mscr='') and $msty='b'">bold</xsl:when>
  6774. <xsl:when test="($mscr='roman' or not($mscr) or $mscr='') and $msty='i'">italic</xsl:when>
  6775. <xsl:when test="($mscr='roman' or not($mscr) or $mscr='') and $msty='p'">normal</xsl:when>
  6776. <xsl:otherwise />
  6777. </xsl:choose>
  6778. </xsl:variable>
  6779. <xsl:variable name="fontweight">
  6780. <xsl:choose>
  6781. <xsl:when test="$msty='b' or $msty='bi'">bold</xsl:when>
  6782. <xsl:otherwise>normal</xsl:otherwise>
  6783. </xsl:choose>
  6784. </xsl:variable>
  6785. <xsl:variable name="fontstyle">
  6786. <xsl:choose>
  6787. <xsl:when test="$msty='p' or $msty='b'">normal</xsl:when>
  6788. <xsl:otherwise>italic</xsl:otherwise>
  6789. </xsl:choose>
  6790. </xsl:variable>
  6791. <!-- Writing of attributes begins here -->
  6792. <xsl:choose>
  6793. <!-- Don't write mathvariant for operators unless they want to be normal -->
  6794. <xsl:when test="$sTokenType='mo' and $mathvariant!='normal'" />
  6795. <!-- A single character within an mi is already italics, don't write -->
  6796. <xsl:when test="$sTokenType='mi' and $nCharToPrint=1 and ($mathvariant='' or $mathvariant='italic')" />
  6797. <xsl:when test="$sTokenType='mi' and $nCharToPrint &gt; 1 and ($mathvariant='' or $mathvariant='italic')">
  6798. <xsl:attribute name="mathvariant">
  6799. <xsl:value-of select="'italic'" />
  6800. </xsl:attribute>
  6801. </xsl:when>
  6802. <xsl:when test="$mathvariant!='italic' and $mathvariant!=''">
  6803. <xsl:attribute name="mathvariant">
  6804. <xsl:value-of select="$mathvariant" />
  6805. </xsl:attribute>
  6806. </xsl:when>
  6807. <xsl:otherwise>
  6808. <xsl:if test="not($sTokenType='mi' and $nCharToPrint=1) and $fontstyle='italic'">
  6809. <xsl:attribute name="fontstyle">italic</xsl:attribute>
  6810. </xsl:if>
  6811. <xsl:if test="$fontweight='bold'">
  6812. <xsl:attribute name="fontweight">bold</xsl:attribute>
  6813. </xsl:if>
  6814. </xsl:otherwise>
  6815. </xsl:choose>
  6816. </xsl:otherwise>
  6817. </xsl:choose>
  6818. </xsl:template>
  6819. <xsl:template match="m:eqArr">
  6820. <mml:mtable>
  6821. <xsl:attribute name="frame">none</xsl:attribute>
  6822. <xsl:attribute name="columnlines">none</xsl:attribute>
  6823. <xsl:attribute name="rowlines">none</xsl:attribute>
  6824. <xsl:for-each select="m:e">
  6825. <mml:mtr>
  6826. <mml:mtd>
  6827. <mml:maligngroup />
  6828. <xsl:choose>
  6829. <xsl:when test="m:argPr[last()]/m:scrLvl/@m:val!='0' or
  6830. not(m:argPr[last()]/m:scrLvl/@m:val) or
  6831. m:argPr[last()]/m:scrLvl/@m:val=''">
  6832. <mml:mrow>
  6833. <xsl:call-template name="CreateEqArrRow">
  6834. <xsl:with-param name="align" select="1" />
  6835. <xsl:with-param name="ndCur" select="*[1]" />
  6836. </xsl:call-template>
  6837. </mml:mrow>
  6838. </xsl:when>
  6839. <xsl:otherwise>
  6840. <mml:mstyle>
  6841. <xsl:attribute name="scriptlevel">
  6842. <xsl:value-of select="m:argPr[last()]/m:scrLvl/@m:val" />
  6843. </xsl:attribute>
  6844. <xsl:call-template name="CreateEqArrRow">
  6845. <xsl:with-param name="align" select="1" />
  6846. <xsl:with-param name="ndCur" select="*[1]" />
  6847. </xsl:call-template>
  6848. </mml:mstyle>
  6849. </xsl:otherwise>
  6850. </xsl:choose>
  6851. </mml:mtd>
  6852. </mml:mtr>
  6853. </xsl:for-each>
  6854. </mml:mtable>
  6855. </xsl:template>
  6856. <xsl:template name="CreateEqArrRow">
  6857. <xsl:param name="align" />
  6858. <xsl:param name="ndCur" />
  6859. <xsl:variable name="sAllMt">
  6860. <xsl:for-each select="$ndCur/m:t">
  6861. <xsl:value-of select="." />
  6862. </xsl:for-each>
  6863. </xsl:variable>
  6864. <xsl:choose>
  6865. <xsl:when test="local-name($ndCur)='r' and
  6866. namespace-uri($ndCur)='http://schemas.microsoft.com/office/omml/2004/12/core'">
  6867. <xsl:call-template name="ParseEqArrMr">
  6868. <xsl:with-param name="sToParse" select="$sAllMt" />
  6869. <xsl:with-param name="mscr" select="../m:rPr[last()]/m:scr/@m:val" />
  6870. <xsl:with-param name="msty" select="../m:rPr[last()]/m:sty/@m:val" />
  6871. <xsl:with-param name="mnor" select="../m:rPr[last()]/m:nor/@m:val" />
  6872. <xsl:with-param name="align" select="$align" />
  6873. </xsl:call-template>
  6874. </xsl:when>
  6875. <xsl:otherwise>
  6876. <xsl:apply-templates select="$ndCur" />
  6877. </xsl:otherwise>
  6878. </xsl:choose>
  6879. <xsl:if test="count($ndCur/following-sibling::*) &gt; 0">
  6880. <xsl:variable name="cAmp">
  6881. <xsl:call-template name="CountAmp">
  6882. <xsl:with-param name="sAllMt" select="$sAllMt" />
  6883. <xsl:with-param name="cAmp" select="0" />
  6884. </xsl:call-template>
  6885. </xsl:variable>
  6886. <xsl:call-template name="CreateEqArrRow">
  6887. <xsl:with-param name="align" select="($align+($cAmp mod 2)) mod 2" />
  6888. <xsl:with-param name="ndCur" select="$ndCur/following-sibling::*[1]" />
  6889. </xsl:call-template>
  6890. </xsl:if>
  6891. </xsl:template>
  6892. <xsl:template name="CountAmp">
  6893. <xsl:param name="sAllMt" />
  6894. <xsl:param name="cAmp" />
  6895. <xsl:choose>
  6896. <xsl:when test="string-length(substring-after($sAllMt, '&amp;')) &gt; 0 or
  6897. substring($sAllMt, string-length($sAllMt))='&#x0026;'">
  6898. <xsl:call-template name="CountAmp">
  6899. <xsl:with-param name="sAllMt" select="substring-after($sAllMt, '&#x0026;')" />
  6900. <xsl:with-param name="cAmp" select="$cAmp+1" />
  6901. </xsl:call-template>
  6902. </xsl:when>
  6903. <xsl:otherwise>
  6904. <xsl:value-of select="$cAmp" />
  6905. </xsl:otherwise>
  6906. </xsl:choose>
  6907. </xsl:template>
  6908. <!-- %%Template: ParseEqArrMr
  6909. Similar to ParseMt, but this one has to do more for an equation
  6910. array. The presence of &amp; in a run that is in an equation array
  6911. indicates alignment
  6912. -->
  6913. <xsl:template name="ParseEqArrMr">
  6914. <xsl:param name="sToParse" />
  6915. <xsl:param name="msty" />
  6916. <xsl:param name="mscr" />
  6917. <xsl:param name="mnor" />
  6918. <xsl:param name="align" />
  6919. <xsl:if test="string-length($sToParse) &gt; 0">
  6920. <xsl:choose>
  6921. <xsl:when test="substring($sToParse,1,1) = '&amp;'">
  6922. <xsl:choose>
  6923. <xsl:when test="$align='0'">
  6924. <mml:maligngroup />
  6925. </xsl:when>
  6926. <xsl:when test="$align='1'">
  6927. <mml:malignmark>
  6928. <xsl:attribute name="edge">left</xsl:attribute>
  6929. </mml:malignmark>
  6930. </xsl:when>
  6931. </xsl:choose>
  6932. <xsl:call-template name="ParseEqArrMr">
  6933. <xsl:with-param name="sToParse" select="substring($sToParse,2)" />
  6934. <xsl:with-param name="mscr" select="$mscr" />
  6935. <xsl:with-param name="msty" select="$msty" />
  6936. <xsl:with-param name="mnor" select="$mnor" />
  6937. <xsl:with-param name="align">
  6938. <xsl:choose>
  6939. <xsl:when test="$align='1'">0</xsl:when>
  6940. <xsl:otherwise>1</xsl:otherwise>
  6941. </xsl:choose>
  6942. </xsl:with-param>
  6943. </xsl:call-template>
  6944. </xsl:when>
  6945. <xsl:otherwise>
  6946. <xsl:variable name="sRepNumWith1">
  6947. <xsl:call-template name="SReplaceNumWithOne">
  6948. <xsl:with-param name="sToParse" select="$sToParse" />
  6949. </xsl:call-template>
  6950. </xsl:variable>
  6951. <xsl:variable name="sRepOperWith-">
  6952. <xsl:call-template name="SReplaceOperWithMinus">
  6953. <xsl:with-param name="sToParse" select="$sRepNumWith1" />
  6954. </xsl:call-template>
  6955. </xsl:variable>
  6956. <xsl:variable name="iFirstOper" select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))" />
  6957. <xsl:variable name="iFirstNum" select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))" />
  6958. <xsl:variable name="iFirstAmp" select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '&#x0026;'))" />
  6959. <xsl:variable name="fNumAtPos1">
  6960. <xsl:choose>
  6961. <xsl:when test="substring($sRepOperWith-,1,1)='0'">1</xsl:when>
  6962. <xsl:otherwise>0</xsl:otherwise>
  6963. </xsl:choose>
  6964. </xsl:variable>
  6965. <xsl:variable name="fOperAtPos1">
  6966. <xsl:choose>
  6967. <xsl:when test="substring($sRepOperWith-,1,1)='-'">1</xsl:when>
  6968. <xsl:otherwise>0</xsl:otherwise>
  6969. </xsl:choose>
  6970. </xsl:variable>
  6971. <xsl:choose>
  6972. <!-- Case I: The string begins with neither a number, nor an operator -->
  6973. <xsl:when test="$fNumAtPos1='0' and $fOperAtPos1='0'">
  6974. <xsl:variable name="nCharToPrint">
  6975. <xsl:choose>
  6976. <xsl:when test="($iFirstOper=$iFirstNum) and
  6977. ($iFirstAmp=$iFirstOper) and
  6978. ($iFirstOper=string-length($sToParse)) and
  6979. $fNumAtPos1='0' and
  6980. $fOperAtPos1='0'">
  6981. <xsl:value-of select="string-length($sToParse)" />
  6982. </xsl:when>
  6983. <xsl:when test="($iFirstOper &lt; $iFirstNum) and
  6984. ($iFirstOper &lt; $iFirstAmp)">
  6985. <xsl:value-of select="$iFirstOper - 1" />
  6986. </xsl:when>
  6987. <xsl:when test="($iFirstNum &lt; $iFirstOper) and
  6988. ($iFirstNum &lt; $iFirstAmp)">
  6989. <xsl:value-of select="$iFirstNum - 1" />
  6990. </xsl:when>
  6991. <xsl:otherwise>
  6992. <xsl:value-of select="$iFirstAmp - 1" />
  6993. </xsl:otherwise>
  6994. </xsl:choose>
  6995. </xsl:variable>
  6996. <mml:mi>
  6997. <xsl:call-template name="CreateAttributesforToken">
  6998. <xsl:with-param name="mscr" select="$mscr" />
  6999. <xsl:with-param name="msty" select="$msty" />
  7000. <xsl:with-param name="mnor" select="$mnor" />
  7001. <xsl:with-param name="nCharToPrint" select="$nCharToPrint" />
  7002. <xsl:with-param name="sTokenType" select="'mi'" />
  7003. </xsl:call-template>
  7004. <xsl:value-of select="substring($sToParse,1,$nCharToPrint)" />
  7005. </mml:mi>
  7006. <xsl:call-template name="ParseEqArrMr">
  7007. <xsl:with-param name="sToParse" select="substring($sToParse, $nCharToPrint+1)" />
  7008. <xsl:with-param name="mscr" select="$mscr" />
  7009. <xsl:with-param name="msty" select="$msty" />
  7010. <xsl:with-param name="mnor" select="$mnor" />
  7011. <xsl:with-param name="align" select="$align" />
  7012. </xsl:call-template>
  7013. </xsl:when>
  7014. <!-- Case II: There is an operator at position 1 -->
  7015. <xsl:when test="$fOperAtPos1='1'">
  7016. <mml:mo>
  7017. <xsl:call-template name="CreateAttributesforToken">
  7018. <xsl:with-param name="mscr" />
  7019. <xsl:with-param name="msty" />
  7020. <xsl:with-param name="mnor" select="$mnor" />
  7021. <xsl:with-param name="sTokenType" select="'mo'" />
  7022. </xsl:call-template>
  7023. <xsl:value-of select="substring($sToParse,1,1)" />
  7024. </mml:mo>
  7025. <xsl:call-template name="ParseEqArrMr">
  7026. <xsl:with-param name="sToParse" select="substring($sToParse, 2)" />
  7027. <xsl:with-param name="mscr" select="$mscr" />
  7028. <xsl:with-param name="msty" select="$msty" />
  7029. <xsl:with-param name="mnor" select="$mnor" />
  7030. <xsl:with-param name="align" select="$align" />
  7031. </xsl:call-template>
  7032. </xsl:when>
  7033. <!-- Case III: There is a number at position 1 -->
  7034. <xsl:otherwise>
  7035. <xsl:variable name="sConsecNum">
  7036. <xsl:call-template name="SNumStart">
  7037. <xsl:with-param name="sToParse" select="$sToParse" />
  7038. <xsl:with-param name="sPattern" select="$sRepNumWith1" />
  7039. </xsl:call-template>
  7040. </xsl:variable>
  7041. <mml:mn>
  7042. <xsl:call-template name="CreateAttributesforToken">
  7043. <xsl:with-param name="mscr" />
  7044. <xsl:with-param name="msty" />
  7045. <xsl:with-param name="mnor" select="$mnor" />
  7046. <xsl:with-param name="sTokenType" select="'mn'" />
  7047. </xsl:call-template>
  7048. <xsl:value-of select="$sConsecNum" />
  7049. </mml:mn>
  7050. <xsl:call-template name="ParseEqArrMr">
  7051. <xsl:with-param name="sToParse" select="substring-after($sToParse, $sConsecNum)" />
  7052. <xsl:with-param name="mscr" select="$mscr" />
  7053. <xsl:with-param name="msty" select="$msty" />
  7054. <xsl:with-param name="mnor" select="$mnor" />
  7055. <xsl:with-param name="align" select="$align" />
  7056. </xsl:call-template>
  7057. </xsl:otherwise>
  7058. </xsl:choose>
  7059. </xsl:otherwise>
  7060. </xsl:choose>
  7061. </xsl:if>
  7062. </xsl:template>
  7063. <!-- %%Template: SNumStart
  7064. Return the longest substring of sToParse starting from the
  7065. start of sToParse that is a number. In addition, it takes the
  7066. pattern string, which is sToParse with all of its numbers
  7067. replaced with a 0. sPattern should be the same length
  7068. as sToParse
  7069. -->
  7070. <xsl:template name="SNumStart">
  7071. <xsl:param name="sToParse" select="''" />
  7072. <xsl:param name="sPattern" select="'$sToParse'"/> <!-- if we don't get anything, take the string itself -->
  7073. <xsl:choose>
  7074. <!-- the pattern says this is a number, recurse with the rest -->
  7075. <xsl:when test="substring($sPattern, 1, 1) = '1'">
  7076. <xsl:call-template name="SNumStart">
  7077. <xsl:with-param name="sToParse" select="$sToParse" />
  7078. <xsl:with-param name="sPattern" select="substring($sPattern, 2)" />
  7079. </xsl:call-template>
  7080. </xsl:when>
  7081. <!-- the pattern says we've run out of numbers. Take as many
  7082. characters from sToParse as we shaved off sPattern -->
  7083. <xsl:otherwise>
  7084. <xsl:value-of select="substring($sToParse, 1, string-length($sToParse) - string-length($sPattern))" />
  7085. </xsl:otherwise>
  7086. </xsl:choose>
  7087. </xsl:template>
  7088. <!-- %%Template: ParseMt
  7089. Produce a run of text. Technically, OMML makes no distinction
  7090. between numbers, operators, and other characters in a run. For
  7091. MathML we need to break these into mi, mn, or mo elements.
  7092. See also ParseEqArrMr
  7093. -->
  7094. <xsl:template name="ParseMt">
  7095. <xsl:param name="sToParse" />
  7096. <xsl:param name="msty" />
  7097. <xsl:param name="mscr" />
  7098. <xsl:param name="mnor" />
  7099. <xsl:if test="string-length($sToParse) &gt; 0">
  7100. <xsl:variable name="sRepNumWith1">
  7101. <xsl:call-template name="SReplaceNumWithOne">
  7102. <xsl:with-param name="sToParse" select="$sToParse" />
  7103. </xsl:call-template>
  7104. </xsl:variable>
  7105. <xsl:variable name="sRepOperWith-">
  7106. <xsl:call-template name="SReplaceOperWithMinus">
  7107. <xsl:with-param name="sToParse" select="$sRepNumWith1" />
  7108. </xsl:call-template>
  7109. </xsl:variable>
  7110. <xsl:variable name="iFirstOper" select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '-'))" />
  7111. <xsl:variable name="iFirstNum" select="string-length($sRepOperWith-) - string-length(substring-after($sRepOperWith-, '0'))" />
  7112. <xsl:variable name="fNumAtPos1">
  7113. <xsl:choose>
  7114. <xsl:when test="substring($sRepOperWith-,1,1)='1'">1</xsl:when>
  7115. <xsl:otherwise>0</xsl:otherwise>
  7116. </xsl:choose>
  7117. </xsl:variable>
  7118. <xsl:variable name="fOperAtPos1">
  7119. <xsl:choose>
  7120. <xsl:when test="substring($sRepOperWith-,1,1)='-'">1</xsl:when>
  7121. <xsl:otherwise>0</xsl:otherwise>
  7122. </xsl:choose>
  7123. </xsl:variable>
  7124. <xsl:choose>
  7125. <!-- Case I: The string begins with neither a number, nor an operator -->
  7126. <xsl:when test="$fOperAtPos1='0' and $fNumAtPos1='0'">
  7127. <xsl:variable name="nCharToPrint">
  7128. <xsl:choose>
  7129. <xsl:when test="($iFirstOper=$iFirstNum) and
  7130. ($iFirstOper=string-length($sToParse)) and
  7131. (substring($sRepOperWith-, string-length($sRepOperWith-))!='0') and
  7132. (substring($sRepOperWith-, string-length($sRepOperWith-))!='-')">
  7133. <xsl:value-of select="string-length($sToParse)" />
  7134. </xsl:when>
  7135. <xsl:when test="$iFirstOper &lt; $iFirstNum">
  7136. <xsl:value-of select="$iFirstOper - 1" />
  7137. </xsl:when>
  7138. <xsl:otherwise>
  7139. <xsl:value-of select="$iFirstNum - 1" />
  7140. </xsl:otherwise>
  7141. </xsl:choose>
  7142. </xsl:variable>
  7143. <mml:mi>
  7144. <xsl:call-template name="CreateAttributesforToken">
  7145. <xsl:with-param name="mscr" select="$mscr" />
  7146. <xsl:with-param name="msty" select="$msty" />
  7147. <xsl:with-param name="mnor" select="$mnor" />
  7148. <xsl:with-param name="nCharToPrint" select="$nCharToPrint" />
  7149. <xsl:with-param name="sTokenType" select="'mi'" />
  7150. </xsl:call-template>
  7151. <xsl:value-of select="translate(substring($sToParse,1,$nCharToPrint),' ','&nbsp;')" />
  7152. </mml:mi>
  7153. <xsl:call-template name="ParseMt">
  7154. <xsl:with-param name="sToParse" select="substring($sToParse, $nCharToPrint+1)" />
  7155. <xsl:with-param name="mscr" select="$mscr" />
  7156. <xsl:with-param name="msty" select="$msty" />
  7157. <xsl:with-param name="mnor" select="$mnor" />
  7158. </xsl:call-template>
  7159. </xsl:when>
  7160. <!-- Case II: There is an operator at position 1 -->
  7161. <xsl:when test="$fOperAtPos1='1'">
  7162. <mml:mo>
  7163. <xsl:call-template name="CreateAttributesforToken">
  7164. <xsl:with-param name="mscr" />
  7165. <xsl:with-param name="msty" />
  7166. <xsl:with-param name="mnor" select="$mnor" />
  7167. <xsl:with-param name="sTokenType" select="'mo'" />
  7168. </xsl:call-template>
  7169. <xsl:value-of select="substring($sToParse,1,1)" />
  7170. </mml:mo>
  7171. <xsl:call-template name="ParseMt">
  7172. <xsl:with-param name="sToParse" select="substring($sToParse, 2)" />
  7173. <xsl:with-param name="mscr" select="$mscr" />
  7174. <xsl:with-param name="msty" select="$msty" />
  7175. <xsl:with-param name="mnor" select="$mnor" />
  7176. </xsl:call-template>
  7177. </xsl:when>
  7178. <!-- Case III: There is a number at position 1 -->
  7179. <xsl:otherwise>
  7180. <xsl:variable name="sConsecNum">
  7181. <xsl:call-template name="SNumStart">
  7182. <xsl:with-param name="sToParse" select="$sToParse" />
  7183. <xsl:with-param name="sPattern" select="$sRepNumWith1" />
  7184. </xsl:call-template>
  7185. </xsl:variable>
  7186. <mml:mn>
  7187. <xsl:call-template name="CreateAttributesforToken">
  7188. <xsl:with-param name="mscr" select="$mscr" />
  7189. <xsl:with-param name="msty" select="'p'" />
  7190. <xsl:with-param name="mnor" select="$mnor" />
  7191. <xsl:with-param name="sTokenType" select="'mn'" />
  7192. </xsl:call-template>
  7193. <xsl:value-of select="$sConsecNum" />
  7194. </mml:mn>
  7195. <xsl:call-template name="ParseMt">
  7196. <xsl:with-param name="sToParse" select="substring-after($sToParse, $sConsecNum)" />
  7197. <xsl:with-param name="mscr" select="$mscr" />
  7198. <xsl:with-param name="msty" select="$msty" />
  7199. <xsl:with-param name="mnor" select="$mnor" />
  7200. </xsl:call-template>
  7201. </xsl:otherwise>
  7202. </xsl:choose>
  7203. </xsl:if>
  7204. </xsl:template>
  7205. <!-- %%Template SReplaceOperWithMinus
  7206. Go through the given string and replace every instance
  7207. of an operator with a minus '-'. This helps quickly identify
  7208. the first instance of an operator.
  7209. -->
  7210. <xsl:template name="SReplaceOperWithMinus">
  7211. <xsl:param name="sToParse" select="''" />
  7212. <xsl:value-of select="translate($sToParse, $sOperators, $sMinuses)" />
  7213. </xsl:template>
  7214. <!-- %%Template SRepeatCharAcc
  7215. The core of SRepeatChar with an accumulator. The current
  7216. string is in param $acc, and we will double and recurse,
  7217. if we're less than half of the required length or else just
  7218. add the right amount of characters to the accumulator and
  7219. return
  7220. -->
  7221. <xsl:template name="SRepeatCharAcc">
  7222. <xsl:param name="cchRequired" select="1" />
  7223. <xsl:param name="ch" select="'-'" />
  7224. <xsl:param name="acc" select="$ch" />
  7225. <xsl:variable name="cchAcc" select="string-length($acc)" />
  7226. <xsl:choose>
  7227. <xsl:when test="(2 * $cchAcc) &lt; $cchRequired">
  7228. <xsl:call-template name="SRepeatCharAcc">
  7229. <xsl:with-param name="cchRequired" select="$cchRequired" />
  7230. <xsl:with-param name="ch" select="$ch" />
  7231. <xsl:with-param name="acc" select="concat($acc, $acc)" />
  7232. </xsl:call-template>
  7233. </xsl:when>
  7234. <xsl:otherwise>
  7235. <xsl:value-of select="concat($acc, substring($acc, 1, $cchRequired - $cchAcc))" />
  7236. </xsl:otherwise>
  7237. </xsl:choose>
  7238. </xsl:template>
  7239. <!-- %%Template SRepeatChar
  7240. Generates a string nchRequired long by repeating the given character ch
  7241. -->
  7242. <xsl:template name="SRepeatChar">
  7243. <xsl:param name="cchRequired" select="1" />
  7244. <xsl:param name="ch" select="'-'" />
  7245. <xsl:call-template name="SRepeatCharAcc">
  7246. <xsl:with-param name="cchRequired" select="$cchRequired" />
  7247. <xsl:with-param name="ch" select="$ch" />
  7248. <xsl:with-param name="acc" select="$ch" />
  7249. </xsl:call-template>
  7250. </xsl:template>
  7251. <!-- %%Template SReplaceNumWithOne
  7252. Go through the given string and replace every instance
  7253. of an number with a One '1'. This helps quickly identify
  7254. the first occurence of a number.
  7255. Considers the '.' and ',' part of a number iff they are sandwiched
  7256. between two other numbers. 1.3 will be recognized as a number,
  7257. x.3 will not be. Since these characters can also be an operator, this
  7258. should be called before SReplaceOperWithMinus.
  7259. -->
  7260. <xsl:template name="SReplaceNumWithOne">
  7261. <xsl:param name="sToParse" select="''" />
  7262. <!-- First do a simple replace. Numbers will all be come 0's.
  7263. After this point, the pattern involving the . or , that
  7264. we are looking for will become 1.1 or 1,1 -->
  7265. <xsl:variable name="sSimpleReplace" select="translate($sToParse, $sNumbers, $sOnes)" />
  7266. <!-- And then, replace 1.1 with just 111. This means that the . will
  7267. become part of the number -->
  7268. <xsl:variable name="sReplacePeriod">
  7269. <xsl:call-template name="SReplace">
  7270. <xsl:with-param name="sInput" select="$sSimpleReplace"/>
  7271. <xsl:with-param name="sOrig" select="'1.1'"/>
  7272. <xsl:with-param name="sReplacement" select="'111'"/>
  7273. </xsl:call-template>
  7274. </xsl:variable>
  7275. <!-- And then, replace 1,1 with just 111. This means that the , will
  7276. become part of the number -->
  7277. <xsl:call-template name="SReplace">
  7278. <xsl:with-param name="sInput" select="$sReplacePeriod"/>
  7279. <xsl:with-param name="sOrig" select="'1,1'"/>
  7280. <xsl:with-param name="sReplacement" select="'111'"/>
  7281. </xsl:call-template>
  7282. </xsl:template>
  7283. <xsl:template match="m:m">
  7284. <mml:mtable>
  7285. <xsl:call-template name="CreateMathMLMatrixAttr">
  7286. <xsl:with-param name="mcJc" select="m:mPr[last()]/m:mcs/m:mc/m:mcPr[last()]/m:mcJc/@m:val" />
  7287. </xsl:call-template>
  7288. <xsl:for-each select="m:mr">
  7289. <mml:mtr>
  7290. <xsl:for-each select="m:e">
  7291. <mml:mtd>
  7292. <xsl:apply-templates select="." />
  7293. </mml:mtd>
  7294. </xsl:for-each>
  7295. </mml:mtr>
  7296. </xsl:for-each>
  7297. </mml:mtable>
  7298. </xsl:template>
  7299. <xsl:template name="CreateMathMLMatrixAttr">
  7300. <xsl:param name="mcJc" />
  7301. <xsl:variable name="sLowerCaseMcjc" select="translate($mcJc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7302. 'abcdefghijklmnopqrstuvwxyz')" />
  7303. <xsl:choose>
  7304. <xsl:when test="$sLowerCaseMcjc='left'">
  7305. <xsl:attribute name="columnalign">left</xsl:attribute>
  7306. </xsl:when>
  7307. <xsl:when test="$sLowerCaseMcjc='right'">
  7308. <xsl:attribute name="columnalign">right</xsl:attribute>
  7309. </xsl:when>
  7310. </xsl:choose>
  7311. </xsl:template>
  7312. <xsl:template match="m:limLow">
  7313. <mml:munder>
  7314. <mml:mrow>
  7315. <xsl:apply-templates select="m:e[1]" />
  7316. </mml:mrow>
  7317. <mml:mrow>
  7318. <xsl:apply-templates select="m:lim[1]" />
  7319. </mml:mrow>
  7320. </mml:munder>
  7321. </xsl:template>
  7322. <xsl:template match="m:limUpp">
  7323. <mml:mover>
  7324. <mml:mrow>
  7325. <xsl:apply-templates select="m:e[1]" />
  7326. </mml:mrow>
  7327. <mml:mrow>
  7328. <xsl:apply-templates select="m:lim[1]" />
  7329. </mml:mrow>
  7330. </mml:mover>
  7331. </xsl:template>
  7332. <xsl:template match="m:rad">
  7333. <xsl:variable name="sLowerCaseDegHide" select="translate(m:radPr[last()]/m:degHide/@m:val,
  7334. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7335. 'abcdefghijklmnopqrstuvwxyz')" />
  7336. <xsl:choose>
  7337. <xsl:when test="$sLowerCaseDegHide='on'">
  7338. <mml:msqrt>
  7339. <xsl:apply-templates select="m:e[1]" />
  7340. </mml:msqrt>
  7341. </xsl:when>
  7342. <xsl:otherwise>
  7343. <mml:mroot>
  7344. <mml:mrow>
  7345. <xsl:apply-templates select="m:e[1]" />
  7346. </mml:mrow>
  7347. <mml:mrow>
  7348. <xsl:apply-templates select="m:deg[1]" />
  7349. </mml:mrow>
  7350. </mml:mroot>
  7351. </xsl:otherwise>
  7352. </xsl:choose>
  7353. </xsl:template>
  7354. <xsl:template match="m:acc">
  7355. <mml:mover>
  7356. <xsl:attribute name="accent">true</xsl:attribute>
  7357. <xsl:apply-templates select="m:e[1]" />
  7358. <mml:mtext>
  7359. <xsl:call-template name="CreateAttributesforToken">
  7360. <xsl:with-param name="mscr" select="m:e[1]/*/m:rPr[last()]/m:scr/@m:val" />
  7361. <xsl:with-param name="msty" select="m:e[1]/*/m:rPr[last()]/m:sty/@m:val" />
  7362. <xsl:with-param name="mnor" select="m:e[1]/*/m:rPr[last()]/m:nor/@m:val" />
  7363. </xsl:call-template>
  7364. <xsl:choose>
  7365. <xsl:when test="not(m:accPr[last()]/m:chr)">
  7366. <xsl:value-of select="'&#x0302;'" />
  7367. </xsl:when>
  7368. <xsl:otherwise>
  7369. <xsl:value-of select="substring(m:accPr/m:chr/@m:val,1,1)" />
  7370. </xsl:otherwise>
  7371. </xsl:choose>
  7372. </mml:mtext>
  7373. </mml:mover>
  7374. </xsl:template>
  7375. <xsl:template match="m:sPre">
  7376. <mml:mmultiscripts>
  7377. <mml:mrow>
  7378. <xsl:apply-templates select="m:e[1]" />
  7379. </mml:mrow>
  7380. <mml:mprescripts />
  7381. <mml:mrow>
  7382. <xsl:apply-templates select="m:sub[1]" />
  7383. </mml:mrow>
  7384. <mml:mrow>
  7385. <xsl:apply-templates select="m:sup[1]" />
  7386. </mml:mrow>
  7387. </mml:mmultiscripts>
  7388. </xsl:template>
  7389. <!-- Fixex -->
  7390. <!-- avoid printing fnames twice -->
  7391. <xsl:template match="m:func">
  7392. <mml:mrow>
  7393. <mml:mrow>
  7394. <xsl:apply-templates select="m:fName[1]/*" />
  7395. </mml:mrow>
  7396. <mml:mo></mml:mo>
  7397. <xsl:apply-templates select="m:fName[1]/following-sibling::*" />
  7398. </mml:mrow>
  7399. </xsl:template>
  7400. <!-- m:r reconstituted from Word comments don't have character data in m:t it is directly i m:r (and style information is in interleaved span and i elements, weird but true -->
  7401. <xsl:template match="m:r[not(.//m:t)]">
  7402. <xsl:for-each select=".//text()[translate(.,' &#10;&amp;','')]">
  7403. <xsl:call-template name="ParseMt">
  7404. <xsl:with-param name="sToParse" select="translate(.,' &#10;&amp;','')" />
  7405. <xsl:with-param name="mscr" select="../m:rPr[last()]/m:scr/@m:val" />
  7406. <xsl:with-param name="msty" select="../m:rPr[last()]/m:sty/@m:val" />
  7407. <xsl:with-param name="mnor" select="../m:rPr[last()]/m:nor/@m:val" />
  7408. </xsl:call-template>
  7409. </xsl:for-each>
  7410. </xsl:template>
  7411. <!--
  7412. MS stylesheet uses DOE which is (a) unevil, (b) non necessary, and (c) breaks the pass through a temporay tree to get rid of namespace nodes.
  7413. repeat the templates here without doe (and without double quoting amp)
  7414. -->
  7415. <xsl:template match="m:nary">
  7416. <xsl:variable name="sLowerCaseSubHide">
  7417. <xsl:choose>
  7418. <xsl:when test="count(m:naryPr[last()]/m:subHide) = 0">
  7419. <xsl:text>off</xsl:text>
  7420. </xsl:when>
  7421. <xsl:otherwise>
  7422. <xsl:value-of select="translate(m:naryPr[last()]/m:subHide/@m:val,
  7423. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7424. 'abcdefghijklmnopqrstuvwxyz')" />
  7425. </xsl:otherwise>
  7426. </xsl:choose>
  7427. </xsl:variable>
  7428. <xsl:variable name="sLowerCaseSupHide">
  7429. <xsl:choose>
  7430. <xsl:when test="count(m:naryPr[last()]/m:supHide) = 0">
  7431. <xsl:text>off</xsl:text>
  7432. </xsl:when>
  7433. <xsl:otherwise>
  7434. <xsl:value-of select="translate(m:naryPr[last()]/m:supHide/@m:val,
  7435. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7436. 'abcdefghijklmnopqrstuvwxyz')" />
  7437. </xsl:otherwise>
  7438. </xsl:choose>
  7439. </xsl:variable>
  7440. <xsl:choose>
  7441. <xsl:when test="not($sLowerCaseSupHide='off') and
  7442. not($sLowerCaseSubHide='off')">
  7443. <mml:mo>
  7444. <xsl:choose>
  7445. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7446. m:naryPr[last()]/m:chr/@m:val=''">
  7447. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7448. </xsl:when>
  7449. <xsl:otherwise>
  7450. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7451. </xsl:otherwise>
  7452. </xsl:choose>
  7453. </mml:mo>
  7454. </xsl:when>
  7455. <xsl:when test="not($sLowerCaseSubHide='off')">
  7456. <xsl:choose>
  7457. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  7458. <mml:msup>
  7459. <mml:mo>
  7460. <xsl:choose>
  7461. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7462. m:naryPr[last()]/m:chr/@m:val=''">
  7463. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7464. </xsl:when>
  7465. <xsl:otherwise>
  7466. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7467. </xsl:otherwise>
  7468. </xsl:choose>
  7469. </mml:mo>
  7470. <xsl:apply-templates select="m:sup[1]" />
  7471. </mml:msup>
  7472. </xsl:when>
  7473. <xsl:otherwise>
  7474. <mml:mover>
  7475. <mml:mo>
  7476. <xsl:choose>
  7477. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7478. m:naryPr[last()]/m:chr/@m:val=''">
  7479. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7480. </xsl:when>
  7481. <xsl:otherwise>
  7482. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7483. </xsl:otherwise>
  7484. </xsl:choose>
  7485. </mml:mo>
  7486. <xsl:apply-templates select="m:sup[1]" />
  7487. </mml:mover>
  7488. </xsl:otherwise>
  7489. </xsl:choose>
  7490. </xsl:when>
  7491. <xsl:when test="not($sLowerCaseSupHide='off')">
  7492. <xsl:choose>
  7493. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  7494. <mml:msub>
  7495. <mml:mo>
  7496. <xsl:choose>
  7497. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7498. m:naryPr[last()]/m:chr/@m:val=''">
  7499. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7500. </xsl:when>
  7501. <xsl:otherwise>
  7502. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7503. </xsl:otherwise>
  7504. </xsl:choose>
  7505. </mml:mo>
  7506. <xsl:apply-templates select="m:sub[1]" />
  7507. </mml:msub>
  7508. </xsl:when>
  7509. <xsl:otherwise>
  7510. <mml:munder>
  7511. <mml:mo>
  7512. <xsl:choose>
  7513. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7514. m:naryPr[last()]/m:chr/@m:val=''">
  7515. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7516. </xsl:when>
  7517. <xsl:otherwise>
  7518. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7519. </xsl:otherwise>
  7520. </xsl:choose>
  7521. </mml:mo>
  7522. <xsl:apply-templates select="m:sub[1]" />
  7523. </mml:munder>
  7524. </xsl:otherwise>
  7525. </xsl:choose>
  7526. </xsl:when>
  7527. <xsl:otherwise>
  7528. <xsl:choose>
  7529. <xsl:when test="m:naryPr[last()]/m:limLoc/@m:val='subSup'">
  7530. <mml:msubsup>
  7531. <mml:mo>
  7532. <xsl:choose>
  7533. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7534. m:naryPr[last()]/m:chr/@m:val=''">
  7535. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7536. </xsl:when>
  7537. <xsl:otherwise>
  7538. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7539. </xsl:otherwise>
  7540. </xsl:choose>
  7541. </mml:mo>
  7542. <xsl:apply-templates select="m:sub[1]" />
  7543. <xsl:apply-templates select="m:sup[1]" />
  7544. </mml:msubsup>
  7545. </xsl:when>
  7546. <xsl:otherwise>
  7547. <mml:munderover>
  7548. <mml:mo>
  7549. <xsl:choose>
  7550. <xsl:when test="not(m:naryPr[last()]/m:chr/@m:val) or
  7551. m:naryPr[last()]/m:chr/@m:val=''">
  7552. <xsl:text disable-output-escaping="no">&#x222b;</xsl:text>
  7553. </xsl:when>
  7554. <xsl:otherwise>
  7555. <xsl:value-of select="m:naryPr[last()]/m:chr/@m:val" />
  7556. </xsl:otherwise>
  7557. </xsl:choose>
  7558. </mml:mo>
  7559. <xsl:apply-templates select="m:sub[1]" />
  7560. <xsl:apply-templates select="m:sup[1]" />
  7561. </mml:munderover>
  7562. </xsl:otherwise>
  7563. </xsl:choose>
  7564. </xsl:otherwise>
  7565. </xsl:choose>
  7566. <mml:mrow>
  7567. <xsl:apply-templates select="m:e[1]" />
  7568. </mml:mrow>
  7569. </xsl:template>
  7570. <xsl:template name="CreateGroupChr">
  7571. <xsl:variable name="sLowerCasePos" select="translate(m:groupChrPr[last()]/m:pos/@m:val,
  7572. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7573. 'abcdefghijklmnopqrstuvwxyz')" />
  7574. <xsl:choose>
  7575. <xsl:when test="$sLowerCasePos!='top' or
  7576. not(m:groupChrPr[last()]/m:pos/@m:val) or
  7577. m:groupChrPr[last()]/m:pos/@m:val=''">
  7578. <mml:munder>
  7579. <xsl:apply-templates select="m:e[1]" />
  7580. <mml:mo>
  7581. <xsl:choose>
  7582. <xsl:when test="string-length(m:groupChrPr[last()]/m:chr/@m:val) &gt;= 1">
  7583. <xsl:value-of select="substring(m:groupChrPr[last()]/m:chr/@m:val,1,1)" />
  7584. </xsl:when>
  7585. <xsl:otherwise>
  7586. <xsl:text disable-output-escaping="no">&#x023DF;</xsl:text>
  7587. </xsl:otherwise>
  7588. </xsl:choose>
  7589. </mml:mo>
  7590. </mml:munder>
  7591. </xsl:when>
  7592. <xsl:otherwise>
  7593. <mml:mover>
  7594. <xsl:apply-templates select="m:e[1]" />
  7595. <mml:mo>
  7596. <xsl:choose>
  7597. <xsl:when test="string-length(m:groupChrPr[last()]/m:chr/@m:val) &gt;= 1">
  7598. <xsl:value-of select="substring(m:groupChrPr[last()]/m:chr/@m:val,1,1)" />
  7599. </xsl:when>
  7600. <xsl:otherwise>
  7601. <xsl:text disable-output-escaping="no">&#x023DF;</xsl:text>
  7602. </xsl:otherwise>
  7603. </xsl:choose>
  7604. </mml:mo>
  7605. </mml:mover>
  7606. </xsl:otherwise>
  7607. </xsl:choose>
  7608. </xsl:template>
  7609. <xsl:template match="m:bar">
  7610. <xsl:variable name="sLowerCasePos" select="translate(m:barPr/m:pos/@m:val, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7611. 'abcdefghijklmnopqrstuvwxyz')" />
  7612. <xsl:choose>
  7613. <xsl:when test="$sLowerCasePos!='bot' or
  7614. not($sLowerCasePos) or
  7615. $sLowerCasePos='' ">
  7616. <mml:mover>
  7617. <xsl:attribute name="accent">true</xsl:attribute>
  7618. <xsl:apply-templates select="m:e[1]" />
  7619. <mml:mo>
  7620. <xsl:text disable-output-escaping="no">&#x000AF;</xsl:text>
  7621. </mml:mo>
  7622. </mml:mover>
  7623. </xsl:when>
  7624. <xsl:otherwise>
  7625. <mml:munder>
  7626. <xsl:apply-templates select="m:e[1]" />
  7627. <mml:mo>
  7628. <xsl:text disable-output-escaping="no">&#x00332;</xsl:text>
  7629. </mml:mo>
  7630. </mml:munder>
  7631. </xsl:otherwise>
  7632. </xsl:choose>
  7633. </xsl:template>
  7634. <!-- wrong name for (m)phantom -->
  7635. <xsl:template match="m:phant">
  7636. <xsl:variable name="sLowerCaseWidth" select="translate(m:phantPr[last()]/m:width/@m:val,
  7637. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7638. 'abcdefghijklmnopqrstuvwxyz')" />
  7639. <xsl:variable name="sLowerCaseAsc" select="translate(m:phantPr[last()]/m:asc/@m:val,
  7640. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7641. 'abcdefghijklmnopqrstuvwxyz')" />
  7642. <xsl:variable name="sLowerCaseDec" select="translate(m:phantPr[last()]/m:dec/@m:val,
  7643. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  7644. 'abcdefghijklmnopqrstuvwxyz')" />
  7645. <xsl:if test="not($sLowerCaseWidth='off' and
  7646. $sLowerCaseAsc='off' and
  7647. $sLowerCaseDec='off')">
  7648. <mml:mphantom>
  7649. <xsl:apply-templates select="m:e[1]" />
  7650. </mml:mphantom>
  7651. </xsl:if>
  7652. </xsl:template>
  7653. <!--TEMPLATES NEWLY ADDED-->
  7654. <xsl:template match="m:oMath">
  7655. <xsl:variable name="varAlign">
  7656. <xsl:value-of select="preceding-sibling::m:oMathParaPr/m:jc/@m:val"/></xsl:variable>
  7657. <xsl:variable name="spStyle">
  7658. <xsl:choose>
  7659. <xsl:when test="((parent::m:oMathPara) and not(preceding-sibling::m:oMathParaPr))">
  7660. display:block;
  7661. </xsl:when>
  7662. <xsl:otherwise>
  7663. </xsl:otherwise>
  7664. </xsl:choose>
  7665. font-family:<xsl:value-of select=".//w:rPr[last()]/w:rFonts/@w:ascii"/>;
  7666. font-size:<xsl:value-of select=".//w:rPr[last()]/w:sz/@w:val div 2"/>pt;
  7667. <xsl:choose>
  7668. <xsl:when test="string-length(.//w:rPr[last()]/w:color/@w:val) = 0">
  7669. color:<xsl:call-template name="ConvHexColor">
  7670. <xsl:with-param name="value" select="ancestor::w:p/w:pPr/w:rPr[last()]/w:color/@w:val"/>
  7671. </xsl:call-template>;
  7672. </xsl:when>
  7673. <xsl:otherwise>
  7674. color:<xsl:call-template name="ConvHexColor">
  7675. <xsl:with-param name="value" select=".//w:rPr[last()]/w:color/@w:val"/>
  7676. </xsl:call-template>;
  7677. </xsl:otherwise>
  7678. </xsl:choose>
  7679. <xsl:choose>
  7680. <xsl:when test="string-length(.//w:rPr[last()]/w:highlight/@w:val) = 0">
  7681. background-color:<xsl:call-template name="ConvColor">
  7682. <xsl:with-param name="value" select="ancestor::w:p/w:pPr/w:rPr[last()]/w:hightlight/@w:val"/>
  7683. </xsl:call-template>;
  7684. </xsl:when>
  7685. <xsl:otherwise>
  7686. background-color:<xsl:call-template name="ConvColor">
  7687. <xsl:with-param name="value" select=".//w:rPr[last()]/w:highlight/@w:val"/>
  7688. </xsl:call-template>;
  7689. </xsl:otherwise>
  7690. </xsl:choose>
  7691. <xsl:choose>
  7692. <xsl:when test="string-length(.//w:rPr[last()]/w:u[1]/@w:val) = 0 or .//w:rPr[last()]/w:u[1]/@w:val = 'off' or .//w:rPr[last()]/w:u[1]/@w:val = 'none' or .//w:rPr[last()]/w:u[1]/@w:val = '0' ">
  7693. text-decoration:none;
  7694. </xsl:when>
  7695. <xsl:otherwise>
  7696. text-decoration:underline;
  7697. </xsl:otherwise>
  7698. </xsl:choose>
  7699. text-align:<xsl:value-of select="$varAlign"></xsl:value-of>;
  7700. </xsl:variable>
  7701. <xsl:choose>
  7702. <xsl:when test="(parent::m:oMathPara) and not(preceding-sibling::m:oMathParaPr)">
  7703. <span style="{$spStyle}">
  7704. <mml:math display="block">
  7705. <xsl:apply-templates select="*"/>
  7706. </mml:math>
  7707. </span>
  7708. </xsl:when>
  7709. <xsl:otherwise>
  7710. <div align="{$varAlign}">
  7711. <span style="{$spStyle}">
  7712. <mml:math>
  7713. <xsl:apply-templates select="*"/>
  7714. </mml:math>
  7715. </span>
  7716. </div>
  7717. </xsl:otherwise>
  7718. </xsl:choose>
  7719. </xsl:template>
  7720. <!--ADDED FOR MATHML SUPPORT BY SHUBHA align="{$varAlign}" -->
  7721. <xsl:template match="m:t">
  7722. <xsl:choose>
  7723. <xsl:when test="/@xml:space">
  7724. &#160;
  7725. </xsl:when>
  7726. </xsl:choose>
  7727. <xsl:apply-templates select="*"/>
  7728. </xsl:template>
  7729. </xsl:stylesheet>