styles/tm.xsl
author insilmaril
Wed, 09 Jun 2010 13:14:08 +0000
changeset 847 43268373032d
parent 37 df767ed748f3
permissions -rw-r--r--
1.13.4 Various fixes
insilmaril@37
     1
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
insilmaril@37
     2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" version="1.0">
insilmaril@37
     3
insilmaril@37
     4
<xsl:template name="getTopicName">
insilmaril@37
     5
	<xsl:param name="id"/>
insilmaril@37
     6
	<xsl:variable name="searching" select="$topics[@id=$id]" />
insilmaril@37
     7
	<xsl:variable name="get"><xsl:value-of select="$searching/baseName/baseNameString" /><xsl:value-of select="$searching/@name" /></xsl:variable>
insilmaril@37
     8
	<xsl:if test="string( $get )"><xsl:value-of select="$get" /></xsl:if>
insilmaril@37
     9
	<xsl:if test="not(string( $get ))"><span class="notFound"><xsl:value-of select="$id" /> not found.</span></xsl:if>
insilmaril@37
    10
</xsl:template>
insilmaril@37
    11
	
insilmaril@37
    12
<xsl:template name="getParent">
insilmaril@37
    13
	<xsl:param name="currentID"/>
insilmaril@37
    14
	<xsl:call-template name="getAllAssocID">
insilmaril@37
    15
		<xsl:with-param name="filter" select="'#group-subgroup'" />
insilmaril@37
    16
		<xsl:with-param name="role" select="'#parent'" />
insilmaril@37
    17
		<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
    18
	</xsl:call-template>
insilmaril@37
    19
</xsl:template>
insilmaril@37
    20
insilmaril@37
    21
<xsl:template name="getChild">
insilmaril@37
    22
	<xsl:param name="currentID"/>
insilmaril@37
    23
	<xsl:call-template name="getAllAssocID">
insilmaril@37
    24
		<xsl:with-param name="filter" select="'#group-subgroup'" />
insilmaril@37
    25
		<xsl:with-param name="role" select="'#child'" />
insilmaril@37
    26
		<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
    27
	</xsl:call-template>
insilmaril@37
    28
</xsl:template>
insilmaril@37
    29
insilmaril@37
    30
<xsl:template name="getAllAssocID">
insilmaril@37
    31
	<xsl:param name="filter"/>
insilmaril@37
    32
	<xsl:param name="role"/>
insilmaril@37
    33
	<xsl:param name="currentID"/>
insilmaril@37
    34
	
insilmaril@37
    35
	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
insilmaril@37
    36
	<xsl:variable name="fiddle" select="$theseOnes/member/topicRef[not(@xlink:href=concat('#',$currentID))][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
insilmaril@37
    37
insilmaril@37
    38
	<xsl:value-of select="substring-after($fiddle[1]/@xlink:href, '#')" />
insilmaril@37
    39
	
insilmaril@37
    40
</xsl:template>
insilmaril@37
    41
insilmaril@37
    42
<xsl:template name="getAllAssoc">
insilmaril@37
    43
	<xsl:param name="filter"/>
insilmaril@37
    44
	<xsl:param name="role"/>
insilmaril@37
    45
	<xsl:param name="style" select="'default'" />
insilmaril@37
    46
	<xsl:param name="title"/>
insilmaril@37
    47
	<xsl:param name="box"/>
insilmaril@37
    48
	<xsl:param name="without"/>
insilmaril@37
    49
	<xsl:param name="currentID"/>
insilmaril@37
    50
	<xsl:param name="againstID"/>
insilmaril@37
    51
	
insilmaril@37
    52
	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
insilmaril@37
    53
insilmaril@37
    54
 	<xsl:variable name="found"><xsl:choose> 
insilmaril@37
    55
			<xsl:when test="$style = 'sections'">
insilmaril@37
    56
				<table border="0" cellspacing="0" cellpadding="0" class="sections"><tr>
insilmaril@37
    57
				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
insilmaril@37
    58
					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
insilmaril@37
    59
					<xsl:variable name="cat" select="concat('#',$currentID)" />
