1 <?xml version="1.0" encoding="ASCII"?><!--This file was created automatically by html2xhtml--><!--from the HTML stylesheets.--><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook" xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim" xmlns:xverb="xalan://com.nwalsh.xalan.Verbatim" xmlns:lxslt="http://xml.apache.org/xslt" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="sverb xverb lxslt d" version="1.0">
3 <!-- ********************************************************************
5 This file is part of the XSL DocBook Stylesheet distribution.
6 See ../README or http://cdn.docbook.org/release/xsl/current/ for
7 copyright and other information.
9 ******************************************************************** -->
11 <lxslt:component prefix="xverb" functions="insertCallouts"/>
13 <xsl:template match="d:programlistingco|d:screenco">
14 <xsl:variable name="verbatim" select="d:programlisting|d:screen"/>
17 <xsl:when test="$use.extensions != '0' and $callouts.extension != '0'">
18 <xsl:variable name="rtf">
19 <xsl:apply-templates select="$verbatim">
20 <xsl:with-param name="suppress-numbers" select="'1'"/>
21 </xsl:apply-templates>
24 <xsl:variable name="rtf-with-callouts">
26 <xsl:when test="function-available('sverb:insertCallouts')">
27 <xsl:copy-of select="sverb:insertCallouts(d:areaspec,$rtf)"/>
29 <xsl:when test="function-available('xverb:insertCallouts')">
30 <xsl:copy-of select="xverb:insertCallouts(d:areaspec,$rtf)"/>
33 <xsl:message terminate="yes">
34 <xsl:text>No insertCallouts function is available.</xsl:text>
41 <xsl:when test="$verbatim/@linenumbering = 'numbered' and $linenumbering.extension != '0'">
43 <xsl:call-template name="common.html.attributes"/>
44 <xsl:call-template name="id.attribute"/>
45 <xsl:call-template name="number.rtf.lines">
46 <xsl:with-param name="rtf" select="$rtf-with-callouts"/>
47 <xsl:with-param name="pi.context" select="d:programlisting|d:screen"/>
49 <xsl:apply-templates select="d:calloutlist"/>
54 <xsl:call-template name="common.html.attributes"/>
55 <xsl:call-template name="id.attribute"/>
56 <xsl:copy-of select="$rtf-with-callouts"/>
57 <xsl:apply-templates select="d:calloutlist"/>
64 <xsl:apply-templates select="." mode="common.html.attributes"/>
65 <xsl:call-template name="id.attribute"/>
66 <xsl:apply-templates/>
72 <xsl:template match="d:areaspec|d:areaset|d:area">
75 <xsl:template match="d:areaset" mode="conumber">
76 <xsl:number count="d:area|d:areaset" format="1"/>
79 <xsl:template match="d:area" mode="conumber">
80 <xsl:number count="d:area|d:areaset" format="1"/>
83 <xsl:template match="d:co" name="co">
84 <!-- Support a single linkend in HTML -->
85 <xsl:variable name="targets" select="key('id', @linkends)"/>
86 <xsl:variable name="target" select="$targets[1]"/>
88 <xsl:when test="$target">
90 <xsl:apply-templates select="." mode="common.html.attributes"/>
92 <xsl:when test="$generate.id.attributes = 0">
93 <!-- force an id attribute here -->
94 <xsl:if test="@id or @xml:id">
95 <xsl:attribute name="id">
96 <xsl:value-of select="(@id|@xml:id)[1]"/>
101 <xsl:call-template name="id.attribute"/>
104 <xsl:attribute name="href">
105 <xsl:call-template name="href.target">
106 <xsl:with-param name="object" select="$target"/>
109 <xsl:apply-templates select="." mode="callout-bug"/>
113 <xsl:if test="$generate.id.attributes != 0">
114 <xsl:if test="@id or @xml:id">
116 <xsl:attribute name="id">
117 <xsl:value-of select="(@id|@xml:id)[1]"/>
122 <xsl:call-template name="anchor"/>
123 <xsl:apply-templates select="." mode="callout-bug"/>
128 <xsl:template match="d:coref">
129 <!-- tricky; this relies on the fact that we can process the "co" that's -->
130 <!-- "over there" as if it were "right here" -->
132 <xsl:variable name="co" select="key('id', @linkend)"/>
134 <xsl:when test="not($co)">
136 <xsl:text>Error: coref link is broken: </xsl:text>
137 <xsl:value-of select="@linkend"/>
140 <xsl:when test="local-name($co) != 'co'">
142 <xsl:text>Error: coref doesn't point to a co: </xsl:text>
143 <xsl:value-of select="@linkend"/>
147 <xsl:apply-templates select="$co"/>
152 <xsl:template match="d:co" mode="callout-bug">
153 <xsl:call-template name="callout-bug">
154 <xsl:with-param name="conum">
155 <xsl:number count="d:co" level="any" from="d:programlisting|d:screen|d:literallayout|d:synopsis" format="1"/>
160 <xsl:template name="callout-bug">
161 <xsl:param name="conum" select="1"/>
164 <xsl:when test="$callout.graphics != 0 and $conum <= $callout.graphics.number.limit">
165 <!-- Added span to make valid in XHTML 1 -->
166 <span><img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" alt="{$conum}" border="0"/></span>
168 <xsl:when test="$callout.unicode != 0 and $conum <= $callout.unicode.number.limit">
170 <xsl:when test="$callout.unicode.start.character = 10102">
172 <xsl:when test="$conum = 1">❶</xsl:when>
173 <xsl:when test="$conum = 2">❷</xsl:when>
174 <xsl:when test="$conum = 3">❸</xsl:when>
175 <xsl:when test="$conum = 4">❹</xsl:when>
176 <xsl:when test="$conum = 5">❺</xsl:when>
177 <xsl:when test="$conum = 6">❻</xsl:when>
178 <xsl:when test="$conum = 7">❼</xsl:when>
179 <xsl:when test="$conum = 8">❽</xsl:when>
180 <xsl:when test="$conum = 9">❾</xsl:when>
181 <xsl:when test="$conum = 10">❿</xsl:when>
186 <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
187 <xsl:text>when $callout.unicode.start.character is </xsl:text>
188 <xsl:value-of select="$callout.unicode.start.character"/>
190 <xsl:text>(</xsl:text>
191 <xsl:value-of select="$conum"/>
192 <xsl:text>)</xsl:text>
197 <xsl:text>(</xsl:text>
198 <xsl:value-of select="$conum"/>
199 <xsl:text>)</xsl:text>