1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234 |
- <?xml version='1.0'?>
- <!DOCTYPE xsl:stylesheet [
- <!ENTITY comment.block.parents "parent::answer|parent::appendix|parent::article|parent::bibliodiv|
- parent::bibliography|parent::blockquote|parent::caution|parent::chapter|
- parent::glossary|parent::glossdiv|parent::important|parent::index|
- parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|
- parent::partintro|parent::preface|parent::procedure|parent::qandadiv|
- parent::qandaset|parent::question|parent::refentry|parent::refnamediv|
- parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|
- parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|
- parent::sect5|parent::section|parent::setindex|parent::sidebar|
- parent::simplesect|parent::taskprerequisites|parent::taskrelated|
- parent::tasksummary|parent::warning">
- ]>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:xlink='http://www.w3.org/1999/xlink'
- exclude-result-prefixes="xlink"
- version='1.0'>
- <!-- ********************************************************************
- $Id$
- ********************************************************************
- This file is part of the XSL DocBook Stylesheet distribution.
- See ../README or http://docbook.sf.net/release/xsl/current/ for
- copyright and other information.
- ******************************************************************** -->
- <xsl:template name="simple.xlink">
- <xsl:param name="node" select="."/>
- <xsl:param name="content">
- <xsl:apply-templates/>
- </xsl:param>
- <xsl:param name="linkend" select="$node/@linkend"/>
- <xsl:param name="xhref" select="$node/@xlink:href"/>
- <xsl:choose>
- <xsl:when test="$xhref
- and (not($node/@xlink:type) or
- $node/@xlink:type='simple')">
- <!-- Is it a local idref? -->
- <xsl:variable name="is.idref">
- <xsl:choose>
- <!-- if the href starts with # and does not contain an "(" -->
- <!-- or if the href starts with #xpointer(id(, it's just an ID -->
- <xsl:when test="starts-with($xhref,'#')
- and (not(contains($xhref,'('))
- or starts-with($xhref,
- '#xpointer(id('))">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Is it an olink ? -->
- <xsl:variable name="is.olink">
- <xsl:choose>
- <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
- <!-- and if the href contains # -->
- <xsl:when test="contains($xhref,'#') and
- @xlink:role = $xolink.role">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$is.idref = 1">
- <xsl:variable name="idref">
- <xsl:call-template name="xpointer.idref">
- <xsl:with-param name="xpointer" select="$xhref"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="targets" select="key('id',$idref)"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:call-template name="check.id.unique">
- <xsl:with-param name="linkend" select="$idref"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="count($target) = 0">
- <xsl:message>
- <xsl:text>XLink to nonexistent id: </xsl:text>
- <xsl:value-of select="$idref"/>
- </xsl:message>
- <xsl:copy-of select="$content"/>
- </xsl:when>
- <xsl:otherwise>
- <fo:basic-link internal-destination="{$idref}">
- <xsl:copy-of select="$content"/>
- </fo:basic-link>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$is.olink = 1">
- <xsl:call-template name="olink">
- <xsl:with-param name="content" select="$content"/>
- </xsl:call-template>
- </xsl:when>
- <!-- otherwise it's a URI -->
- <xsl:otherwise>
- <fo:basic-link external-destination="url({$xhref})">
- <xsl:copy-of select="$content"/>
- </fo:basic-link>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$linkend">
- <xsl:variable name="targets" select="key('id',$linkend)"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:call-template name="check.id.unique">
- <xsl:with-param name="linkend" select="$linkend"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="count($target) = 0">
- <xsl:message>
- <xsl:text>XLink to nonexistent id: </xsl:text>
- <xsl:value-of select="$linkend"/>
- </xsl:message>
- <xsl:copy-of select="$content"/>
- </xsl:when>
- <xsl:otherwise>
- <fo:basic-link internal-destination="{$linkend}">
- <xsl:copy-of select="$content"/>
- </fo:basic-link>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="inline.charseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <xsl:choose>
- <xsl:when test="@dir">
- <fo:inline>
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="inline.monoseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline xsl:use-attribute-sets="monospace.properties">
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.boldseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline font-weight="bold">
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.italicseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline font-style="italic">
- <xsl:call-template name="anchor"/>
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.boldmonoseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline font-weight="bold" xsl:use-attribute-sets="monospace.properties">
- <xsl:call-template name="anchor"/>
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.italicmonoseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline font-style="italic" xsl:use-attribute-sets="monospace.properties">
- <xsl:call-template name="anchor"/>
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.superscriptseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline xsl:use-attribute-sets="superscript.properties">
- <xsl:call-template name="anchor"/>
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$fop.extensions != 0">
- <xsl:attribute name="vertical-align">super</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="baseline-shift">super</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <xsl:template name="inline.subscriptseq">
- <xsl:param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:param>
- <fo:inline xsl:use-attribute-sets="subscript.properties">
- <xsl:call-template name="anchor"/>
- <xsl:if test="@dir">
- <xsl:attribute name="direction">
- <xsl:choose>
- <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
- <xsl:otherwise>rtl</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$fop.extensions != 0">
- <xsl:attribute name="vertical-align">sub</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="baseline-shift">sub</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:copy-of select="$content"/>
- </fo:inline>
- </xsl:template>
- <!-- ==================================================================== -->
- <!-- some special cases -->
- <xsl:template match="author">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:call-template name="person.name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="editor">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:call-template name="person.name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="othercredit">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:call-template name="person.name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="authorinitials">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="accel">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="action">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="application">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="classname">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="exceptionname">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="interfacename">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="methodname">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="command">
- <xsl:call-template name="inline.boldseq"/>
- </xsl:template>
- <xsl:template match="computeroutput">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="constant">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="database">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="date">
- <!-- should this support locale-specific formatting? how? -->
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="errorcode">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="errorname">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="errortype">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="errortext">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="envar">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="filename">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="function">
- <xsl:choose>
- <xsl:when test="$function.parens != '0'
- and (parameter or function or replaceable)">
- <xsl:variable name="nodes" select="text()|*"/>
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates select="$nodes[1]"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="$nodes[position()>1]"/>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.monoseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="function/parameter" priority="2">
- <xsl:call-template name="inline.italicmonoseq"/>
- <xsl:if test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="function/replaceable" priority="2">
- <xsl:call-template name="inline.italicmonoseq"/>
- <xsl:if test="following-sibling::*">
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="guibutton">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="guiicon">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="guilabel">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="guimenu">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="guimenuitem">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="guisubmenu">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="hardware">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="interface">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="interfacedefinition">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="keycap">
- <xsl:call-template name="inline.boldseq"/>
- </xsl:template>
- <xsl:template match="keycode">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="keysym">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="literal">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="code">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="medialabel">
- <xsl:call-template name="inline.italicseq"/>
- </xsl:template>
- <xsl:template match="shortcut">
- <xsl:call-template name="inline.boldseq"/>
- </xsl:template>
- <xsl:template match="mousebutton">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="option">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="package">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="parameter">
- <xsl:call-template name="inline.italicmonoseq"/>
- </xsl:template>
- <xsl:template match="property">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="prompt">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="replaceable">
- <xsl:call-template name="inline.italicmonoseq"/>
- </xsl:template>
- <xsl:template match="returnvalue">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="structfield">
- <xsl:call-template name="inline.italicmonoseq"/>
- </xsl:template>
- <xsl:template match="structname">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="symbol">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="systemitem">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="token">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="type">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="userinput">
- <xsl:call-template name="inline.boldmonoseq"/>
- </xsl:template>
- <xsl:template match="abbrev">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="acronym">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="citerefentry">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="citetitle">
- <xsl:choose>
- <xsl:when test="@pubwork = 'article'">
- <xsl:call-template name="gentext.startquote"/>
- <xsl:call-template name="inline.charseq"/>
- <xsl:call-template name="gentext.endquote"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="emphasis">
- <xsl:variable name="depth">
- <xsl:call-template name="dot.count">
- <xsl:with-param name="string">
- <xsl:number level="multiple"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="@role='bold' or @role='strong'">
- <xsl:call-template name="inline.boldseq"/>
- </xsl:when>
- <xsl:when test="@role='underline'">
- <fo:inline text-decoration="underline">
- <xsl:call-template name="inline.charseq"/>
- </fo:inline>
- </xsl:when>
- <xsl:when test="@role='strikethrough'">
- <fo:inline text-decoration="line-through">
- <xsl:call-template name="inline.charseq"/>
- </fo:inline>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$depth mod 2 = 1">
- <fo:inline font-style="normal">
- <xsl:apply-templates/>
- </fo:inline>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="foreignphrase">
- <xsl:call-template name="inline.italicseq"/>
- </xsl:template>
- <xsl:template match="markup">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="phrase">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="quote">
- <xsl:variable name="depth">
- <xsl:call-template name="dot.count">
- <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$depth mod 2 = 0">
- <xsl:call-template name="gentext.startquote"/>
- <xsl:call-template name="inline.charseq"/>
- <xsl:call-template name="gentext.endquote"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="gentext.nestedstartquote"/>
- <xsl:call-template name="inline.charseq"/>
- <xsl:call-template name="gentext.nestedendquote"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="varname">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <xsl:template match="wordasword">
- <xsl:call-template name="inline.italicseq"/>
- </xsl:template>
- <xsl:template match="lineannotation">
- <fo:inline font-style="italic">
- <xsl:call-template name="inline.charseq"/>
- </fo:inline>
- </xsl:template>
- <xsl:template match="superscript">
- <xsl:call-template name="inline.superscriptseq"/>
- </xsl:template>
- <xsl:template match="subscript">
- <xsl:call-template name="inline.subscriptseq"/>
- </xsl:template>
- <xsl:template match="trademark">
- <xsl:call-template name="inline.charseq"/>
- <xsl:choose>
- <xsl:when test="@class = 'copyright'
- or @class = 'registered'">
- <xsl:call-template name="dingbat">
- <xsl:with-param name="dingbat" select="@class"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="@class = 'service'">
- <xsl:call-template name="inline.superscriptseq">
- <xsl:with-param name="content" select="'SM'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="dingbat">
- <xsl:with-param name="dingbat" select="'trademark'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="firstterm">
- <xsl:call-template name="glossterm">
- <xsl:with-param name="firstterm" select="1"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="glossterm" name="glossterm">
- <xsl:param name="firstterm" select="0"/>
- <xsl:choose>
- <xsl:when test="($firstterm.only.link = 0 or $firstterm = 1) and @linkend">
- <xsl:variable name="targets" select="key('id',@linkend)"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:choose>
- <xsl:when test="$target">
- <fo:basic-link internal-destination="{@linkend}"
- xsl:use-attribute-sets="xref.properties">
- <xsl:call-template name="inline.italicseq"/>
- </fo:basic-link>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="not(@linkend)
- and ($firstterm.only.link = 0 or $firstterm = 1)
- and ($glossterm.auto.link != 0)
- and $glossary.collection != ''">
- <xsl:variable name="term">
- <xsl:choose>
- <xsl:when test="@baseform"><xsl:value-of select="@baseform"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cterm"
- select="(document($glossary.collection,.)//glossentry[glossterm=$term])[1]"/>
- <xsl:choose>
- <xsl:when test="not($cterm)">
- <xsl:message>
- <xsl:text>There's no entry for </xsl:text>
- <xsl:value-of select="$term"/>
- <xsl:text> in </xsl:text>
- <xsl:value-of select="$glossary.collection"/>
- </xsl:message>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$cterm"/>
- </xsl:call-template>
- </xsl:variable>
- <fo:basic-link internal-destination="{$id}"
- xsl:use-attribute-sets="xref.properties">
- <xsl:call-template name="inline.italicseq"/>
- </fo:basic-link>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="not(@linkend)
- and ($firstterm.only.link = 0 or $firstterm = 1)
- and $glossterm.auto.link != 0">
- <xsl:variable name="term">
- <xsl:choose>
- <xsl:when test="@baseform">
- <xsl:value-of select="@baseform"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="targets"
- select="//glossentry[glossterm=$term or glossterm/@baseform=$term]"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:choose>
- <xsl:when test="count($targets)=0">
- <xsl:message>
- <xsl:text>Error: no glossentry for glossterm: </xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>.</xsl:text>
- </xsl:message>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="termid">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$target"/>
- </xsl:call-template>
- </xsl:variable>
- <fo:basic-link internal-destination="{$termid}"
- xsl:use-attribute-sets="xref.properties">
- <xsl:call-template name="inline.charseq"/>
- </fo:basic-link>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.italicseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="termdef">
- <fo:inline>
- <xsl:call-template name="gentext.template">
- <xsl:with-param name="context" select="'termdef'"/>
- <xsl:with-param name="name" select="'prefix'"/>
- </xsl:call-template>
- <xsl:apply-templates/>
- <xsl:call-template name="gentext.template">
- <xsl:with-param name="context" select="'termdef'"/>
- <xsl:with-param name="name" select="'suffix'"/>
- </xsl:call-template>
- </fo:inline>
- </xsl:template>
- <xsl:template match="sgmltag|tag">
- <xsl:variable name="class">
- <xsl:choose>
- <xsl:when test="@class">
- <xsl:value-of select="@class"/>
- </xsl:when>
- <xsl:otherwise>element</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$class='attribute'">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:when>
- <xsl:when test="$class='attvalue'">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:when>
- <xsl:when test="$class='element'">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:when>
- <xsl:when test="$class='endtag'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text></</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='genentity'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text>&</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='numcharref'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text>&#</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='paramentity'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text>%</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>;</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='pi'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text><?</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='xmlpi'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text><?</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>?></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='starttag'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text><</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='emptytag'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text><</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>/></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$class='sgmlcomment' or $class='comment'">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <xsl:text><!--</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>--></xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.charseq"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="email">
- <xsl:call-template name="inline.monoseq">
- <xsl:with-param name="content">
- <fo:inline keep-together.within-line="always" hyphenate="false">
- <xsl:if test="not($email.delimiters.enabled = 0)">
- <xsl:text><</xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="not($email.delimiters.enabled = 0)">
- <xsl:text>></xsl:text>
- </xsl:if>
- </fo:inline>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="keycombo">
- <xsl:variable name="action" select="@action"/>
- <xsl:variable name="joinchar">
- <xsl:choose>
- <xsl:when test="$action='seq'"><xsl:text> </xsl:text></xsl:when>
- <xsl:when test="$action='simul'">+</xsl:when>
- <xsl:when test="$action='press'">-</xsl:when>
- <xsl:when test="$action='click'">-</xsl:when>
- <xsl:when test="$action='double-click'">-</xsl:when>
- <xsl:when test="$action='other'"></xsl:when>
- <xsl:otherwise>+</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:for-each select="*">
- <xsl:if test="position()>1"><xsl:value-of select="$joinchar"/></xsl:if>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="uri">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="menuchoice">
- <xsl:variable name="shortcut" select="./shortcut"/>
- <xsl:call-template name="process.menuchoice"/>
- <xsl:if test="$shortcut">
- <xsl:text> (</xsl:text>
- <xsl:apply-templates select="$shortcut"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template name="process.menuchoice">
- <xsl:param name="nodelist" select="guibutton|guiicon|guilabel|guimenu|guimenuitem|guisubmenu|interface"/><!-- not(shortcut) -->
- <xsl:param name="count" select="1"/>
- <xsl:variable name="mm.separator">
- <xsl:choose>
- <xsl:when test="($fop.extensions != 0 or $fop1.extensions != 0 ) and
- contains($menuchoice.menu.separator, '→')">
- <fo:inline font-family="Symbol">
- <xsl:copy-of select="$menuchoice.menu.separator"/>
- </fo:inline>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$menuchoice.menu.separator"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$count>count($nodelist)"></xsl:when>
- <xsl:when test="$count=1">
- <xsl:apply-templates select="$nodelist[$count=position()]"/>
- <xsl:call-template name="process.menuchoice">
- <xsl:with-param name="nodelist" select="$nodelist"/>
- <xsl:with-param name="count" select="$count+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="node" select="$nodelist[$count=position()]"/>
- <xsl:choose>
- <xsl:when test="local-name($node)='guimenuitem'
- or local-name($node)='guisubmenu'">
- <xsl:copy-of select="$mm.separator"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$menuchoice.separator"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="$node"/>
- <xsl:call-template name="process.menuchoice">
- <xsl:with-param name="nodelist" select="$nodelist"/>
- <xsl:with-param name="count" select="$count+1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="optional">
- <xsl:value-of select="$arg.choice.opt.open.str"/>
- <xsl:call-template name="inline.charseq"/>
- <xsl:value-of select="$arg.choice.opt.close.str"/>
- </xsl:template>
- <xsl:template match="citation">
- <!-- todo: integrate with bibliography collection -->
- <xsl:variable name="targets" select="(//biblioentry | //bibliomixed)[abbrev = string(current())]"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:choose>
- <!-- try automatic linking based on match to abbrev -->
- <xsl:when test="$target and not(xref) and not(link)">
- <xsl:text>[</xsl:text>
- <fo:basic-link>
- <xsl:attribute name="internal-destination">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$target"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="$bibliography.numbered != 0">
- <xsl:apply-templates select="$target" mode="citation"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inline.charseq"/>
- </xsl:otherwise>
- </xsl:choose>
-
- </fo:basic-link>
- <xsl:text>]</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>[</xsl:text>
- <xsl:call-template name="inline.charseq"/>
- <xsl:text>]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="biblioentry|bibliomixed" mode="citation">
- <xsl:number from="bibliography" count="biblioentry|bibliomixed"
- level="any" format="1"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="comment[&comment.block.parents;]|remark[&comment.block.parents;]">
- <xsl:if test="$show.comments != 0">
- <fo:block font-style="italic">
- <xsl:call-template name="inline.charseq"/>
- </fo:block>
- </xsl:if>
- </xsl:template>
- <xsl:template match="comment|remark">
- <xsl:if test="$show.comments != 0">
- <fo:inline font-style="italic">
- <xsl:call-template name="inline.charseq"/>
- </fo:inline>
- </xsl:if>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="productname">
- <xsl:call-template name="inline.charseq"/>
- <xsl:if test="@class">
- <xsl:call-template name="dingbat">
- <xsl:with-param name="dingbat" select="@class"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template match="productnumber">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="pob|street|city|state|postcode|country|otheraddr">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="phone|fax">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <!-- in Addresses, for example -->
- <xsl:template match="honorific|firstname|surname|lineage|othername">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="person">
- <xsl:apply-templates select="personname"/>
- </xsl:template>
- <xsl:template match="personname">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:call-template name="person.name"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="jobtitle">
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content">
- <xsl:apply-templates/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="org">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="orgname">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="orgdiv">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <xsl:template match="affiliation">
- <xsl:call-template name="inline.charseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="beginpage">
- <!-- does nothing; this *is not* markup to force a page break. -->
- </xsl:template>
- </xsl:stylesheet>
|