insilmaril@37
    60
					<td valign="top" class="{$style}Menu">
insilmaril@37
    61
						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a>
insilmaril@37
    62
						<div class="{$style}MenuContent"><xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template></div>
insilmaril@37
    63
					</td>
insilmaril@37
    64
		 		</xsl:for-each>
insilmaril@37
    65
				</tr></table>
insilmaril@37
    66
			</xsl:when>
insilmaril@37
    67
			<xsl:when test="$style = 'news'">
insilmaril@37
    68
				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
insilmaril@37
    69
					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
insilmaril@37
    70
					<xsl:variable name="cat" select="concat('#',$currentID)" />
insilmaril@37
    71
					<div class="{$style}Menu">
insilmaril@37
    72
						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
insilmaril@37
    73
							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
insilmaril@37
    74
							<xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /><xsl:with-param name="style" select="'news'" /></xsl:call-template>
insilmaril@37
    75
						</a>
insilmaril@37
    76
					</div>
insilmaril@37
    77
		 		</xsl:for-each>
insilmaril@37
    78
			</xsl:when>
insilmaril@37
    79
			<xsl:when test="$style = 'smallnews'">
insilmaril@37
    80
				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
insilmaril@37
    81
					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
insilmaril@37
    82
					<xsl:variable name="cat" select="concat('#',$currentID)" />
insilmaril@37
    83
					<div class="{$style}Menu">
insilmaril@37
    84
						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
insilmaril@37
    85
							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
insilmaril@37
    86
							 <xsl:call-template name="getShort"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template>
insilmaril@37
    87
						</a>
insilmaril@37
    88
					</div>
insilmaril@37
    89
		 		</xsl:for-each>
insilmaril@37
    90
			</xsl:when>
insilmaril@37
    91
			<xsl:otherwise>
insilmaril@37
    92
			
insilmaril@37
    93
				<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
insilmaril@37
    94
				<xsl:for-each select="$allThese"> 
insilmaril@37
    95
				
insilmaril@37
    96
				<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
insilmaril@37
    97
					<xsl:variable name="cat" select="concat('#',$currentID)" />
insilmaril@37
    98
						<xsl:choose> 
insilmaril@37
    99
							<xsl:when test="$style = 'right' or $style = 'left' or $style = 'full' or $style = 'tree'">
insilmaril@37
   100
								<xsl:choose>
insilmaril@37
   101
									<xsl:when test="$thisOne = $againstID">
insilmaril@37
   102
										<div class="{$style}MenuSelected"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </div>
insilmaril@37
   103
									</xsl:when>
insilmaril@37
   104
									<xsl:otherwise>
insilmaril@37
   105
										<div class="{$style}Menu"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </div>
insilmaril@37
   106
									</xsl:otherwise>
insilmaril@37
   107
								</xsl:choose>
insilmaril@37
   108
							</xsl:when>
insilmaril@37
   109
							<xsl:when test="$style = 'banner'">
insilmaril@37
   110
								<xsl:choose>
insilmaril@37
   111
									<xsl:when test="$thisOne = $againstID">
insilmaril@37
   112
										<td class="{$style}MenuSelected"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </td>
insilmaril@37
   113
									</xsl:when>
insilmaril@37
   114
									<xsl:otherwise>
insilmaril@37
   115
										<td class="{$style}Menu"><a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template></a> </td>
insilmaril@37
   116
									</xsl:otherwise>
insilmaril@37
   117
								</xsl:choose>
insilmaril@37
   118
							</xsl:when>
insilmaril@37
   119
							<xsl:otherwise>
insilmaril@37
   120
								<xsl:if test="position() != 1"> / </xsl:if>
insilmaril@37
   121
								<a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> </a>
insilmaril@37
   122
							</xsl:otherwise>
insilmaril@37
   123
						</xsl:choose>
insilmaril@37
   124
		 		</xsl:for-each>
insilmaril@37
   125
			</xsl:otherwise>
insilmaril@37
   126
		</xsl:choose>
insilmaril@37
   127
	</xsl:variable>
