| 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="http://www.w3.org/1999/xhtml" version="1.0">
 | 
|---|
| 5 | 
 | 
|---|
| 6 | <xsl:template name="add.annotation.links">
 | 
|---|
| 7 |   <xsl:param name="scripts" select="normalize-space($annotation.js)"/>
 | 
|---|
| 8 |   <xsl:choose>
 | 
|---|
| 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, ' ')"/>
 | 
|---|
| 13 |       </xsl:call-template>
 | 
|---|
| 14 |     </xsl:when>
 | 
|---|
| 15 |     <xsl:otherwise>
 | 
|---|
| 16 |       <script type="text/javascript" src="{$scripts}"/>
 | 
|---|
| 17 |     </xsl:otherwise>
 | 
|---|
| 18 |   </xsl:choose>
 | 
|---|
| 19 | </xsl:template>
 | 
|---|
| 20 | 
 | 
|---|
| 21 | <xsl:template match="annotation"/>
 | 
|---|
| 22 | 
 | 
|---|
| 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]"/>
 | 
|---|
| 27 | 
 | 
|---|
| 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>
 | 
|---|
| 33 |       </xsl:if>
 | 
|---|
| 34 |     </xsl:for-each>
 | 
|---|
| 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)"/>
 | 
|---|
| 38 |       </xsl:call-template>
 | 
|---|
| 39 |     </xsl:if>
 | 
|---|
| 40 |   </xsl:variable>
 | 
|---|
| 41 | 
 | 
|---|
| 42 |   <xsl:if test="$aids != ''">
 | 
|---|
| 43 |     <xsl:call-template name="apply-annotations-by-gid">
 | 
|---|
| 44 |       <xsl:with-param name="gids" select="normalize-space($aids)"/>
 | 
|---|
| 45 |     </xsl:call-template>
 | 
|---|
| 46 |   </xsl:if>
 | 
|---|
| 47 |   </xsl:if>
 | 
|---|
| 48 | </xsl:template>
 | 
|---|
| 49 | 
 | 
|---|
| 50 | <xsl:template name="annotations-pointed-to">
 | 
|---|
| 51 |   <xsl:param name="annotations"/>
 | 
|---|
| 52 |   <xsl:choose>
 | 
|---|
| 53 |     <xsl:when test="contains($annotations, ' ')">
 | 
|---|
| 54 |       <xsl:variable name="a" select="key('id', substring-before($annotations, ' '))"/>
 | 
|---|
| 55 |       <xsl:if test="$a">
 | 
|---|
| 56 |         <xsl:value-of select="generate-id($a)"/>
 | 
|---|
| 57 |         <xsl:text> </xsl:text>
 | 
|---|
| 58 |       </xsl:if>
 | 
|---|
| 59 |       <xsl:call-template name="annotations-pointed-to">
 | 
|---|
| 60 |         <xsl:with-param name="annotations" select="substring-after($annotations, ' ')"/>
 | 
|---|
| 61 |       </xsl:call-template>
 | 
|---|
| 62 |     </xsl:when>
 | 
|---|
| 63 |     <xsl:otherwise>
 | 
|---|
| 64 |       <xsl:variable name="a" select="key('id', $annotations)"/>
 | 
|---|
| 65 |       <xsl:if test="$a">
 | 
|---|
| 66 |         <xsl:value-of select="generate-id($a)"/>
 | 
|---|
| 67 |         <xsl:text> </xsl:text>
 | 
|---|
| 68 |       </xsl:if>
 | 
|---|
| 69 |     </xsl:otherwise>
 | 
|---|
| 70 |   </xsl:choose>
 | 
|---|
| 71 | </xsl:template>
 | 
|---|
| 72 | 
 | 
|---|
| 73 | <xsl:template name="apply-annotations-by-gid">
 | 
|---|
| 74 |   <xsl:param name="gids"/>
 | 
|---|
| 75 | 
 | 
|---|
| 76 |   <xsl:choose>
 | 
|---|
| 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, ' ')"/>
 | 
|---|
| 82 |       </xsl:call-template>
 | 
|---|
| 83 |     </xsl:when>
 | 
|---|
| 84 |     <xsl:otherwise>
 | 
|---|
| 85 |       <xsl:apply-templates select="key('gid', $gids)" mode="annotation-inline"/>
 | 
|---|
| 86 |     </xsl:otherwise>
 | 
|---|
| 87 |   </xsl:choose>
 | 
|---|
| 88 | </xsl:template>
 | 
|---|
| 89 | 
 | 
