styles/vym2xhtml.xsl
author insilmaril
Tue Jan 03 09:44:41 2006 +0000 (2006-01-03)
changeset 174 3674e9236634
child 179 d1d6d9c29f9f
permissions -rw-r--r--
1.7.6 New features for floatimages and fixes
insilmaril@38
     1
<?xml version="1.0" encoding="ISO-8859-1"?>
insilmaril@38
     2
<!DOCTYPE xsl:stylesheet
insilmaril@38
     3
[
insilmaril@38
     4
   <!-- Namespace for XHTML -->
insilmaril@38
     5
   <!ENTITY xhtmlns "http://www.w3.org/1999/xhtml">
insilmaril@38
     6
]>
insilmaril@38
     7
insilmaril@38
     8
<!--
insilmaril@38
     9
    Document    : vym2xhtml.xsl
insilmaril@38
    10
    Created     : 20040818
insilmaril@38
    11
    License     : GPL
insilmaril@38
    12
    Version     : 0.3.4
insilmaril@38
    13
    VYM version : 1.6.0
insilmaril@38
    14
    Author      : Thomas Schraitle <tom_schr@web.de>
insilmaril@38
    15
    Description : transforms vym-files into XHTML.
insilmaril@38
    16
    Bugs        : Many. ;) Produces at the moment not valid XHTML
insilmaril@38
    17
                  Needs to checked.
insilmaril@38
    18
-->
insilmaril@38
    19
insilmaril@38
    20
<xsl:stylesheet version="1.0"
insilmaril@38
    21
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
insilmaril@38
    22
    xmlns:date="http://exslt.org/dates-and-times"
insilmaril@38
    23
    extension-element-prefixes="date"
insilmaril@38
    24
    xmlns="&xhtmlns;">
insilmaril@38
    25
insilmaril@38
    26
insilmaril@38
    27
<xsl:output method="xml"
insilmaril@38
    28
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
insilmaril@38
    29
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
insilmaril@38
    30
    encoding="UTF-8"
insilmaril@38
    31
    indent="yes"
insilmaril@38
    32
    media-type="application/xhtml+xml"/>
insilmaril@38
    33
insilmaril@38
    34
insilmaril@38
    35
insilmaril@38
    36
<!-- ====================================================================== -->
insilmaril@38
    37
<!-- 1 = true, 0 = false -->
insilmaril@38
    38
insilmaril@38
    39
<!-- URL to CSS stylesheet -->
insilmaril@38
    40
<xsl:param name="css.stylesheet" select="'vym.css'"/>
insilmaril@38
    41
insilmaril@38
    42
<!-- Should a default CSS stylesheet be used? -->
insilmaril@38
    43
<xsl:param name="use.default.css.stylesheet" select="1"/>
insilmaril@38
    44
insilmaril@38
    45
<!-- Should textcolors be used? -->
insilmaril@38
    46
<xsl:param name="use.textcolor" select="0"/>
insilmaril@38
    47
insilmaril@38
    48
<!-- Should an imagemap be generated? -->
insilmaril@38
    49
<xsl:param name="use.imagemap" select="1"/>
insilmaril@38
    50
insilmaril@38
    51
<!-- URL to image for imagemap -->
insilmaril@38
    52
<xsl:param name="imagemap" select="''"/>
insilmaril@38
    53
insilmaril@38
    54
<!-- This stylesheet is able to process the following VYM version -->
insilmaril@38
    55
<xsl:param name="vym.version" select="'1.6.0'"/>
insilmaril@38
    56
insilmaril@38
    57
<!-- Should the VYM XML format be checked -->
insilmaril@38
    58
<xsl:param name="checkvym.version" select="1"/>
insilmaril@38
    59
insilmaril@38
    60
<!-- Which is the image extension? -->
insilmaril@38
    61
<xsl:param name="image.extension" select="'.png'"/>
insilmaril@38
    62
insilmaril@38
    63
<!-- Where are the flags? -->
insilmaril@38
    64
<xsl:param name="image.flags.path" select="'flags/'"/>
insilmaril@38
    65
insilmaril@38
    66
<!-- Filename of the XML document -->
insilmaril@38
    67
<xsl:param name="mapname" />
insilmaril@38
    68
insilmaril@38
    69
<!-- Should a footer be generated? -->
insilmaril@38
    70
