1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312 |
- <?xml version='1.0'?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:suwl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks"
- xmlns:exsl="http://exslt.org/common"
- xmlns:xlink='http://www.w3.org/1999/xlink'
- exclude-result-prefixes="suwl exsl xlink"
- version='1.0'>
- <!-- ********************************************************************
- $Id: xref.xsl 9713 2013-01-22 22:08:30Z bobstayton $
- ********************************************************************
- 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.
- ******************************************************************** -->
- <!-- Use internal variable for olink xlink role for consistency -->
- <xsl:variable
- name="xolink.role">http://docbook.org/xlink/role/olink</xsl:variable>
- <!-- ==================================================================== -->
- <xsl:template match="anchor">
- <xsl:choose>
- <xsl:when test="$generate.id.attributes = 0">
- <xsl:call-template name="anchor"/>
- </xsl:when>
- <xsl:otherwise>
- <span>
- <xsl:call-template name="id.attribute"/>
- </span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="xref" name="xref">
- <xsl:param name="xhref" select="@xlink:href"/>
- <!-- is the @xlink:href a local idref link? -->
- <xsl:param name="xlink.idref">
- <xsl:if test="starts-with($xhref,'#')
- and (not(contains($xhref,'('))
- or starts-with($xhref, '#xpointer(id('))">
- <xsl:call-template name="xpointer.idref">
- <xsl:with-param name="xpointer" select="$xhref"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:param>
- <xsl:param name="xlink.targets" select="key('id',$xlink.idref)"/>
- <xsl:param name="linkend.targets" select="key('id',@linkend)"/>
- <xsl:param name="target" select="($xlink.targets | $linkend.targets)[1]"/>
- <xsl:variable name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle)
- and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="anchor"/>
- <xsl:variable name="content">
- <xsl:choose>
-
- <xsl:when test="@endterm">
- <xsl:variable name="etargets" select="key('id',@endterm)"/>
- <xsl:variable name="etarget" select="$etargets[1]"/>
- <xsl:choose>
- <xsl:when test="count($etarget) = 0">
- <xsl:message>
- <xsl:value-of select="count($etargets)"/>
- <xsl:text>Endterm points to nonexistent ID: </xsl:text>
- <xsl:value-of select="@endterm"/>
- </xsl:message>
- <xsl:text>???</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$etarget" mode="endterm"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
-
- <xsl:when test="$target/@xreflabel">
- <xsl:call-template name="xref.xreflabel">
- <xsl:with-param name="target" select="$target"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="$target">
- <xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
- </xsl:if>
-
- <xsl:apply-templates select="$target" mode="xref-to">
- <xsl:with-param name="referrer" select="."/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- </xsl:apply-templates>
-
- <xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>ERROR: xref linking to </xsl:text>
- <xsl:value-of select="@linkend|@xlink:href"/>
- <xsl:text> has no generated link text.</xsl:text>
- </xsl:message>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="content" select="$content"/>
- </xsl:call-template>
- </xsl:template>
- <!-- ==================================================================== -->
- <!-- biblioref handled largely like an xref -->
- <!-- To be done: add support for begin, end, and units attributes -->
- <xsl:template match="biblioref">
- <xsl:variable name="targets" select="key('id',@linkend)"/>
- <xsl:variable name="target" select="$targets[1]"/>
- <xsl:variable name="refelem" select="local-name($target)"/>
- <xsl:call-template name="check.id.unique">
- <xsl:with-param name="linkend" select="@linkend"/>
- </xsl:call-template>
- <xsl:call-template name="anchor"/>
- <xsl:choose>
- <xsl:when test="count($target) = 0">
- <xsl:message>
- <xsl:text>XRef to nonexistent id: </xsl:text>
- <xsl:value-of select="@linkend"/>
- </xsl:message>
- <xsl:text>???</xsl:text>
- </xsl:when>
- <xsl:when test="@endterm">
- <xsl:variable name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$target"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="etargets" select="key('id',@endterm)"/>
- <xsl:variable name="etarget" select="$etargets[1]"/>
- <xsl:choose>
- <xsl:when test="count($etarget) = 0">
- <xsl:message>
- <xsl:value-of select="count($etargets)"/>
- <xsl:text>Endterm points to nonexistent ID: </xsl:text>
- <xsl:value-of select="@endterm"/>
- </xsl:message>
- <a href="{$href}">
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:call-template name="id.attribute"/>
- <xsl:text>???</xsl:text>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{$href}">
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:call-template name="id.attribute"/>
- <xsl:apply-templates select="$etarget" mode="endterm"/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$target/@xreflabel">
- <a>
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$target"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="xref.xreflabel">
- <xsl:with-param name="target" select="$target"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$target"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
- </xsl:if>
- <a href="{$href}">
- <xsl:apply-templates select="." mode="class.attribute"/>
- <xsl:if test="$target/title or $target/info/title">
- <xsl:attribute name="title">
- <xsl:apply-templates select="$target" mode="xref-title"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="$target" mode="xref-to">
- <xsl:with-param name="referrer" select="."/>
- <xsl:with-param name="xrefstyle">
- <xsl:choose>
- <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
- <xsl:value-of select="@role"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@xrefstyle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </a>
- <xsl:if test="not(parent::citation)">
- <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="*" mode="endterm">
- <!-- Process the children of the endterm element -->
- <xsl:variable name="endterm">
- <xsl:apply-templates select="child::node()" mode="no.anchor.mode"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$exsl.node.set.available != 0">
- <xsl:apply-templates select="exsl:node-set($endterm)" mode="remove-ids"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$endterm"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*" mode="remove-ids">
- <xsl:choose>
- <!-- handle html or xhtml -->
- <xsl:when test="local-name(.) = 'a'
- and (namespace-uri(.) = ''
- or namespace-uri(.) = 'http://www.w3.org/1999/xhtml')">
- <xsl:choose>
- <xsl:when test="(@name and count(@*) = 1)
- or (@id and count(@*) = 1)
- or (@xml:id and count(@*) = 1)
- or (@xml:id and @name and count(@*) = 2)
- or (@id and @name and count(@*) = 2)">
- <xsl:message>suppress anchor</xsl:message>
- <!-- suppress the whole thing -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="local-name(.) != 'name' and local-name(.) != 'id'">
- <xsl:copy/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>removing <xsl:value-of
- select="local-name(.)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:copy>
- <xsl:apply-templates mode="remove-ids"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="local-name(.) != 'id'">
- <xsl:copy/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>removing <xsl:value-of
- select="local-name(.)"/></xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:apply-templates mode="remove-ids"/>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="*" mode="xref-to-prefix"/>
- <xsl:template match="*" mode="xref-to-suffix"/>
- <xsl:template match="*" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:if test="$verbose">
- <xsl:message>
- <xsl:text>Don't know what gentext to create for xref to: "</xsl:text>
- <xsl:value-of select="name(.)"/>
- <xsl:text>", ("</xsl:text>
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- <xsl:text>")</xsl:text>
- </xsl:message>
- </xsl:if>
- <xsl:text>???</xsl:text>
- </xsl:template>
- <xsl:template match="title" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <!-- if you xref to a title, xref to the parent... -->
- <xsl:choose>
- <!-- FIXME: how reliable is this? -->
- <xsl:when test="contains(local-name(parent::*), 'info')">
- <xsl:apply-templates select="parent::*[2]" mode="xref-to">
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="parent::*" mode="xref-to">
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="abstract|authorblurb|personblurb|bibliodiv|bibliomset
- |biblioset|blockquote|calloutlist|caution|colophon
- |constraintdef|formalpara|glossdiv|important|indexdiv
- |itemizedlist|legalnotice|lot|msg|msgexplan|msgmain
- |msgrel|msgset|msgsub|note|orderedlist|partintro
- |productionset|qandadiv|refsynopsisdiv|screenshot|segmentedlist
- |set|setindex|sidebar|tip|toc|variablelist|warning"
- mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <!-- catch-all for things with (possibly optional) titles -->
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="author|editor|othercredit|personname" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:call-template name="person.name"/>
- </xsl:template>
- <xsl:template match="authorgroup" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:call-template name="person.name.list"/>
- </xsl:template>
- <xsl:template match="figure|example|table|equation" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="procedure" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="task" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="cmdsynopsis" mode="xref-to">
- <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
- </xsl:template>
- <xsl:template match="funcsynopsis" mode="xref-to">
- <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
- </xsl:template>
- <xsl:template match="dedication|acknowledgements|preface|chapter|appendix|article" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="bibliography" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="biblioentry|bibliomixed" mode="xref-to-prefix">
- <xsl:text>[</xsl:text>
- </xsl:template>
- <xsl:template match="biblioentry|bibliomixed" mode="xref-to-suffix">
- <xsl:text>]</xsl:text>
- </xsl:template>
- <xsl:template match="biblioentry|bibliomixed" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <!-- handles both biblioentry and bibliomixed -->
- <xsl:choose>
- <xsl:when test="string(.) = ''">
- <xsl:variable name="bib" select="document($bibliography.collection,.)"/>
- <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
- <xsl:variable name="entry" select="$bib/bibliography/
- *[@id=$id or @xml:id=$id][1]"/>
- <xsl:choose>
- <xsl:when test="$entry">
- <xsl:choose>
- <xsl:when test="$bibliography.numbered != 0">
- <xsl:number from="bibliography" count="biblioentry|bibliomixed"
- level="any" format="1"/>
- </xsl:when>
- <xsl:when test="local-name($entry/*[1]) = 'abbrev'">
- <xsl:apply-templates select="$entry/*[1]" mode="no.anchor.mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>No bibliography entry: </xsl:text>
- <xsl:value-of select="$id"/>
- <xsl:text> found in </xsl:text>
- <xsl:value-of select="$bibliography.collection"/>
- </xsl:message>
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$bibliography.numbered != 0">
- <xsl:number from="bibliography" count="biblioentry|bibliomixed"
- level="any" format="1"/>
- </xsl:when>
- <xsl:when test="local-name(*[1]) = 'abbrev'">
- <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="glossary" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="glossentry" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:choose>
- <xsl:when test="$glossentry.show.acronym = 'primary'">
- <xsl:choose>
- <xsl:when test="acronym|abbrev">
- <xsl:apply-templates select="(acronym|abbrev)[1]" mode="no.anchor.mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="glossterm[1]" mode="xref-to">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="glossterm[1]" mode="xref-to">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="glossterm|firstterm" mode="xref-to">
- <xsl:apply-templates mode="no.anchor.mode"/>
- </xsl:template>
- <xsl:template match="index" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="listitem" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="section|simplesect
- |sect1|sect2|sect3|sect4|sect5
- |refsect1|refsect2|refsect3|refsection" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- <!-- FIXME: What about "in Chapter X"? -->
- </xsl:template>
- <xsl:template match="topic" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="bridgehead" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- <!-- FIXME: What about "in Chapter X"? -->
- </xsl:template>
- <xsl:template match="qandaset" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="qandaentry" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="question[1]" mode="xref-to">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="question|answer" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:choose>
- <xsl:when test="string-length(label) != 0">
- <xsl:apply-templates select="." mode="label.markup"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="part|reference" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="refentry" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:choose>
- <xsl:when test="refmeta/refentrytitle">
- <xsl:apply-templates select="refmeta/refentrytitle" mode="no.anchor.mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="refnamediv/refname[1]" mode="no.anchor.mode"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="refmeta/manvolnum" mode="no.anchor.mode"/>
- </xsl:template>
- <xsl:template match="refnamediv" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="refname[1]" mode="xref-to">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="refname" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates mode="xref-to"/>
- </xsl:template>
- <xsl:template match="step" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'Step'"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="number"/>
- </xsl:template>
- <xsl:template match="varlistentry" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="term[1]" mode="xref-to">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="primary|secondary|tertiary" mode="xref-to">
- <xsl:value-of select="."/>
- </xsl:template>
- <xsl:template match="indexterm" mode="xref-to">
- <xsl:value-of select="primary"/>
- </xsl:template>
- <xsl:template match="varlistentry/term" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:apply-templates mode="no.anchor.mode"/>
- </xsl:template>
- <xsl:template match="co" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:apply-templates select="." mode="callout-bug"/>
- </xsl:template>
- <xsl:template match="area|areaset" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:call-template name="callout-bug">
- <xsl:with-param name="conum">
- <xsl:apply-templates select="." mode="conumber"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="book" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- These are elements for which no link text exists, so an xref to one
- uses the xrefstyle attribute if specified, or if not it falls back
- to the container element's link text -->
- <xsl:template match="para|phrase|simpara|anchor|quote" mode="xref-to">
- <xsl:param name="referrer"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="verbose" select="1"/>
- <xsl:variable name="context" select="(ancestor::simplesect
- |ancestor::section
- |ancestor::sect1
- |ancestor::sect2
- |ancestor::sect3
- |ancestor::sect4
- |ancestor::sect5
- |ancestor::topic
- |ancestor::refsection
- |ancestor::refsect1
- |ancestor::refsect2
- |ancestor::refsect3
- |ancestor::chapter
- |ancestor::appendix
- |ancestor::preface
- |ancestor::partintro
- |ancestor::dedication
- |ancestor::acknowledgements
- |ancestor::colophon
- |ancestor::bibliography
- |ancestor::index
- |ancestor::glossary
- |ancestor::glossentry
- |ancestor::listitem
- |ancestor::varlistentry)[last()]"/>
- <xsl:choose>
- <xsl:when test="$xrefstyle != ''">
- <xsl:apply-templates select="." mode="object.xref.markup">
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$context" mode="xref-to">
- <xsl:with-param name="purpose" select="'xref'"/>
- <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
- <xsl:with-param name="referrer" select="$referrer"/>
- <xsl:with-param name="verbose" select="$verbose"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="*" mode="xref-title">
- <xsl:variable name="title">
- <xsl:apply-templates select="." mode="object.title.markup"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="author" mode="xref-title">
- <xsl:variable name="title">
- <xsl:call-template name="person.name"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="authorgroup" mode="xref-title">
- <xsl:variable name="title">
- <xsl:call-template name="person.name.list"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="cmdsynopsis" mode="xref-title">
- <xsl:variable name="title">
- <xsl:apply-templates select="(.//command)[1]" mode="xref"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="funcsynopsis" mode="xref-title">
- <xsl:variable name="title">
- <xsl:apply-templates select="(.//function)[1]" mode="xref"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="biblioentry|bibliomixed" mode="xref-title">
- <!-- handles both biblioentry and bibliomixed -->
- <xsl:variable name="title">
- <xsl:text>[</xsl:text>
- <xsl:choose>
- <xsl:when test="local-name(*[1]) = 'abbrev'">
- <xsl:apply-templates select="*[1]" mode="no.anchor.mode"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>]</xsl:text>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <xsl:template match="step" mode="xref-title">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'Step'"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="number"/>
- </xsl:template>
- <xsl:template match="step[not(./title)]" mode="title.markup">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'Step'"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="." mode="number"/>
- </xsl:template>
- <xsl:template match="co" mode="xref-title">
- <xsl:variable name="title">
- <xsl:apply-templates select="." mode="callout-bug"/>
- </xsl:variable>
- <xsl:value-of select="$title"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="link" name="link">
- <xsl:param name="linkend" select="@linkend"/>
- <xsl:param name="a.target"/>
- <xsl:param name="xhref" select="@xlink:href"/>
- <xsl:variable name="content">
- <xsl:call-template name="anchor"/>
- <xsl:choose>
- <xsl:when test="count(child::node()) > 0">
- <!-- If it has content, use it -->
- <xsl:apply-templates mode="no.anchor.mode"/>
- </xsl:when>
- <!-- else look for an endterm -->
- <xsl:when test="@endterm">
- <xsl:variable name="etargets" select="key('id',@endterm)"/>
- <xsl:variable name="etarget" select="$etargets[1]"/>
- <xsl:choose>
- <xsl:when test="count($etarget) = 0">
- <xsl:message>
- <xsl:value-of select="count($etargets)"/>
- <xsl:text>Endterm points to nonexistent ID: </xsl:text>
- <xsl:value-of select="@endterm"/>
- </xsl:message>
- <xsl:text>???</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$etarget" mode="endterm"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Use the xlink:href if no other text -->
- <xsl:when test="@xlink:href">
- <xsl:value-of select="@xlink:href"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>Link element has no content and no Endterm. </xsl:text>
- <xsl:text>Nothing to show in the link to </xsl:text>
- <xsl:value-of select="(@xlink:href|@linkend)[1]"/>
- </xsl:message>
- <xsl:text>???</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="simple.xlink">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="linkend" select="$linkend"/>
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="a.target" select="$a.target"/>
- <xsl:with-param name="xhref" select="$xhref"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="ulink" name="ulink">
- <xsl:param name="url" select="@url"/>
- <xsl:variable name="link">
- <a>
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:if test="@id or @xml:id">
- <xsl:choose>
- <xsl:when test="$generate.id.attributes = 0">
- <xsl:attribute name="name">
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="id">
- <xsl:value-of select="(@id|@xml:id)[1]"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="href"><xsl:value-of select="$url"/></xsl:attribute>
- <xsl:if test="$ulink.target != ''">
- <xsl:attribute name="target">
- <xsl:value-of select="$ulink.target"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="count(child::node())=0">
- <xsl:value-of select="$url"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="no.anchor.mode"/>
- </xsl:otherwise>
- </xsl:choose>
- </a>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('suwl:unwrapLinks')">
- <xsl:copy-of select="suwl:unwrapLinks($link)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$link"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="olink" name="olink">
- <!-- olink content may be passed in from xlink olink -->
- <xsl:param name="content" select="NOTANELEMENT"/>
- <xsl:call-template name="anchor"/>
- <xsl:choose>
- <!-- olinks resolved by stylesheet and target database -->
- <xsl:when test="@targetdoc or @targetptr or
- (@xlink:role=$xolink.role and
- contains(@xlink:href, '#') )" >
- <xsl:variable name="targetdoc.att">
- <xsl:choose>
- <xsl:when test="@targetdoc != ''">
- <xsl:value-of select="@targetdoc"/>
- </xsl:when>
- <xsl:when test="@xlink:role=$xolink.role and
- contains(@xlink:href, '#')" >
- <xsl:value-of select="substring-before(@xlink:href, '#')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="targetptr.att">
- <xsl:choose>
- <xsl:when test="@targetptr != ''">
- <xsl:value-of select="@targetptr"/>
- </xsl:when>
- <xsl:when test="@xlink:role=$xolink.role and
- contains(@xlink:href, '#')" >
- <xsl:value-of select="substring-after(@xlink:href, '#')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="olink.lang">
- <xsl:call-template name="l10n.language">
- <xsl:with-param name="xref-context" select="true()"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="target.database.filename">
- <xsl:call-template name="select.target.database">
- <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
- <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="target.database"
- select="document($target.database.filename,/)"/>
-
- <xsl:if test="$olink.debug != 0">
- <xsl:message>
- <xsl:text>Olink debug: root element of target.database '</xsl:text>
- <xsl:value-of select="$target.database.filename"/>
- <xsl:text>' is '</xsl:text>
- <xsl:value-of select="local-name($target.database/*[1])"/>
- <xsl:text>'.</xsl:text>
- </xsl:message>
- </xsl:if>
-
- <xsl:variable name="olink.key">
- <xsl:call-template name="select.olink.key">
- <xsl:with-param name="targetdoc.att" select="$targetdoc.att"/>
- <xsl:with-param name="targetptr.att" select="$targetptr.att"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:if test="string-length($olink.key) = 0">
- <xsl:message>
- <xsl:text>Error: unresolved olink: </xsl:text>
- <xsl:text>targetdoc/targetptr = '</xsl:text>
- <xsl:value-of select="$targetdoc.att"/>
- <xsl:text>/</xsl:text>
- <xsl:value-of select="$targetptr.att"/>
- <xsl:text>'.</xsl:text>
- </xsl:message>
- </xsl:if>
- <xsl:variable name="href">
- <xsl:call-template name="make.olink.href">
- <xsl:with-param name="olink.key" select="$olink.key"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="hottext">
- <xsl:choose>
- <xsl:when test="string-length($content) != 0">
- <xsl:copy-of select="$content"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="olink.hottext">
- <xsl:with-param name="olink.key" select="$olink.key"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="olink.docname.citation">
- <xsl:call-template name="olink.document.citation">
- <xsl:with-param name="olink.key" select="$olink.key"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="olink.page.citation">
- <xsl:call-template name="olink.page.citation">
- <xsl:with-param name="olink.key" select="$olink.key"/>
- <xsl:with-param name="target.database" select="$target.database"/>
- <xsl:with-param name="olink.lang" select="$olink.lang"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$href != ''">
- <a href="{$href}">
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:call-template name="id.attribute"/>
- <xsl:copy-of select="$hottext"/>
- </a>
- <xsl:copy-of select="$olink.page.citation"/>
- <xsl:copy-of select="$olink.docname.citation"/>
- </xsl:when>
- <xsl:otherwise>
- <span class="olink">
- <xsl:call-template name="id.attribute"/>
- <xsl:copy-of select="$hottext"/>
- </span>
- <xsl:copy-of select="$olink.page.citation"/>
- <xsl:copy-of select="$olink.docname.citation"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@linkmode or @targetdocent or @localinfo">
- <!-- old olink mechanism -->
- <xsl:message>
- <xsl:text>ERROR: olink using obsolete attributes </xsl:text>
- <xsl:text>@linkmode, @targetdocent, @localinfo are </xsl:text>
- <xsl:text>not supported.</xsl:text>
- </xsl:message>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- <xsl:text>ERROR: olink is missing linking attributes.</xsl:text>
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*" mode="pagenumber.markup">
- <!-- no-op in HTML -->
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template name="xref.xreflabel">
- <!-- called to process an xreflabel...you might use this to make -->
- <!-- xreflabels come out in the right font for different targets, -->
- <!-- for example. -->
- <xsl:param name="target" select="."/>
- <xsl:value-of select="$target/@xreflabel"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="title" mode="xref">
- <xsl:apply-templates mode="no.anchor.mode"/>
- </xsl:template>
- <xsl:template match="command" mode="xref">
- <xsl:call-template name="inline.boldseq"/>
- </xsl:template>
- <xsl:template match="function" mode="xref">
- <xsl:call-template name="inline.monoseq"/>
- </xsl:template>
- <!-- ==================================================================== -->
- <xsl:template match="*" mode="insert.title.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="title"/>
- <xsl:choose>
- <xsl:when test="$purpose = 'xref'">
- <xsl:copy-of select="$title"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$title"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="chapter|appendix" mode="insert.title.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="title"/>
- <xsl:choose>
- <xsl:when test="$purpose = 'xref'">
- <i>
- <xsl:copy-of select="$title"/>
- </i>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$title"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="*" mode="insert.subtitle.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="subtitle"/>
- <xsl:copy-of select="$subtitle"/>
- </xsl:template>
- <xsl:template match="*" mode="insert.label.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="label"/>
- <xsl:copy-of select="$label"/>
- </xsl:template>
- <xsl:template match="*" mode="insert.pagenumber.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="pagenumber"/>
- <xsl:copy-of select="$pagenumber"/>
- </xsl:template>
- <xsl:template match="*" mode="insert.direction.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="direction"/>
- <xsl:copy-of select="$direction"/>
- </xsl:template>
- <xsl:template match="*" mode="insert.olink.docname.markup">
- <xsl:param name="purpose"/>
- <xsl:param name="xrefstyle"/>
- <xsl:param name="docname"/>
- <span class="olinkdocname">
- <xsl:copy-of select="$docname"/>
- </span>
- </xsl:template>
- </xsl:stylesheet>
|