|---|
| 90 | <xsl:template match="annotation" mode="annotation-inline">
 | 
|---|
| 91 |   <xsl:variable name="title">
 | 
|---|
| 92 |     <xsl:choose>
 | 
|---|
| 93 |       <xsl:when test="title">
 | 
|---|
| 94 |         <xsl:value-of select="title"/>
 | 
|---|
| 95 |       </xsl:when>
 | 
|---|
| 96 |       <xsl:otherwise>
 | 
|---|
| 97 |         <xsl:text>[Annotation #</xsl:text>
 | 
|---|
| 98 |         <xsl:number count="annotation" level="any" format="1"/>
 | 
|---|
| 99 |         <xsl:text>]</xsl:text>
 | 
|---|
| 100 |       </xsl:otherwise>
 | 
|---|
| 101 |     </xsl:choose>
 | 
|---|
| 102 |   </xsl:variable>
 | 
|---|
| 103 | 
 | 
|---|
| 104 |   <a id="anch-{generate-id(.)}" href="#annot-{generate-id(.)}" title="{$title}">
 | 
|---|
| 105 |     <xsl:attribute name="onClick">
 | 
|---|
| 106 |       <xsl:text>popup_</xsl:text>
 | 
|---|
| 107 |       <xsl:value-of select="generate-id(.)"/>
 | 
|---|
| 108 |       <xsl:text>.showPopup('anch-</xsl:text>
 | 
|---|
| 109 |       <xsl:value-of select="generate-id(.)"/>
 | 
|---|
| 110 |       <xsl:text>'); return false;</xsl:text>
 | 
|---|
| 111 |     </xsl:attribute>
 | 
|---|
| 112 |     <img src="{$annotation.graphic.open}" border="0" alt="{$title}"/>
 | 
|---|
| 113 |   </a>
 | 
|---|
| 114 | </xsl:template>
 | 
|---|
| 115 | 
 | 
|---|
| 116 | <xsl:template match="annotation" mode="annotation-popup">
 | 
|---|
| 117 |   <div class="annotation-nocss">
 | 
|---|
| 118 |     <p>
 | 
|---|
| 119 |       <a id="annot-{generate-id(.)}"/>
 | 
|---|
| 120 |       <xsl:text>Annotation #</xsl:text>
 | 
|---|
| 121 |       <xsl:number count="annotation" level="any" format="1"/>
 | 
|---|
| 122 |       <xsl:text>:</xsl:text>
 | 
|---|
| 123 |     </p>
 | 
|---|
| 124 |   </div>
 | 
|---|
| 125 | 
 | 
|---|
| 126 |   <div id="popup-{generate-id(.)}" class="annotation-popup">
 | 
|---|
| 127 |     <xsl:if test="string-length(.) > 300">
 | 
|---|
| 128 |       <xsl:attribute name="style">width:400px</xsl:attribute>
 | 
|---|
| 129 |     </xsl:if>
 | 
|---|
| 130 | 
 | 
|---|
| 131 |     <xsl:call-template name="annotation-title"/>
 | 
|---|
| 132 |     <div class="annotation-body">
 | 
|---|
| 133 |       <xsl:apply-templates select="*[local-name(.) != 'title']"/>
 | 
|---|
| 134 |     </div>
 | 
|---|
| 135 |     <div class="annotation-close">
 | 
|---|
| 136 |       <a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
 | 
|---|
| 137 |         <img src="{$annotation.graphic.close}" alt="X" border="0"/>
 | 
|---|
| 138 |       </a>
 | 
|---|
| 139 |     </div>
 | 
|---|
| 140 |   </div>
 | 
|---|
| 141 | </xsl:template>
 | 
|---|
| 142 | 
 | 
|---|
| 143 | <xsl:template name="annotation-title">
 | 
|---|
| 144 |   <div class="annotation-title">
 | 
|---|
| 145 |     <xsl:choose>
 | 
|---|
| 146 |       <xsl:when test="title">
 | 
|---|
| 147 |         <xsl:apply-templates select="title/node()"/>
 | 
|---|
| 148 |       </xsl:when>
 | 
|---|
| 149 |       <xsl:otherwise>
 | 
|---|
| 150 |         <xsl:text>Annotation</xsl:text>
 | 
|---|
| 151 |       </xsl:otherwise>
 | 
|---|
| 152 |     </xsl:choose>
 | 
|---|
| 153 |   </div>
 | 
|---|
| 154 | </xsl:template>
 | 
|---|
| 155 | 
 | 
|---|
| 156 | </xsl:stylesheet>
 | 
|---|