<xsl:param name="use.footer" select="1"/>
insilmaril@38
    71
insilmaril@38
    72
<!-- How should Links generated:
insilmaril@38
    73
    name : Use only the name of the branch (default)
insilmaril@38
    74
    url  : Use only the URL of the branch
insilmaril@38
    75
    both : Use both
insilmaril@38
    76
-->
insilmaril@38
    77
<xsl:param name="link.style" select="'name'"/>
insilmaril@38
    78
insilmaril@38
    79
insilmaril@38
    80
insilmaril@38
    81
<!-- Debuggin on/off? -->
insilmaril@38
    82
<xsl:param name="debug" select="0"/>
insilmaril@38
    83
<xsl:template name="generate.footer">
insilmaril@38
    84
  <xsl:if test="$use.footer">
insilmaril@38
    85
      <hr/>
insilmaril@38
    86
      <table class="vym-footer">
insilmaril@38
    87
         <tr >
insilmaril@38
    88
         <td class="vym-footerL"><xsl:value-of select="$mapname"/></td>
insilmaril@38
    89
         <td class="vym-footerC"><xsl:value-of select="vymmap/@date"/> </td>
insilmaril@38
    90
         <!--<td class="vym-footerC"><xsl:value-of select="date:date()"/></td>-->
insilmaril@38
    91
         <td class="vym-footerR">vym <xsl:value-of select="vymmap/@version"/></td>
insilmaril@38
    92
         </tr>
insilmaril@38
    93
      </table>
insilmaril@38
    94
  </xsl:if>
insilmaril@38
    95
</xsl:template>
insilmaril@38
    96
insilmaril@38
    97
insilmaril@38
    98
insilmaril@38
    99
insilmaril@38
   100
insilmaril@38
   101
<!-- ====================================================================== -->
insilmaril@38
   102
<xsl:variable name="head.title">
insilmaril@38
   103
   <xsl:choose>
insilmaril@38
   104
      <xsl:when test="/vymmap/mapcenter/heading">
insilmaril@38
   105
         <xsl:value-of select="normalize-space(/vymmap/mapcenter/heading)"/>
insilmaril@38
   106
      </xsl:when>
insilmaril@38
   107
      <xsl:otherwise></xsl:otherwise>
insilmaril@38
   108
   </xsl:choose>
insilmaril@38
   109
</xsl:variable>
insilmaril@38
   110
insilmaril@38
   111
insilmaril@38
   112
<xsl:variable name="default.css.stylesheet">
insilmaril@38
   113
   <xsl:text>
insilmaril@38
   114
h1 {border-width: 1; border: solid; text-align: center}
insilmaril@38
   115
div.imagemap { align: center; border: 0; }
insilmaril@38
   116
   </xsl:text>
insilmaril@38
   117
</xsl:variable>
insilmaril@38
   118
insilmaril@38
   119
insilmaril@38
   120
<!-- ====================================================================== -->
insilmaril@38
   121
<xsl:template name="generate.head">
insilmaril@38
   122
   <head>
insilmaril@38
   123
      <title><xsl:value-of select="$head.title"/></title>
insilmaril@38
   124
      <xsl:if test="$use.default.css.stylesheet">
insilmaril@38
   125
         <style type="text/css">
insilmaril@38
   126
            <xsl:value-of select="$default.css.stylesheet"/>
insilmaril@38
   127
         </style>
insilmaril@38
   128
      </xsl:if>
insilmaril@38
   129
      <xsl:if test="vymmap/@author!=''">
insilmaril@38
   130
         <meta name="author" content="{vymmap/@author}"/>
insilmaril@38
   131
      </xsl:if>
insilmaril@38
   132
      <xsl:if test="vymmap/@comment!=''">
insilmaril@38
   133
         <meta name="comment" content="{vymmap/@comment}"/>
insilmaril@38
   134
      </xsl:if>
insilmaril@38
   135
      <meta name="generator" content="vym"/>
insilmaril@38
   136
      <xsl:if test="$css.stylesheet!=''">
insilmaril@38
   137
         <link rel="stylesheet" id="css.stylesheet" href="{$css.stylesheet}"/>
insilmaril@38
   138
      </xsl:if>
insilmaril@38
   139
   </head>
insilmaril@38
   140
</xsl:template>
insilmaril@38
   141
insilmaril@38
   142
insilmaril@38
   143