insilmaril@37
   128
	<xsl:if test="string($found)">
insilmaril@37
   129
		<xsl:choose>
insilmaril@37
   130
			<xsl:when test="string($box) and $style != 'news' and $style != 'right' and $style != 'left' and $style != 'full' and $style = 'tree' and $style = 'banner'">
insilmaril@37
   131
				<table class="{$box}">
insilmaril@37
   132
				<tr>
insilmaril@37
   133
					<xsl:if test="string($title)"><td class="{$box}Title"><xsl:value-of select="$title" /></td></xsl:if>
insilmaril@37
   134
					<td class="{$box}Content"><xsl:copy-of select="$found" /></td>
insilmaril@37
   135
				</tr>
insilmaril@37
   136
				</table>
insilmaril@37
   137
			</xsl:when>
insilmaril@37
   138
			<xsl:otherwise>
insilmaril@37
   139
				<xsl:copy-of select="$found" />
insilmaril@37
   140
			</xsl:otherwise>
insilmaril@37
   141
		</xsl:choose>
insilmaril@37
   142
	</xsl:if>
insilmaril@37
   143
</xsl:template>
insilmaril@37
   144
insilmaril@37
   145
<xsl:template name="getAllAssocTwo">
insilmaril@37
   146
	<xsl:param name="filter"/>
insilmaril@37
   147
	<xsl:param name="role"/>
insilmaril@37
   148
	<xsl:param name="type"/>
insilmaril@37
   149
	<xsl:param name="style" select="'default'" />
insilmaril@37
   150
	<xsl:param name="title"/>
insilmaril@37
   151
	<xsl:param name="box"/>
insilmaril@37
   152
	<xsl:param name="without"/>
insilmaril@37
   153
	<xsl:param name="currentID"/>
insilmaril@37
   154
	<xsl:param name="againstID"/>
insilmaril@37
   155
	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
insilmaril@37
   156
	<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
insilmaril@37
   157
	<xsl:variable name="w" select="substring-after($type, '#')" />
insilmaril@37
   158
	<xsl:variable name="all" select="$topics[starts-with(@id, concat($w, '-'))]" />
insilmaril@37
   159
	<xsl:variable name="found">
insilmaril@37
   160
		<xsl:for-each select="$all"> 
insilmaril@37
   161
			<xsl:variable name="this" select="@id" />
insilmaril@37
   162
			<xsl:variable name="c" select="count( $allThese[substring-after(@xlink:href, '#')=$this])" />
insilmaril@37
   163
			<xsl:if test="$c &gt; 0">
insilmaril@37
   164
				<xsl:variable name="single" select="$this[1]" />
insilmaril@37
   165
				<a href="{$pre-link}{$single}{$post-link}" class="foundLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$single" /></xsl:call-template></a>
insilmaril@37
   166
			</xsl:if>
insilmaril@37
   167
		</xsl:for-each>
insilmaril@37
   168
	</xsl:variable>
insilmaril@37
   169
	<xsl:if test="string($found)"><xsl:copy-of select="$found" /></xsl:if>
insilmaril@37
   170
</xsl:template>
insilmaril@37
   171
insilmaril@37
   172
<xsl:template name="drawNextLevel">	
insilmaril@37
   173
	<xsl:param name="currentID"/>
insilmaril@37
   174
	<xsl:param name="againstID"/>
insilmaril@37
   175
	<xsl:param name="currentType"/>
insilmaril@37
   176
	<xsl:param name="currentRole"/>
insilmaril@37
   177
	<xsl:param name="style"/>
insilmaril@37
   178
	<xsl:call-template name="getAllAssoc">
insilmaril@37
   179
		<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
   180
		<xsl:with-param name="againstID" select="$againstID" />
insilmaril@37
   181
		<xsl:with-param name="filter" select="'#group-subgroup'" />
insilmaril@37
   182
		<xsl:with-param name="role" select="$currentRole" />
insilmaril@37
   183
		<xsl:with-param name="box" select="'box'" />
insilmaril@37
   184
		<xsl:with-param name="style" select="$style" />
