Changeset b1a51ac1 for stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/inline.xsl
- Timestamp:
- 12/10/2013 11:37:38 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- 112db9d
- Parents:
- f2a5108
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/inline.xsl
rf2a5108 rb1a51ac1 1 1 <?xml version='1.0'?> 2 2 <!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; 14 5 ]> 15 6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" … … 20 11 21 12 <!-- ******************************************************************** 22 $Id $13 $Id: inline.xsl 9718 2013-01-30 18:29:51Z bobstayton $ 23 14 ******************************************************************** 24 15 … … 28 19 29 20 ******************************************************************** --> 21 22 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm)"/> 23 <xsl:key name="glossentries" match="glossentry" use="normalize-space(glossterm/@baseform)"/> 30 24 31 25 <xsl:template name="simple.xlink"> … … 58 52 <xsl:variable name="is.olink"> 59 53 <xsl:choose> 60 54 <!-- If xlink:role="http://docbook.org/xlink/role/olink" --> 61 55 <!-- and if the href contains # --> 62 56 <xsl:when test="contains($xhref,'#') and 63 57 @xlink:role = $xolink.role">1</xsl:when> 64 58 <xsl:otherwise>0</xsl:otherwise> 65 59 </xsl:choose> … … 67 61 68 62 <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 69 69 <xsl:when test="$is.idref = 1"> 70 70 … … 93 93 <xsl:otherwise> 94 94 <fo:basic-link internal-destination="{$idref}"> 95 <xsl:apply-templates select="." mode="simple.xlink.properties"/> 95 96 <xsl:copy-of select="$content"/> 96 97 </fo:basic-link> … … 99 100 </xsl:when> 100 101 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 107 102 <!-- otherwise it's a URI --> 108 103 <xsl:otherwise> 109 104 <fo:basic-link external-destination="url({$xhref})"> 105 <xsl:apply-templates select="." mode="simple.xlink.properties"/> 110 106 <xsl:copy-of select="$content"/> 111 107 </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> 112 114 </xsl:otherwise> 113 115 </xsl:choose> … … 133 135 <xsl:otherwise> 134 136 <fo:basic-link internal-destination="{$linkend}"> 137 <xsl:apply-templates select="." mode="simple.xlink.properties"/> 135 138 <xsl:copy-of select="$content"/> 136 139 </fo:basic-link> … … 143 146 </xsl:otherwise> 144 147 </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> 146 177 </xsl:template> 147 178 … … 183 214 184 215 <fo:inline xsl:use-attribute-sets="monospace.properties"> 216 <xsl:call-template name="anchor"/> 185 217 <xsl:if test="@dir"> 186 218 <xsl:attribute name="direction"> … … 480 512 <xsl:template match="function/parameter" priority="2"> 481 513 <xsl:call-template name="inline.italicmonoseq"/> 482 <xsl:if test=" following-sibling::*">514 <xsl:if test="$function.parens != 0 and following-sibling::*"> 483 515 <xsl:text>, </xsl:text> 484 516 </xsl:if> … … 487 519 <xsl:template match="function/replaceable" priority="2"> 488 520 <xsl:call-template name="inline.italicmonoseq"/> 489 <xsl:if test=" following-sibling::*">521 <xsl:if test="$function.parens != 0 and following-sibling::*"> 490 522 <xsl:text>, </xsl:text> 491 523 </xsl:if> … … 529 561 530 562 <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> 532 578 </xsl:template> 533 579 … … 688 734 689 735 <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> 691 740 </xsl:template> 692 741 … … 697 746 </xsl:call-template> 698 747 </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 711 768 </xsl:template> 712 769 … … 825 882 <xsl:choose> 826 883 <xsl:when test="@baseform"> 827 <xsl:value-of select=" @baseform"/>884 <xsl:value-of select="normalize-space(@baseform)"/> 828 885 </xsl:when> 829 886 <xsl:otherwise> 830 <xsl:value-of select=" ."/>887 <xsl:value-of select="normalize-space(.)"/> 831 888 </xsl:otherwise> 832 889 </xsl:choose> … … 834 891 835 892 <xsl:variable name="targets" 836 select="//glossentry[glossterm=$term or glossterm/@baseform=$term]"/> 837 893 select="key('glossentries', $term)"/> 838 894 <xsl:variable name="target" select="$targets[1]"/> 839 895 … … 856 912 <fo:basic-link internal-destination="{$termid}" 857 913 xsl:use-attribute-sets="xref.properties"> 858 <xsl:call-template name="inline. charseq"/>914 <xsl:call-template name="inline.italicseq"/> 859 915 </fo:basic-link> 860 916 </xsl:otherwise> … … 995 1051 <xsl:text><</xsl:text> 996 1052 </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> 998 1067 <xsl:if test="not($email.delimiters.enabled = 0)"> 999 1068 <xsl:text>></xsl:text> … … 1111 1180 </xsl:attribute> 1112 1181 1113 1114 1115 1116 1117 1118 1119 1120 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> 1121 1190 1122 1191 </fo:basic-link> … … 1132 1201 </xsl:template> 1133 1202 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 1134 1233 <xsl:template match="biblioentry|bibliomixed" mode="citation"> 1135 1234 <xsl:number from="bibliography" count="biblioentry|bibliomixed" 1136 1235 level="any" format="1"/> 1137 1236 </xsl:template> 1138 1237 … … 1231 1330 </xsl:template> 1232 1331 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 1233 1345 </xsl:stylesheet> 1234 1346
Note:
See TracChangeset
for help on using the changeset viewer.