2 <xsl:stylesheet exclude-result-prefixes="d"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:d="http://docbook.org/ns/docbook"
5 xmlns:fo="http://www.w3.org/1999/XSL/Format"
8 <!-- ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://cdn.docbook.org/release/xsl/current/ for
12 copyright and other information.
14 ******************************************************************** -->
16 <!-- These variables set the margin-left or -right attribute value for FO output based on
17 the writing-mode specified in the gentext file for the document's lang. -->
19 <xsl:param name="direction.align.start">
21 <!-- FOP does not support writing-mode="rl-tb" -->
22 <xsl:when test="$fop.extensions != 0">left</xsl:when>
23 <xsl:when test="$fop1.extensions != 0">left</xsl:when>
24 <xsl:when test="starts-with($writing.mode, 'lr')">left</xsl:when>
25 <xsl:when test="starts-with($writing.mode, 'rl')">right</xsl:when>
26 <xsl:when test="starts-with($writing.mode, 'tb')">top</xsl:when>
27 <xsl:otherwise>left</xsl:otherwise>
31 <xsl:param name="direction.align.end">
33 <xsl:when test="$fop.extensions != 0">right</xsl:when>
34 <xsl:when test="$fop1.extensions != 0">right</xsl:when>
35 <xsl:when test="starts-with($writing.mode, 'lr')">right</xsl:when>
36 <xsl:when test="starts-with($writing.mode, 'rl')">left</xsl:when>
37 <xsl:when test="starts-with($writing.mode, 'tb')">bottom</xsl:when>
38 <xsl:otherwise>right</xsl:otherwise>
42 <xsl:param name="direction.mode">
44 <xsl:when test="$fop.extensions != 0 and
45 starts-with($writing.mode, 'rl')">
46 <xsl:message>WARNING: FOP does not support right-to-left writing-mode</xsl:message>
47 <xsl:text>lr-tb</xsl:text>
49 <xsl:when test="$fop1.extensions != 0 and
50 starts-with($writing.mode, 'rl')">
52 <xsl:text>WARNING: FOP 1.0 does not support right-to-left writing-mode; </xsl:text>
53 <xsl:text>FOP 1.1 has limited support for right-to-left writing-mode.</xsl:text>
55 <xsl:text>rl-tb</xsl:text>
57 <xsl:when test="starts-with($writing.mode, 'lr')">lr-tb</xsl:when>
58 <xsl:when test="starts-with($writing.mode, 'rl')">rl-tb</xsl:when>
59 <xsl:when test="starts-with($writing.mode, 'tb')">tb-rl</xsl:when>
60 <xsl:otherwise>lr-tb</xsl:otherwise>
65 <xsl:template name="anchor">
66 <xsl:param name="node" select="."/>
67 <xsl:param name="conditional" select="1"/>
68 <xsl:variable name="id">
69 <xsl:call-template name="object.id">
70 <xsl:with-param name="object" select="$node"/>
73 <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
74 <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
78 <xsl:template name="dingbat">
79 <xsl:param name="dingbat">bullet</xsl:param>
80 <xsl:variable name="symbol">
82 <xsl:when test="$dingbat='bullet'">o</xsl:when>
83 <xsl:when test="$dingbat='copyright'">©</xsl:when>
84 <xsl:when test="$dingbat='trademark'">™</xsl:when>
85 <xsl:when test="$dingbat='trade'">™</xsl:when>
86 <xsl:when test="$dingbat='registered'">®</xsl:when>
87 <xsl:when test="$dingbat='service'">(SM)</xsl:when>
88 <xsl:when test="$dingbat='ldquo'">"</xsl:when>
89 <xsl:when test="$dingbat='rdquo'">"</xsl:when>
90 <xsl:when test="$dingbat='lsquo'">'</xsl:when>
91 <xsl:when test="$dingbat='rsquo'">'</xsl:when>
92 <xsl:when test="$dingbat='em-dash'">—</xsl:when>
93 <xsl:when test="$dingbat='en-dash'">-</xsl:when>
94 <xsl:otherwise>o</xsl:otherwise>
99 <xsl:when test="$dingbat.fontset = ''">
100 <xsl:copy-of select="$symbol"/>
103 <fo:inline font-family="{$dingbat.fontset}">
104 <xsl:copy-of select="$symbol"/>
110 <xsl:template name="href.target">
111 <xsl:param name="context" select="."/>
112 <xsl:param name="object" select="."/>
113 <xsl:text>#</xsl:text>
114 <xsl:call-template name="object.id">
115 <xsl:with-param name="object" select="$object"/>