Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10389 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/inline.xsl

    rf2a5108 rb1a51ac1  
    11<?xml version='1.0'?>
    22<!DOCTYPE xsl:stylesheet [
    3   <!ENTITY comment.block.parents "parent::answer|parent::appendix|parent::article|parent::bibliodiv|
    4                                   parent::bibliography|parent::blockquote|parent::caution|parent::chapter|
    5                                   parent::glossary|parent::glossdiv|parent::important|parent::index|
    6                                   parent::indexdiv|parent::listitem|parent::note|parent::orderedlist|
    7                                   parent::partintro|parent::preface|parent::procedure|parent::qandadiv|
    8                                   parent::qandaset|parent::question|parent::refentry|parent::refnamediv|
    9                                   parent::refsect1|parent::refsect2|parent::refsect3|parent::refsection|
    10                                   parent::refsynopsisdiv|parent::sect1|parent::sect2|parent::sect3|parent::sect4|
    11                                   parent::sect5|parent::section|parent::setindex|parent::sidebar|
    12                                   parent::simplesect|parent::taskprerequisites|parent::taskrelated|
    13                                   parent::tasksummary|parent::warning">
     3<!ENTITY % common.entities SYSTEM "../common/entities.ent">
     4%common.entities;
    145]>
    156<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     
    2011
    2112<!-- ********************************************************************
    22      $Id$
     13     $Id: inline.xsl 9718 2013-01-30 18:29:51Z bobstayton $
    2314     ********************************************************************
    2415
     
    2819
    2920     ******************************************************************** -->
     21
     22<xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/>
     23<xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/>
    3024
    3125<xsl:template name="simple.xlink">
     
    5852      <xsl:variable name="is.olink">
    5953        <xsl:choose>
    60           <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
     54          <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
    6155          <!-- and if the href contains # -->
    6256          <xsl:when test="contains($xhref,'#') and
    63                @xlink:role = $xolink.role">1</xsl:when>
     57               @xlink:role = $xolink.role">1</xsl:when>
    6458          <xsl:otherwise>0</xsl:otherwise>
    6559        </xsl:choose>
     
    6761
    6862      <xsl:choose>
     63        <xsl:when test="$is.olink = 1">
     64          <xsl:call-template name="olink">
     65            <xsl:with-param name="content" select="$content"/>
     66          </xsl:call-template>
     67        </xsl:when>
     68
    6969        <xsl:when test="$is.idref = 1">
    7070
     
    9393            <xsl:otherwise>
    9494              <fo:basic-link internal-destination="{$idref}">
     95                <xsl:apply-templates select="." mode="simple.xlink.properties"/>
    9596                <xsl:copy-of select="$content"/>
    9697              </fo:basic-link>
     
    99100        </xsl:when>
    100101
    101         <xsl:when test="$is.olink = 1">
    102           <xsl:call-template name="olink">
    103             <xsl:with-param name="content" select="$content"/>
    104           </xsl:call-template>
    105         </xsl:when>
    106 
    107102        <!-- otherwise it's a URI -->
    108103        <xsl:otherwise>
    109104          <fo:basic-link external-destination="url({$xhref})">
     105            <xsl:apply-templates select="." mode="simple.xlink.properties"/>
    110106            <xsl:copy-of select="$content"/>
    111107          </fo:basic-link>
     108          <!-- * Call the template for determining whether the URL for this -->
     109          <!-- * hyperlink is displayed, and how to display it (either inline or -->
     110          <!-- * as a numbered footnote). -->
     111          <xsl:call-template name="hyperlink.url.display">
     112            <xsl:with-param name="url" select="$xhref"/>
     113          </xsl:call-template>
    112114        </xsl:otherwise>
    113115      </xsl:choose>
     
    133135        <xsl:otherwise>
    134136          <fo:basic-link internal-destination="{$linkend}">
     137            <xsl:apply-templates select="." mode="simple.xlink.properties"/>
    135138            <xsl:copy-of select="$content"/>
    136139          </fo:basic-link>
     
    143146    </xsl:otherwise>
    144147  </xsl:choose>
    145 
     148</xsl:template>
     149
     150<xsl:template name="inline.sansseq">
     151  <xsl:param name="content">
     152    <xsl:call-template name="simple.xlink">
     153        <xsl:with-param name="content">
     154          <xsl:apply-templates/>
     155        </xsl:with-param>
     156    </xsl:call-template>
     157  </xsl:param>
     158
     159  <fo:inline font-family="{$sans.font.family}">
     160    <xsl:choose>
     161      <xsl:when test="@dir">
     162        <fo:inline>
     163          <xsl:attribute name="direction">
     164            <xsl:choose>
     165              <xsl:when test="@dir = 'ltr' or @dir = 'lro'">ltr</xsl:when>
     166              <xsl:otherwise>rtl</xsl:otherwise>
     167            </xsl:choose>
     168          </xsl:attribute>
     169          <xsl:copy-of select="$content"/>
     170        </fo:inline>
     171      </xsl:when>
     172      <xsl:otherwise>
     173        <xsl:copy-of select="$content"/>
     174      </xsl:otherwise>
     175    </xsl:choose>
     176  </fo:inline>
    146177</xsl:template>
    147178
     
    183214
    184215  <fo:inline xsl:use-attribute-sets="monospace.properties">
     216    <xsl:call-template name="anchor"/>
    185217    <xsl:if test="@dir">
    186218      <xsl:attribute name="direction">
     
    480512<xsl:template match="function/parameter" priority="2">
    481513  <xsl:call-template name="inline.italicmonoseq"/>
    482   <xsl:if test="following-sibling::*">
     514  <xsl:if test="$function.parens != 0 and following-sibling::*">
    483515    <xsl:text>, </xsl:text>
    484516  </xsl:if>
     
    487519<xsl:template match="function/replaceable" priority="2">
    488520  <xsl:call-template name="inline.italicmonoseq"/>
    489   <xsl:if test="following-sibling::*">
     521  <xsl:if test="$function.parens != 0 and following-sibling::*">
    490522    <xsl:text>, </xsl:text>
    491523  </xsl:if>
     
    529561
    530562<xsl:template match="keycap">
    531   <xsl:call-template name="inline.boldseq"/>
     563  <xsl:choose>
     564    <xsl:when test="@function and normalize-space(.) = ''">
     565      <xsl:call-template name="inline.boldseq">
     566        <xsl:with-param name="content">
     567          <xsl:call-template name="gentext.template">
     568            <xsl:with-param name="context" select="'keycap'"/>
     569            <xsl:with-param name="name" select="@function"/>
     570          </xsl:call-template>
     571        </xsl:with-param>
     572      </xsl:call-template>
     573    </xsl:when>
     574    <xsl:otherwise>
     575      <xsl:call-template name="inline.boldseq"/>
     576    </xsl:otherwise>
     577  </xsl:choose>
    532578</xsl:template>
    533579
     
    688734
    689735<xsl:template match="phrase">
    690   <xsl:call-template name="inline.charseq"/>
     736  <fo:inline>
     737    <xsl:call-template name="anchor"/>
     738    <xsl:call-template name="inline.charseq"/>
     739  </fo:inline>
    691740</xsl:template>
    692741
     
    697746    </xsl:call-template>
    698747  </xsl:variable>
    699   <xsl:choose>
    700     <xsl:when test="$depth mod 2 = 0">
    701       <xsl:call-template name="gentext.startquote"/>
    702       <xsl:call-template name="inline.charseq"/>
    703       <xsl:call-template name="gentext.endquote"/>
    704     </xsl:when>
    705     <xsl:otherwise>
    706       <xsl:call-template name="gentext.nestedstartquote"/>
    707       <xsl:call-template name="inline.charseq"/>
    708       <xsl:call-template name="gentext.nestedendquote"/>
    709     </xsl:otherwise>
    710   </xsl:choose>
     748  <xsl:variable name="content">
     749    <xsl:choose>
     750      <xsl:when test="$depth mod 2 = 0">
     751        <xsl:call-template name="gentext.startquote"/>
     752        <xsl:call-template name="inline.charseq"/>
     753        <xsl:call-template name="gentext.endquote"/>
     754      </xsl:when>
     755      <xsl:otherwise>
     756        <xsl:call-template name="gentext.nestedstartquote"/>
     757        <xsl:call-template name="inline.charseq"/>
     758        <xsl:call-template name="gentext.nestedendquote"/>
     759      </xsl:otherwise>
     760    </xsl:choose>
     761  </xsl:variable>
     762
     763  <fo:inline>
     764    <xsl:call-template name="anchor"/>
     765    <xsl:copy-of select="$content"/>
     766  </fo:inline>
     767
    711768</xsl:template>
    712769
     
    825882        <xsl:choose>
    826883          <xsl:when test="@baseform">
    827             <xsl:value-of select="@baseform"/>
     884            <xsl:value-of select="normalize-space(@baseform)"/>
    828885          </xsl:when>
    829886          <xsl:otherwise>
    830             <xsl:value-of select="."/>
     887            <xsl:value-of select="normalize-space(.)"/>
    831888          </xsl:otherwise>
    832889        </xsl:choose>
     
    834891
    835892      <xsl:variable name="targets"
    836                     select="//glossentry[glossterm=$term or glossterm/@baseform=$term]"/>
    837 
     893                    select="key('glossentries', $term)"/>
    838894      <xsl:variable name="target" select="$targets[1]"/>
    839895
     
    856912          <fo:basic-link internal-destination="{$termid}"
    857913                         xsl:use-attribute-sets="xref.properties">
    858             <xsl:call-template name="inline.charseq"/>
     914            <xsl:call-template name="inline.italicseq"/>
    859915          </fo:basic-link>
    860916        </xsl:otherwise>
     
    9951051          <xsl:text>&lt;</xsl:text>
    9961052        </xsl:if>
    997         <xsl:apply-templates/>
     1053        <xsl:choose>
     1054          <xsl:when test="not($email.mailto.enabled = 0)">
     1055            <fo:basic-link xsl:use-attribute-sets="xref.properties"
     1056                           keep-together.within-line="always" hyphenate="false">
     1057              <xsl:attribute name="external-destination">
     1058                mailto:<xsl:value-of select="string(.)" />
     1059              </xsl:attribute>
     1060              <xsl:apply-templates/>
     1061            </fo:basic-link>
     1062          </xsl:when>
     1063          <xsl:otherwise>
     1064            <xsl:apply-templates/>
     1065          </xsl:otherwise>
     1066        </xsl:choose>
    9981067        <xsl:if test="not($email.delimiters.enabled = 0)">
    9991068          <xsl:text>&gt;</xsl:text>
     
    11111180        </xsl:attribute>
    11121181
    1113         <xsl:choose>
    1114           <xsl:when test="$bibliography.numbered != 0">
    1115             <xsl:apply-templates select="$target" mode="citation"/>
    1116           </xsl:when>
    1117           <xsl:otherwise>
    1118             <xsl:call-template name="inline.charseq"/>
    1119           </xsl:otherwise>
    1120         </xsl:choose>
     1182        <xsl:choose>
     1183          <xsl:when test="$bibliography.numbered != 0">
     1184            <xsl:apply-templates select="$target" mode="citation"/>
     1185          </xsl:when>
     1186          <xsl:otherwise>
     1187            <xsl:call-template name="inline.charseq"/>
     1188          </xsl:otherwise>
     1189        </xsl:choose>
    11211190     
    11221191      </fo:basic-link>
     
    11321201</xsl:template>
    11331202
     1203<xsl:template match="citebiblioid">
     1204  <xsl:variable name="targets" select="//*[biblioid = string(current())]"/>
     1205  <xsl:variable name="target" select="$targets[1]"/>
     1206
     1207  <xsl:choose>
     1208    <!-- try automatic linking based on match to parent of biblioid -->
     1209    <xsl:when test="$target and not(xref) and not(link)">
     1210
     1211      <xsl:text>[</xsl:text>
     1212      <fo:basic-link>
     1213        <xsl:attribute name="internal-destination">
     1214          <xsl:call-template name="object.id">
     1215            <xsl:with-param name="object" select="$target"/>
     1216          </xsl:call-template>
     1217        </xsl:attribute>
     1218
     1219        <xsl:call-template name="inline.charseq"/>
     1220           
     1221      </fo:basic-link>
     1222      <xsl:text>]</xsl:text>
     1223    </xsl:when>
     1224
     1225    <xsl:otherwise>
     1226      <xsl:text>[</xsl:text>
     1227      <xsl:call-template name="inline.charseq"/>
     1228      <xsl:text>]</xsl:text>
     1229    </xsl:otherwise>
     1230  </xsl:choose>
     1231</xsl:template>
     1232
    11341233<xsl:template match="biblioentry|bibliomixed" mode="citation">
    11351234  <xsl:number from="bibliography" count="biblioentry|bibliomixed"
    1136               level="any" format="1"/>
     1235              level="any" format="1"/>
    11371236</xsl:template>
    11381237
     
    12311330</xsl:template>
    12321331
     1332<xsl:template match="*" mode="simple.xlink.properties">
     1333  <!-- Placeholder template to apply properties to links made from
     1334       elements other than xref, link, and olink.
     1335       This template should generate attributes only, as it is
     1336       applied right after the opening <fo:basic-link> tag.
     1337       -->
     1338  <!-- for example
     1339  <xsl:attribute name="color">blue</xsl:attribute>
     1340  -->
     1341  <!-- Since this is a mode, you can create different
     1342       templates with different properties for different linking elements -->
     1343</xsl:template>
     1344
    12331345</xsl:stylesheet>
    12341346
Note: See TracChangeset for help on using the changeset viewer.