<xsl:template name="check.vym.version">
insilmaril@38
   144
   <xsl:if test="$checkvym.version">
insilmaril@38
   145
      <xsl:if test="not(/vymmap/@version=$vym.version)">
insilmaril@38
   146
         <xsl:message>
insilmaril@38
   147
            <xsl:text>&#10;</xsl:text>
insilmaril@38
   148
            <xsl:text>  WARNING:</xsl:text>
insilmaril@38
   149
            <xsl:text> This stylesheet applies to VYM XML format v.</xsl:text>
insilmaril@38
   150
            <xsl:value-of select="$vym.version"/>
insilmaril@38
   151
            <xsl:text>.&#10;  Your XML format has v</xsl:text>
insilmaril@38
   152
            <xsl:value-of select="/vymmap/@version"/>
insilmaril@38
   153
            <xsl:text>.&#10;  Check your HTML output!</xsl:text>
insilmaril@38
   154
            <xsl:text>&#10;&#10;</xsl:text>
insilmaril@38
   155
         </xsl:message>
insilmaril@38
   156
      </xsl:if>
insilmaril@38
   157
   </xsl:if>
insilmaril@38
   158
</xsl:template>
insilmaril@38
   159
insilmaril@38
   160
insilmaril@38
   161
<!-- ====================================================================== -->
insilmaril@38
   162
<xsl:template match="*">
insilmaril@38
   163
   <xsl:message>
insilmaril@38
   164
      <xsl:text>WARNING: Unknown tag "</xsl:text>
insilmaril@38
   165
      <xsl:value-of select="local-name(.)"/>
insilmaril@38
   166
      <xsl:text>": </xsl:text>
insilmaril@38
   167
      <xsl:value-of select="normalize-space(.)"/>
insilmaril@38
   168
      <xsl:text>&#10;</xsl:text>
insilmaril@38
   169
   </xsl:message>
insilmaril@38
   170
</xsl:template>
insilmaril@38
   171
insilmaril@38
   172
insilmaril@38
   173
<xsl:template match="/">
insilmaril@38
   174
   <xsl:call-template name="check.vym.version"/>
insilmaril@38
   175
insilmaril@38
   176
   <html xmlns="&xhtmlns;">
insilmaril@38
   177
      <xsl:call-template name="generate.head"/>
insilmaril@38
   178
      <body>
insilmaril@38
   179
         <xsl:apply-templates/>
insilmaril@38
   180
         <xsl:call-template name="generate.footer"/>
insilmaril@38
   181
insilmaril@38
   182
      </body>
insilmaril@38
   183
   </html>
insilmaril@38
   184
</xsl:template>
insilmaril@38
   185
insilmaril@38
   186
insilmaril@38
   187
<xsl:template match="vymmap">
insilmaril@38
   188
   <div class="vymmap">
insilmaril@38
   189
      <xsl:apply-templates/>
insilmaril@38
   190
   </div>
insilmaril@38
   191
</xsl:template>
insilmaril@38
   192
insilmaril@38
   193
insilmaril@38
   194
<xsl:template match="mapcenter">
insilmaril@38
   195
   <div class="mapcenter">
insilmaril@38
   196
      <xsl:apply-templates/>
insilmaril@38
   197
   </div>
insilmaril@38
   198
</xsl:template>
insilmaril@38
   199
insilmaril@38
   200
insilmaril@38
   201
<xsl:template match="mapcenter/heading">
insilmaril@38
   202
   <div class="vym-header">
insilmaril@38
   203
	   <xsl:apply-templates/>
insilmaril@38
   204
   </div>
insilmaril@38
   205
 
insilmaril@38
   206
      <xsl:if test="$use.imagemap=1">
insilmaril@38
   207
         <div class="vym-imagemap">
insilmaril@38
   208
            <img src="{$imagemap}"
insilmaril@38
   209
               alt="Imagemap"
insilmaril@38
   210
               class="imagemap"
insilmaril@38
   211
               usemap="#vym_imagemap"/>
insilmaril@38
   212
         </div>
insilmaril@38
   213
         <map name="vym_imagemap">
insilmaril@38
   214
            <xsl:apply-templates select="../branch" mode="imagemap"/>
insilmaril@38
   215
         </map>
insilmaril@38
   216
      </xsl:if>
insilmaril@38
   217
</xsl:template>
insilmaril@38
   218
