pagesetup.xsl 157 KB

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