1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim" xmlns:xverb="com.nwalsh.xalan.Verbatim" xmlns:lxslt="http://xml.apache.org/xslt" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="sverb xverb lxslt" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <lxslt:component prefix="xverb" functions="insertCallouts"/>
18 <xsl:template match="programlistingco|screenco">
19 <xsl:variable name="verbatim" select="programlisting|screen"/>
22 <xsl:when test="$use.extensions != '0' and $callouts.extension != '0'">
23 <xsl:variable name="rtf">
24 <xsl:apply-templates select="$verbatim">
25 <xsl:with-param name="suppress-numbers" select="'1'"/>
26 </xsl:apply-templates>
29 <xsl:variable name="rtf-with-callouts">
31 <xsl:when test="function-available('sverb:insertCallouts')">
32 <xsl:copy-of select="sverb:insertCallouts(areaspec,$rtf)"/>
34 <xsl:when test="function-available('xverb:insertCallouts')">
35 <xsl:copy-of select="xverb:insertCallouts(areaspec,$rtf)"/>
38 <xsl:message terminate="yes">
39 <xsl:text>No insertCallouts function is available.</xsl:text>
46 <xsl:when test="$verbatim/@linenumbering = 'numbered' and $linenumbering.extension != '0'">
47 <div class="{name(.)}">
48 <xsl:call-template name="number.rtf.lines">
49 <xsl:with-param name="rtf" select="$rtf-with-callouts"/>
50 <xsl:with-param name="pi.context" select="programlisting|screen"/>
52 <xsl:apply-templates select="calloutlist"/>
56 <div class="{name(.)}">
57 <xsl:copy-of select="$rtf-with-callouts"/>
58 <xsl:apply-templates select="calloutlist"/>
64 <div class="{name(.)}">
65 <xsl:apply-templates/>
71 <xsl:template match="areaspec|areaset|area">
74 <xsl:template match="areaset" mode="conumber">
75 <xsl:number count="area|areaset" format="1"/>
78 <xsl:template match="area" mode="conumber">
79 <xsl:number count="area|areaset" format="1"/>
82 <xsl:template match="co" name="co">
83 <!-- Support a single linkend in HTML -->
84 <xsl:variable name="targets" select="key('id', @linkends)"/>
85 <xsl:variable name="target" select="$targets[1]"/>
87 <xsl:when test="$target">
90 <xsl:attribute name="id">
91 <xsl:value-of select="@id"/>
94 <xsl:attribute name="href">
95 <xsl:call-template name="href.target">
96 <xsl:with-param name="object" select="$target"/>
99 <xsl:apply-templates select="." mode="callout-bug"/>
103 <xsl:call-template name="anchor"/>
104 <xsl:apply-templates select="." mode="callout-bug"/>
109 <xsl:template match="coref">
110 <!-- tricky; this relies on the fact that we can process the "co" that's -->
111 <!-- "over there" as if it were "right here" -->
113 <xsl:variable name="co" select="key('id', @linkend)"/>
115 <xsl:when test="not($co)">
117 <xsl:text>Error: coref link is broken: </xsl:text>
118 <xsl:value-of select="@linkend"/>
121 <xsl:when test="local-name($co) != 'co'">
123 <xsl:text>Error: coref doesn't point to a co: </xsl:text>
124 <xsl:value-of select="@linkend"/>
128 <xsl:apply-templates select="$co"/>
133 <xsl:template match="co" mode="callout-bug">
134 <xsl:call-template name="callout-bug">
135 <xsl:with-param name="conum">
136 <xsl:number count="co" level="any" from="programlisting|screen|literallayout|synopsis" format="1"/>
141 <xsl:template name="callout-bug">
142 <xsl:param name="conum" select="1"/>
145 <xsl:when test="$callout.graphics != 0 and $conum <= $callout.graphics.number.limit">
146 <img src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" alt="{$conum}" border="0"/>
148 <xsl:when test="$callout.unicode != 0 and $conum <= $callout.unicode.number.limit">
150 <xsl:when test="$callout.unicode.start.character = 10102">
152 <xsl:when test="$conum = 1">❶</xsl:when>
153 <xsl:when test="$conum = 2">❷</xsl:when>
154 <xsl:when test="$conum = 3">❸</xsl:when>
155 <xsl:when test="$conum = 4">❹</xsl:when>
156 <xsl:when test="$conum = 5">❺</xsl:when>
157 <xsl:when test="$conum = 6">❻</xsl:when>
158 <xsl:when test="$conum = 7">❼</xsl:when>
159 <xsl:when test="$conum = 8">❽</xsl:when>
160 <xsl:when test="$conum = 9">❾</xsl:when>
161 <xsl:when test="$conum = 10">❿</xsl:when>
166 <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
167 <xsl:text>when $callout.unicode.start.character is </xsl:text>
168 <xsl:value-of select="$callout.unicode.start.character"/>
170 <xsl:text>(</xsl:text>
171 <xsl:value-of select="$conum"/>
172 <xsl:text>)</xsl:text>
177 <xsl:text>(</xsl:text>
178 <xsl:value-of select="$conum"/>
179 <xsl:text>)</xsl:text>