insilmaril@38
   219
insilmaril@38
   220
<xsl:template match="mapcenter/branch">
insilmaril@38
   221
   <hr/>
insilmaril@38
   222
   <ul class="branch">
insilmaril@38
   223
      <xsl:apply-templates/>
insilmaril@38
   224
   </ul>
insilmaril@38
   225
</xsl:template>
insilmaril@38
   226
insilmaril@38
   227
insilmaril@38
   228
<xsl:template match="branch">
insilmaril@38
   229
   <ul class="branch">
insilmaril@38
   230
      <xsl:apply-templates/>
insilmaril@38
   231
   </ul>
insilmaril@38
   232
</xsl:template>
insilmaril@38
   233
insilmaril@38
   234
insilmaril@38
   235
<xsl:template match="heading">
insilmaril@38
   236
   <li class="heading">
insilmaril@38
   237
	  <span id="{generate-id(..)}">
insilmaril@38
   238
      <xsl:if test="@textColor!='' and $use.textcolor=1">
insilmaril@38
   239
         <xsl:attribute name="style" >color: <xsl:value-of select="@textColor" />
insilmaril@38
   240
		 </xsl:attribute>
insilmaril@38
   241
      </xsl:if>
insilmaril@38
   242
      <xsl:choose>
insilmaril@38
   243
         <xsl:when test="../@url">
insilmaril@38
   244
            <xsl:variable name="url" select="../@url"/>
insilmaril@38
   245
insilmaril@38
   246
            <!-- Check, how links should be generated -->
insilmaril@38
   247
            <xsl:choose>
insilmaril@38
   248
               <xsl:when test="$link.style = 'name'">
insilmaril@38
   249
                   <a href="{$url}">
insilmaril@38
   250
						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
insilmaril@38
   251
						<xsl:apply-templates/>
insilmaril@38
   252
					</a>
insilmaril@38
   253
               </xsl:when>
insilmaril@38
   254
               <xsl:when test="$link.style = 'url'">
insilmaril@38
   255
					<a href="{$url}">
insilmaril@38
   256
						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
insilmaril@38
   257
						<xsl:value-of select="$url"/>
insilmaril@38
   258
					</a>
insilmaril@38
   259
               </xsl:when>
insilmaril@38
   260
               <xsl:when test="$link.style = 'both'">
insilmaril@38
   261
                  <a href="{$url}">
insilmaril@38
   262
						<img src="{concat($image.flags.path,'url.png')}" border="0" valign="middle" alt="URL"/>
insilmaril@38
   263
						<xsl:apply-templates/> ( <xsl:value-of select="$url"/>)
insilmaril@38
   264
					</a>
insilmaril@38
   265
               </xsl:when>
insilmaril@38
   266
               <xsl:otherwise>
insilmaril@38
   267
                  <xsl:message>
insilmaril@38
   268
                     <xsl:text>WARNING: Parameter link.style doesn't contain the correct</xsl:text>
insilmaril@38
   269
                     <xsl:text> value (name|url|both)</xsl:text>
insilmaril@38
   270
                     <xsl:text>&#10; was "</xsl:text>
insilmaril@38
   271
                     <xsl:value-of select="$link.style"/>
insilmaril@38
   272
                     <xsl:text>"</xsl:text>
insilmaril@38
   273
                  </xsl:message>
insilmaril@38
   274
                  <a href="{$url}"><xsl:apply-templates/></a>
insilmaril@38
   275
               </xsl:otherwise>
insilmaril@38
   276
            </xsl:choose>
insilmaril@38
   277
insilmaril@38
   278
         </xsl:when>
insilmaril@38
   279
         <xsl:otherwise>
insilmaril@38
   280
            <xsl:apply-templates/>
insilmaril@38
   281
         </xsl:otherwise>
insilmaril@38
   282
      </xsl:choose>
insilmaril@38
   283
insilmaril@38
   284
      <xsl:for-each select="following-sibling::standardflag">
insilmaril@38
   285
         <xsl:apply-templates select="current()" mode="standardflag"/>
insilmaril@38
   286
      </xsl:for-each>
insilmaril@38
   287
      </span>
insilmaril@38
   288
   </li>
insilmaril@38
   289
</xsl:template>
insilmaril@38
   290
insilmaril@38
   291
insilmaril@38
   292