insilmaril@37
   185
	</xsl:call-template>
insilmaril@37
   186
</xsl:template>
insilmaril@37
   187
insilmaril@37
   188
<xsl:template name="drawRelated">
insilmaril@37
   189
	<xsl:param name="currentID"/>
insilmaril@37
   190
	<xsl:param name="currentType"/>
insilmaril@37
   191
	<xsl:param name="currentRole"/>
insilmaril@37
   192
	<xsl:param name="style" select="'box'" />
insilmaril@37
   193
	<xsl:call-template name="getAll">
insilmaril@37
   194
		<xsl:with-param name="ThisThat" select="'#this'" />
insilmaril@37
   195
		<xsl:with-param name="role" select="$currentRole" />
insilmaril@37
   196
		<xsl:with-param name="box" select="$style" />
insilmaril@37
   197
		<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
   198
	</xsl:call-template>
insilmaril@37
   199
	<xsl:call-template name="getAll">
insilmaril@37
   200
		<xsl:with-param name="ThisThat" select="'#that'" />
insilmaril@37
   201
		<xsl:with-param name="role" select="$currentRole" />
insilmaril@37
   202
		<xsl:with-param name="box" select="$style" />
insilmaril@37
   203
		<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
   204
	</xsl:call-template>
insilmaril@37
   205
</xsl:template> 	
insilmaril@37
   206
insilmaril@37
   207
<xsl:template name="getAll">
insilmaril@37
   208
	<xsl:param name="ThisThat"/>
insilmaril@37
   209
	<xsl:param name="filter"/>
insilmaril@37
   210
	<xsl:param name="title"/>
insilmaril@37
   211
	<xsl:param name="role"/>
insilmaril@37
   212
	<xsl:param name="box"/>
insilmaril@37
   213
	<xsl:param name="without"/>
insilmaril@37
   214
	<xsl:param name="currentID"/>
insilmaril@37
   215
	<xsl:variable name="allRelations" select="$topics[starts-with(@id, 'relation-')]" />
insilmaril@37
   216
	<xsl:variable name="allAssociations" select="$associations[member/topicRef/@xlink:href=concat('#',$currentID)]" />
insilmaril@37
   217
	<xsl:for-each select="$allRelations">
insilmaril@37
   218
		<xsl:variable name="relID" select="concat('#', @id)" />
insilmaril@37
   219
		<xsl:variable name="ThisThatRole"><xsl:choose><xsl:when test="$ThisThat = '#that'">#child</xsl:when><xsl:otherwise>#parent</xsl:otherwise></xsl:choose></xsl:variable>
insilmaril@37
   220
		<xsl:variable name="thisName"><xsl:value-of select="baseName[scope/topicRef/@xlink:href=$ThisThat]/baseNameString" /></xsl:variable>
insilmaril@37
   221
		<xsl:variable name="found">
insilmaril@37
   222
			<xsl:for-each select="$allAssociations">
insilmaril@37
   223
				<xsl:variable name="assocInstance" select="instanceOf/topicRef/@xlink:href" />
insilmaril@37
   224
				<xsl:variable name="assocHref" select="member[roleSpec/topicRef/@xlink:href=$ThisThatRole]/topicRef/@xlink:href" />
insilmaril@37
   225
				<xsl:variable name="thisID" select="substring-after($assocHref, '#')" />
insilmaril@37
   226
				<xsl:if test="$relID = $assocInstance and $thisID != $currentID">			
insilmaril@37
   227
					<span class="{$box}Element"><a href="{$pre-link}{$thisID}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisID" /></xsl:call-template></a></span>
insilmaril@37
   228
				</xsl:if>
insilmaril@37
   229
			</xsl:for-each>
insilmaril@37
   230
		</xsl:variable>
insilmaril@37
   231
		<xsl:if test="string($found) and string($thisName)">
insilmaril@37
   232
			<xsl:call-template name="drawRelationsBox">
insilmaril@37
   233
				<xsl:with-param name="style" select="$box" />
insilmaril@37
   234
				<xsl:with-param name="title" select="$thisName" />
