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="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d" version="1.0">
3 <xsl:template name="add.annotation.links">
4 <xsl:param name="scripts" select="normalize-space($annotation.js)"/>
6 <xsl:when test="contains($scripts, ' ')">
7 <script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
8 <xsl:call-template name="add.annotation.links">
9 <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
13 <script type="text/javascript" src="{$scripts}"/>
18 <xsl:template match="d:annotation"/>
20 <xsl:template name="apply-annotations">
21 <xsl:if test="$annotation.support != 0">
22 <!-- do any annotations apply to the context node? -->
23 <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
25 <xsl:variable name="aids">
26 <xsl:for-each select="//d:annotation">
27 <xsl:if test="@annotates=$id or starts-with(@annotates, concat($id, ' ')) or contains(@annotates, concat(' ', $id, ' ')) or substring(@annotates, string-length(@annotates)-3) = concat(' ', $id)">
28 <xsl:value-of select="generate-id()"/>
29 <xsl:text> </xsl:text>
32 <xsl:if test="normalize-space(@annotations) != ''">
33 <xsl:call-template name="annotations-pointed-to">
34 <xsl:with-param name="annotations" select="normalize-space(@annotations)"/>
39 <xsl:if test="$aids != ''">
40 <xsl:call-template name="apply-annotations-by-gid">
41 <xsl:with-param name="gids" select="normalize-space($aids)"/>
47 <xsl:template name="annotations-pointed-to">
48 <xsl:param name="annotations"/>
50 <xsl:when test="contains($annotations, ' ')">
51 <xsl:variable name="a" select="key('id', substring-before($annotations, ' '))"/>
53 <xsl:value-of select="generate-id($a)"/>
54 <xsl:text> </xsl:text>
56 <xsl:call-template name="annotations-pointed-to">
57 <xsl:with-param name="annotations" select="substring-after($annotations, ' ')"/>
61 <xsl:variable name="a" select="key('id', $annotations)"/>
63 <xsl:value-of select="generate-id($a)"/>
64 <xsl:text> </xsl:text>
70 <xsl:template name="apply-annotations-by-gid">
71 <xsl:param name="gids"/>
74 <xsl:when test="contains($gids, ' ')">
75 <xsl:variable name="gid" select="substring-before($gids, ' ')"/>
76 <xsl:apply-templates select="key('gid', $gid)" mode="annotation-inline"/>
77 <xsl:call-template name="apply-annotations-by-gid">
78 <xsl:with-param name="gids" select="substring-after($gids, ' ')"/>
82 <xsl:apply-templates select="key('gid', $gids)" mode="annotation-inline"/>
87 <xsl:template match="d:annotation" mode="annotation-inline">
88 <xsl:variable name="title">
90 <xsl:when test="d:title">
91 <xsl:value-of select="d:title"/>
94 <xsl:text>[Annotation #</xsl:text>
95 <xsl:number count="d:annotation" level="any" format="1"/>
96 <xsl:text>]</xsl:text>
101 <a id="anch-{generate-id(.)}" href="#annot-{generate-id(.)}" title="{$title}">
102 <xsl:apply-templates select="." mode="class.attribute"/>
103 <xsl:attribute name="onClick">
104 <xsl:text>popup_</xsl:text>
105 <xsl:value-of select="generate-id(.)"/>
106 <xsl:text>.showPopup('anch-</xsl:text>
107 <xsl:value-of select="generate-id(.)"/>
108 <xsl:text>'); return false;</xsl:text>
110 <img src="{$annotation.graphic.open}" border="0" alt="{$title}"/>
114 <xsl:template match="d:annotation" mode="annotation-popup">
115 <div class="annotation-nocss">
117 <a id="annot-{generate-id(.)}"/>
118 <xsl:text>Annotation #</xsl:text>
119 <xsl:number count="d:annotation" level="any" format="1"/>
120 <xsl:text>:</xsl:text>
124 <div id="popup-{generate-id(.)}" class="annotation-popup">
125 <xsl:if test="string-length(.) > 300">
126 <xsl:attribute name="style">width:400px</xsl:attribute>
129 <xsl:call-template name="annotation-title"/>
130 <div class="annotation-body">
131 <xsl:apply-templates select="*[local-name(.) != 'title']"/>
133 <div class="annotation-close">
134 <a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
135 <xsl:apply-templates select="." mode="class.attribute"/>
136 <img src="{$annotation.graphic.close}" alt="X" border="0"/>
142 <xsl:template name="annotation-title">
143 <div class="annotation-title">
145 <xsl:when test="d:title">
146 <xsl:apply-templates select="d:title/node()"/>
149 <xsl:text>Annotation</xsl:text>