<xsl:template match="floatimage">
insilmaril@38
   293
   <xsl:variable name="filename">
insilmaril@38
   294
      <xsl:choose>
insilmaril@38
   295
         <xsl:when test="contains(@href,':')">
insilmaril@38
   296
            <xsl:value-of select="substring-after(@href,':')"/>
insilmaril@38
   297
         </xsl:when>
insilmaril@38
   298
         <xsl:otherwise>
insilmaril@38
   299
            <xsl:value-of select="@href"/>
insilmaril@38
   300
         </xsl:otherwise>
insilmaril@38
   301
      </xsl:choose>
insilmaril@38
   302
   </xsl:variable>
insilmaril@38
   303
   
insilmaril@38
   304
  <xsl:if test="@floatExport='true'">
insilmaril@38
   305
      <span><img src="{$filename}" alt="{$filename}"/></span>
insilmaril@38
   306
  </xsl:if>
insilmaril@38
   307
</xsl:template>
insilmaril@38
   308
insilmaril@38
   309
insilmaril@38
   310
<xsl:template match="standardflag"/><!-- Do nothing in normal mode -->
insilmaril@38
   311
insilmaril@38
   312
<xsl:template match="standardflag" mode="standardflag">
insilmaril@38
   313
   <span class="standardflag">
insilmaril@38
   314
      <xsl:element name="img">
insilmaril@38
   315
         <xsl:variable name="_srcimg">
insilmaril@38
   316
         <xsl:choose>
insilmaril@38
   317
            <xsl:when test="$image.flags.path">
insilmaril@38
   318
               <xsl:value-of select="concat($image.flags.path,
insilmaril@38
   319
                  .,
insilmaril@38
   320
                  $image.extension)"/>
insilmaril@38
   321
            </xsl:when>
insilmaril@38
   322
            <xsl:otherwise>
insilmaril@38
   323
               <xsl:value-of select="concat(., $image.extension)"/>
insilmaril@38
   324
            </xsl:otherwise>
insilmaril@38
   325
         </xsl:choose>
insilmaril@38
   326
         </xsl:variable>
insilmaril@38
   327
         <xsl:attribute name="src">
insilmaril@38
   328
            <xsl:value-of select="$_srcimg"/>
insilmaril@38
   329
         </xsl:attribute>
insilmaril@38
   330
         <xsl:attribute name="alt">
insilmaril@38
   331
            <xsl:value-of select="$_srcimg"/>
insilmaril@38
   332
         </xsl:attribute>
insilmaril@38
   333
      </xsl:element>
insilmaril@38
   334
   </span>
insilmaril@38
   335
</xsl:template>
insilmaril@38
   336
insilmaril@38
   337
<!-- Do nothing! -->
insilmaril@38
   338
<xsl:template match="select"/>
insilmaril@38
   339
<xsl:template match="setting"/>
insilmaril@38
   340
insilmaril@38
   341
insilmaril@38
   342
<xsl:template match="htmlnote">
insilmaril@38
   343
   <div class="vym-htmlnote" >
insilmaril@38
   344
      <xsl:apply-templates select=".//body/*"/><!-- Select only body elements -->
insilmaril@38
   345
   </div>
insilmaril@38
   346
</xsl:template>
insilmaril@38
   347
insilmaril@38
   348
<!-- Do nothing! We don't need some informational elements -->
insilmaril@38
   349
<xsl:template match="htmlnote/html/*"/>
insilmaril@38
   350
insilmaril@38
   351
<xsl:template match="htmlnote/html/body">
insilmaril@38
   352
   <xsl:copy-of select="."/>
insilmaril@38
   353
</xsl:template>
insilmaril@38
   354
insilmaril@38
   355
<xsl:template match="htmlnote/html/body/*">
insilmaril@38
   356
   <xsl:copy-of select="."/>
insilmaril@38
   357
</xsl:template>
insilmaril@38
   358
insilmaril@38
   359
insilmaril@38
   360
<!-- ====================================================================== -->
insilmaril@38
   361
<xsl:template match="branch" mode="imagemap"> 
insilmaril@38
   362
   <xsl:param name="node"/> 
insilmaril@38
   363
   <xsl:variable name="title"> 
insilmaril@38
   364
      <xsl:apply-templates mode="imagemap"/> 
insilmaril@38
   365
   </xsl:variable> 
insilmaril@38
   366
 