insilmaril@37
   235
				<xsl:with-param name="content" select="$found" />
insilmaril@37
   236
			</xsl:call-template>
insilmaril@37
   237
		</xsl:if>
insilmaril@37
   238
	</xsl:for-each>	
insilmaril@37
   239
</xsl:template>
insilmaril@37
   240
insilmaril@37
   241
<xsl:template name="getAllBlogs">
insilmaril@37
   242
	<xsl:param name="currentID"/>
insilmaril@37
   243
	<xsl:param name="notraverse"/>
insilmaril@37
   244
	
insilmaril@37
   245
	<xsl:variable name="parentID">
insilmaril@37
   246
		<xsl:call-template name="getParent">
insilmaril@37
   247
			<xsl:with-param name="currentID" select="$currentID" />
insilmaril@37
   248
		</xsl:call-template>
insilmaril@37
   249
	</xsl:variable>
insilmaril@37
   250
	<xsl:choose>
insilmaril@37
   251
		<xsl:when test="string($notraverse)">
insilmaril@37
   252
			<xsl:variable name="theseOnes" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
insilmaril@37
   253
			<xsl:variable name="assoc" select="$associations[instanceOf/topicRef/@xlink:href='#group-subgroup'][member/topicRef/@xlink:href=concat('#',$currentID)]/member[roleSpec/topicRef/@xlink:href='#child']/topicRef" />
insilmaril@37
   254
			<div class="doc">
insilmaril@37
   255
				<xsl:for-each select="$theseOnes">
insilmaril@37
   256
					<xsl:variable name="ct" select="." />
insilmaril@37
   257
					<xsl:for-each select="$assoc">
insilmaril@37
   258
						<xsl:variable name="ca" select="." />
insilmaril@37
   259
						<xsl:variable name="t" select="substring-after($ca/@xlink:href, '#')" />
insilmaril@37
   260
						<xsl:if test="$t = $ct/@id">
insilmaril@37
   261
							<xsl:variable name="currentDate" select="$ct/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
insilmaril@37
   262
							<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
insilmaril@37
   263
							<xsl:call-template name="displayBlogItem">
insilmaril@37
   264
								<xsl:with-param name="item" select="$ct" />
insilmaril@37
   265
							</xsl:call-template>
insilmaril@37
   266
						</xsl:if>
insilmaril@37
   267
					</xsl:for-each>
insilmaril@37
   268
				</xsl:for-each>
insilmaril@37
   269
			</div>
insilmaril@37
   270
		</xsl:when>
insilmaril@37
   271
		<xsl:otherwise>
insilmaril@37
   272
			<xsl:variable name="items" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
insilmaril@37
   273
			<xsl:call-template name="traverseBlog">
insilmaril@37
   274
				<xsl:with-param name="items" select="$items[position() &lt; 6]" />
insilmaril@37
   275
				<xsl:with-param name="currentNo" select="'1'" />
insilmaril@37
   276
			</xsl:call-template>
insilmaril@37
   277
		</xsl:otherwise>
insilmaril@37
   278
	</xsl:choose>
insilmaril@37
   279
insilmaril@37
   280
</xsl:template>
insilmaril@37
   281
insilmaril@37
   282
<xsl:template name="traverseBlog">
insilmaril@37
   283
	<xsl:param name="items" />
insilmaril@37
   284
	<xsl:param name="currentNo" />
insilmaril@37
   285
	<xsl:param name="previousDate" />
insilmaril@37
   286
	
insilmaril@37
   287
	<xsl:variable name="item" select="$items[position() = $currentNo]" />
insilmaril@37
   288
insilmaril@37
   289
	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
insilmaril@37
   290
insilmaril@37
   291
	<xsl:if test="string($currentDate)">
insilmaril@37
   292
	
insilmaril@37
   293
		<xsl:if test="string($previousDate) = string($currentDate)">
insilmaril@37
   294
			<div class="blogEnd"> </div>
insilmaril@37
   295
		</xsl:if>
insilmaril@37
   296
		
insilmaril@37
   297
		<xsl:if test="$previousDate != $currentDate">
