1 <?xml version="1.0" encoding="ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <xsl:template name="add.annotation.links">
7 <xsl:param name="scripts" select="normalize-space($annotation.js)"/>
9 <xsl:when test="contains($scripts, ' ')">
10 <script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
11 <xsl:call-template name="add.annotation.links">
12 <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
16 <script type="text/javascript" src="{$scripts}"/>
21 <xsl:template match="annotation"/>
23 <xsl:template name="apply-annotations">
24 <xsl:if test="$annotation.support != 0">
25 <!-- do any annotations apply to the context node? -->
26 <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
28 <xsl:variable name="aids">
29 <xsl:for-each select="//annotation">
30 <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)">
31 <xsl:value-of select="generate-id()"/>
32 <xsl:text> </xsl:text>
35 <xsl:if test="normalize-space(@annotations) != ''">
36 <xsl:call-template name="annotations-pointed-to">
37 <xsl:with-param name="annotations" select="normalize-space(@annotations)"/>
42 <xsl:if test="$aids != ''">
43 <xsl:call-template name="apply-annotations-by-gid">
44 <xsl:with-param name="gids" select="normalize-space($aids)"/>
50 <xsl:template name="annotations-pointed-to">
51 <xsl:param name="annotations"/>
53 <xsl:when test="contains($annotations, ' ')">
54 <xsl:variable name="a" select="key('id', substring-before($annotations, ' '))"/>
56 <xsl:value-of select="generate-id($a)"/>
57 <xsl:text> </xsl:text>
59 <xsl:call-template name="annotations-pointed-to">
60 <xsl:with-param name="annotations" select="substring-after($annotations, ' ')"/>
64 <xsl:variable name="a" select="key('id', $annotations)"/>
66 <xsl:value-of select="generate-id($a)"/>
67 <xsl:text> </xsl:text>
73 <xsl:template name="apply-annotations-by-gid">
74 <xsl:param name="gids"/>
77 <xsl:when test="contains($gids, ' ')">
78 <xsl:variable name="gid" select="substring-before($gids, ' ')"/>
79 <xsl:apply-templates select="key('gid', $gid)" mode="annotation-inline"/>
80 <xsl:call-template name="apply-annotations-by-gid">
81 <xsl:with-param name="gids" select="substring-after($gids, ' ')"/>
85 <xsl:apply-templates select="key('gid', $gids)" mode="annotation-inline"/>
90 <xsl:template match="annotation" mode="annotation-inline">
91 <xsl:variable name="title">
93 <xsl:when test="title">
94 <xsl:value-of select="title"/>
97 <xsl:text>[Annotation #</xsl:text>
98 <xsl:number count="annotation" level="any" format="1"/>
99 <xsl:text>]</xsl:text>
104 <a id="anch-{generate-id(.)}" href="#annot-{generate-id(.)}" title="{$title}">
105 <xsl:apply-templates select="." mode="class.attribute"/>
106 <xsl:attribute name="onClick">
107 <xsl:text>popup_</xsl:text>
108 <xsl:value-of select="generate-id(.)"/>
109 <xsl:text>.showPopup('anch-</xsl:text>
110 <xsl:value-of select="generate-id(.)"/>
111 <xsl:text>'); return false;</xsl:text>
113 <img src="{$annotation.graphic.open}" alt="{$title}"/>
117 <xsl:template match="annotation" mode="annotation-popup">
118 <div class="annotation-nocss">
120 <a id="annot-{generate-id(.)}"/>
121 <xsl:text>Annotation #</xsl:text>
122 <xsl:number count="annotation" level="any" format="1"/>
123 <xsl:text>:</xsl:text>
127 <div id="popup-{generate-id(.)}" class="annotation-popup">
128 <xsl:if test="string-length(.) > 300">
129 <xsl:attribute name="style">width:400px</xsl:attribute>
132 <xsl:call-template name="annotation-title"/>
133 <div class="annotation-body">
134 <xsl:apply-templates select="*[local-name(.) != 'title']"/>
136 <div class="annotation-close">
137 <a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
138 <xsl:apply-templates select="." mode="class.attribute"/>
139 <img src="{$annotation.graphic.close}" alt="X"/>
145 <xsl:template name="annotation-title">
146 <div class="annotation-title">
148 <xsl:when test="title">
149 <xsl:apply-templates select="title/node()"/>
152 <xsl:text>Annotation</xsl:text>