insilmaril@38
   367
   <xsl:if test="$debug=1"> 
insilmaril@38
   368
      <xsl:message> 
insilmaril@38
   369
      branch/heading = "<xsl:value-of select="normalize-space($title)"/>" 
insilmaril@38
   370
      x1, x2 = <xsl:value-of select="concat(@x1, '/', @x2)"/> 
insilmaril@38
   371
      y1, y2 = <xsl:value-of select="concat(@y1, '/', @y2)"/> 
insilmaril@38
   372
      </xsl:message> 
insilmaril@38
   373
   </xsl:if> 
insilmaril@38
   374
 
insilmaril@38
   375
   <area shape="rect"> 
insilmaril@38
   376
      <xsl:attribute name="href"> 
insilmaril@38
   377
         <xsl:choose><!-- Fix begin (!) --> 
insilmaril@38
   378
            <xsl:when test="$imagemap != ''"> 
insilmaril@38
   379
               <xsl:value-of select="concat('#', generate-id(.))"/> 
insilmaril@38
   380
            </xsl:when> 
insilmaril@38
   381
            <xsl:when test="$imagemap and @url"> 
insilmaril@38
   382
               <xsl:value-of select="@url"/> 
insilmaril@38
   383
            </xsl:when> 
insilmaril@38
   384
            <xsl:when test="$imagemap and @vymLink"> 
insilmaril@38
   385
               <xsl:value-of select="concat( substring-before(@vymLink, 
insilmaril@38
   386
'.vym'), '.html')"/> 
insilmaril@38
   387
            </xsl:when> 
insilmaril@38
   388
         </xsl:choose><!-- Fix end --> 
insilmaril@38
   389
      </xsl:attribute> 
insilmaril@38
   390
      <xsl:attribute name="alt"> 
insilmaril@38
   391
         <xsl:value-of select="normalize-space($title)"/> 
insilmaril@38
   392
      </xsl:attribute> 
insilmaril@38
   393
      <xsl:attribute name="title"> 
insilmaril@38
   394
         <xsl:value-of select="normalize-space($title)"/> 
insilmaril@38
   395
      </xsl:attribute> 
insilmaril@38
   396
      <xsl:attribute name="coords"> 
insilmaril@38
   397
         <xsl:choose> 
insilmaril@38
   398
            <xsl:when test="@x1!='' and @x2!='' and @y1!='' and @y2!=''"> 
insilmaril@38
   399
               <xsl:value-of select="@x1"/> 
insilmaril@38
   400
               <xsl:text>,</xsl:text> 
insilmaril@38
   401
               <xsl:value-of select="@y1"/> 
insilmaril@38
   402
               <xsl:text>,</xsl:text> 
insilmaril@38
   403
               <xsl:value-of select="@x2"/> 
insilmaril@38
   404
               <xsl:text>,</xsl:text> 
insilmaril@38
   405
               <xsl:value-of select="@y2"/> 
insilmaril@38
   406
            </xsl:when> 
insilmaril@38
   407
            <xsl:otherwise> 
insilmaril@38
   408
               <!-- 
insilmaril@38
   409
               <xsl:message> 
insilmaril@38
   410
                  <xsl:text>ERROR: Some coordinates in branch are 
insilmaril@38
   411
missing!&#10;</xsl:text> 
insilmaril@38
   412
                  <xsl:text>       See branch with </xsl:text> 
insilmaril@38
   413
                  <xsl:value-of select="normalize-space($title)"/> 
insilmaril@38
   414
               </xsl:message> 
insilmaril@38
   415
               //--> 
insilmaril@38
   416
            </xsl:otherwise> 
insilmaril@38
   417
         </xsl:choose> 
insilmaril@38
   418
      </xsl:attribute> 
insilmaril@38
   419
   </area> 
insilmaril@38
   420
   <xsl:apply-templates select="./branch" mode="imagemap"/> 
insilmaril@38
   421
</xsl:template> 
insilmaril@38
   422
insilmaril@38
   423
insilmaril@38
   424
insilmaril@38
   425
<xsl:template match="heading" mode="imagemap">
insilmaril@38
   426
   <xsl:apply-templates mode="imagemap"/>
insilmaril@38
   427
</xsl:template>
insilmaril@38
   428
insilmaril@38
   429
insilmaril@38
   430
</xsl:stylesheet>