insilmaril@37
   298
			<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
insilmaril@37
   299
		</xsl:if>
insilmaril@37
   300
		
insilmaril@37
   301
		<xsl:call-template name="displayBlogItem">
insilmaril@37
   302
			<xsl:with-param name="item" select="$item" />
insilmaril@37
   303
		</xsl:call-template>
insilmaril@37
   304
		
insilmaril@37
   305
		<xsl:if test="string($items[position() = $currentNo+1])">
insilmaril@37
   306
			<xsl:call-template name="traverseBlog">
insilmaril@37
   307
				<xsl:with-param name="items" select="$items" />
insilmaril@37
   308
				<xsl:with-param name="currentNo" select="$currentNo + 1" />
insilmaril@37
   309
				<xsl:with-param name="previousDate" select="$currentDate" />
insilmaril@37
   310
			</xsl:call-template>
insilmaril@37
   311
		</xsl:if>
insilmaril@37
   312
	
insilmaril@37
   313
	</xsl:if>
insilmaril@37
   314
	
insilmaril@37
   315
</xsl:template>
insilmaril@37
   316
insilmaril@37
   317
<xsl:template name="displayBlogItem">
insilmaril@37
   318
	<xsl:param name="item" />
insilmaril@37
   319
	
insilmaril@37
   320
	<xsl:variable name="currentHeader" select="$item/baseName/baseNameString" />
insilmaril@37
   321
	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
insilmaril@37
   322
	<xsl:variable name="currentLink" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-link']/resourceData" />
insilmaril@37
   323
	<xsl:variable name="currentShort" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-short']/resourceData" />
insilmaril@37
   324
	
insilmaril@37
   325
	<div class="blogItem">
insilmaril@37
   326
		<xsl:if test="string($currentHeader)"><div class="blogHeader"><xsl:value-of select="$currentHeader" /></div></xsl:if>
insilmaril@37
   327
		
insilmaril@37
   328
		<xsl:variable name="fileName">../content/<xsl:value-of select="$item/@id" />.xml</xsl:variable>
insilmaril@37
   329
		<xsl:variable name="this" select="document($fileName)/div/*" />
insilmaril@37
   330
		<xsl:apply-templates select="$this"><xsl:with-param name="currentID" select="$item/@id" /></xsl:apply-templates>
insilmaril@37
   331
		
insilmaril@37
   332
		<xsl:if test="string($currentLink)"><div class="blogLinkBox">Read the full story at &lt; <a href="{$currentLink}"><xsl:value-of select="$currentHeader" /></a> &gt;</div></xsl:if>
insilmaril@37
   333
insilmaril@37
   334
		<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href='#group-subgroup'][member/topicRef/@xlink:href=concat('#',$item/@id)]/member[roleSpec/topicRef/@xlink:href='#parent']" />
insilmaril@37
   335
insilmaril@37
   336
		<span class="blogLinks"><a href="{$item/@id}.html" class="blogLink">Permalink</a>added <strong><xsl:value-of select="$currentDate" /></strong>.</span> 
insilmaril@37
   337
		
insilmaril@37
   338
		<xsl:if test="count($theseOnes) &gt; 0">
insilmaril@37
   339
			<span class="blogLinks">
insilmaril@37
   340
				Catalogued under:
insilmaril@37
   341
				<xsl:for-each select="$theseOnes">
insilmaril@37
   342
					<xsl:variable name="chug" select="substring-after(topicRef/@xlink:href, '#')" />
insilmaril@37
   343
					<a href="{$pre-link}{$chug}{$post-link}" class="blogLink"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$chug" /></xsl:call-template> </a>
insilmaril@37
   344
				</xsl:for-each>
insilmaril@37
   345
	 		</span>
insilmaril@37
   346
		</xsl:if>
insilmaril@37
   347
		
insilmaril@37
   348
	</div>
insilmaril@37
   349
	
insilmaril@37
   350
</xsl:template>
insilmaril@37
   351
insilmaril@37
   352
insilmaril@37
   353
</xsl:stylesheet>