Initial import. vendor
authorinsilmaril
Sun Jan 30 12:59:10 2005 +0000 (2005-01-30)
branchvendor
changeset 37df767ed748f3
parent 36 67e7883ab157
child 38 24c0b959c738
Initial import.
scripts/exportvym
styles/cm.xsl
styles/tm.xsl
styles/vym2html.xsl
styles/vym2txt.xsl
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/exportvym	Sun Jan 30 12:59:10 2005 +0000
     1.3 @@ -0,0 +1,70 @@
     1.4 +#!/usr/bin/perl
     1.5 +#
     1.6 +# Script to convert vym files to arbitrary formats
     1.7 +# Using xml stylesheets
     1.8 +#
     1.9 +# written by Uwe Drechsel	<vym@insilmaril.de>
    1.10 +#
    1.11 +
    1.12 +my $version="0.1";
    1.13 +my $PARSER="xsltproc";
    1.14 +my $OUTDIR="";
    1.15 +my $INPUTDIR="";
    1.16 +my $XSL="vym2html.xsl";
    1.17 +
    1.18 +
    1.19 +use Getopt::Long;
    1.20 +GetOptions (
    1.21 +    "o=s" => \$opt_outdir,
    1.22 +	"x=s"=> \$opt_xst,
    1.23 +    "h!" => \$opt_usage ) || usage ();
    1.24 +
    1.25 +
    1.26 +
    1.27 +if ($opt_usage) {
    1.28 +    $0 =~ s#.*/##g;
    1.29 +    print <<Helpende;
    1.30 +    
    1.31 +exportvym	written by Uwe Drechsel - Version $version
    1.32 +
    1.33 +usage: $0 [-h] VYMFILE
    1.34 +
    1.35 +...TODO...
    1.36 +
    1.37 +Helpende
    1.38 +}
    1.39 +
    1.40 +
    1.41 +if ($opt_xst) { $XST=$opt_XST; }
    1.42 +if ($opt_outdir) { $OUTDIR="$opt_outdir/"; }
    1.43 +if ($#ARGV <0) 
    1.44 +{
    1.45 +	die "not enough parameters given";
    1.46 +} else
    1.47 +{
    1.48 +	# get MAPNAME
    1.49 +	$MAPNAME=pop(@ARGV);
    1.50 +	if ($MAPNAME=~/\//) 
    1.51 +	{
    1.52 +		# Get inputdir from path
    1.53 +		$MAPNAME=~/(.*\/)(.*)/;
    1.54 +		$INPUTDIR=$1;	
    1.55 +		$MAPNAME=$2;	
    1.56 +	}
    1.57 +	if ($MAPNAME=~/(.*)(\.xml)/) { $MAPNAME=$1;}
    1.58 +}
    1.59 +
    1.60 +transform();
    1.61 +
    1.62 +exit;
    1.63 +
    1.64 +########################################################
    1.65 +sub transform {
    1.66 +########################################################
    1.67 +	my $command="$PARSER -o $OUTDIR$MAPNAME.html $XSL $INPUTDIR$MAPNAME.xml"; 
    1.68 +	print "$command\n";
    1.69 +	system ($command);
    1.70 +}
    1.71 +	
    1.72 +
    1.73 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/styles/cm.xsl	Sun Jan 30 12:59:10 2005 +0000
     2.3 @@ -0,0 +1,295 @@
     2.4 +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
     2.5 +<xsl:stylesheet 
     2.6 +	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     2.7 +	xmlns:exsl="http://exslt.org/common"
     2.8 +	extension-element-prefixes="exsl" version="1.0">
     2.9 +	
    2.10 +<xsl:variable name="controlCharacter" select="'¤'" />
    2.11 +<xsl:variable name="crlf" select="'&#10;'" />
    2.12 +<!-- <xsl:variable name="wikistyle" select="false()" /> -->
    2.13 +
    2.14 +<xsl:variable name="supportMenu" select="'true'" />
    2.15 +<xsl:variable name="supportShowme" select="'true'" />
    2.16 +<xsl:variable name="supportSource" select="'true'" />
    2.17 +<xsl:variable name="supportImage" select="'true'" />
    2.18 +
    2.19 +<xsl:template name="findNext">
    2.20 +	<xsl:param name="content" />
    2.21 +	<xsl:variable name="escaped" select="substring-after( $content, '\{' )" />
    2.22 +	<xsl:variable name="item-start" select="substring-after( $content, '{' )" />
    2.23 +	<xsl:variable name="item-end" select="substring-before( $item-start, '}' )" />
    2.24 +	<xsl:if test="normalize-space($escaped) != normalize-space($item-start)">
    2.25 +		<xsl:copy-of select="normalize-space($item-end)" />
    2.26 +	</xsl:if>
    2.27 +</xsl:template>
    2.28 +
    2.29 +<xsl:template name="findNextTag">
    2.30 +	<xsl:param name="content" />
    2.31 +	<xsl:variable name="item-start" select="substring-after( $content, '|' )" />
    2.32 +	<xsl:variable name="item-end" select="substring-before( $item-start, '|' )" />
    2.33 +	<xsl:variable name="name-start" select="substring-after( $item-start, '(' )" />
    2.34 +	<xsl:variable name="name-end" select="substring-before( $name-start, ')' )" />
    2.35 +	<!-- <xsl:copy-of select="normalize-space($item-end)" /> -->
    2.36 +	<xsl:variable name="w" select="substring-after( $item-end, ') ')" />
    2.37 +	<xsl:if test="string($w)">
    2.38 +		<xsl:element name="{$w}">
    2.39 +			<xsl:value-of select="$name-end" />
    2.40 +		</xsl:element>
    2.41 +	</xsl:if>
    2.42 +</xsl:template>
    2.43 +
    2.44 +<xsl:template name="lastCall">
    2.45 +	<xsl:param name="content" />
    2.46 +
    2.47 +	<xsl:variable name="inTheBeginning"   select="substring-before( $content, '|' )" />
    2.48 +	<xsl:variable name="markup-start"     select="substring-after( $content, '|' )" />
    2.49 +	<xsl:variable name="markup-end"       select="substring-before( $markup-start, '|' )" />
    2.50 +	<xsl:variable name="markup-after"     select="substring-after( $markup-start, concat( $markup-end, '|') )" />
    2.51 +	
    2.52 +	<xsl:variable name="cmd"              select="substring-before( $markup-end, ';' )" />
    2.53 +	
    2.54 +	<xsl:copy-of select="$inTheBeginning" />
    2.55 +	
    2.56 +	<xsl:choose>
    2.57 +		<xsl:when test="string($markup-end)">
    2.58 +			<xsl:choose>
    2.59 +				<xsl:when test="starts-with( $markup-end, '!' )">
    2.60 +					<span class="note"><xsl:copy-of select="substring-after( $markup-end, '!')" /></span>
    2.61 +				</xsl:when>
    2.62 +				<xsl:when test="starts-with( $markup-end, '/' )">
    2.63 +					<em><xsl:copy-of select="substring-after( $markup-end, '/')" /></em>
    2.64 +				</xsl:when>
    2.65 +				<xsl:when test="starts-with( $markup-end, '*' )">
    2.66 +					<pre><xsl:copy-of select="substring-after( $markup-end, '*')" /></pre>
    2.67 +				</xsl:when>
    2.68 +				<xsl:otherwise>
    2.69 +					<strong><xsl:copy-of select="$markup-end" /></strong>
    2.70 +				</xsl:otherwise>
    2.71 +			</xsl:choose>
    2.72 +			<xsl:call-template name="lastCall">
    2.73 +				<xsl:with-param name="content" select="$markup-after" />
    2.74 +			</xsl:call-template>
    2.75 +			<!-- [<xsl:copy-of select="$markup-after" />] -->
    2.76 +		</xsl:when>
    2.77 +		<xsl:otherwise>
    2.78 +			<xsl:copy-of select="$content" />
    2.79 +		</xsl:otherwise>
    2.80 +	</xsl:choose>
    2.81 +	
    2.82 +</xsl:template>
    2.83 +
    2.84 +<xsl:template name="replace-tags">
    2.85 +	<xsl:param name="content" />
    2.86 +	<xsl:param name="currentID" />
    2.87 +	<xsl:variable name="topic"><xsl:call-template name="findNext"><xsl:with-param name="content" select="$content" /></xsl:call-template></xsl:variable>
    2.88 +	<!-- <xsl:variable name="this" select="$thisDoc/item[@id=$topic]" /> -->
    2.89 +	<!-- <xsl:variable name="name" select="$this/@name" /> -->
    2.90 +	<xsl:variable name="name"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$topic" /></xsl:call-template></xsl:variable>
    2.91 +	
    2.92 +	<xsl:variable name="escaped-start"    select="substring-after( $content, '\{' )" />
    2.93 +	<xsl:variable name="item-start"       select="substring-before( $content, '{' )" />
    2.94 +
    2.95 +	<xsl:variable name="item-end"         select="substring-after( $content, '}' )" />
    2.96 +	<xsl:variable name="escaped-end"      select="substring-after( $content, '\}' )" />
    2.97 +
    2.98 +	<xsl:if test="string(normalize-space($item-start))">
    2.99 +		<xsl:if test="normalize-space($escaped-start) != normalize-space($item-start)">
   2.100 +			<xsl:call-template name="lastCall">
   2.101 +				<xsl:with-param name="content" select="$item-start" />
   2.102 +			</xsl:call-template>
   2.103 +		</xsl:if>
   2.104 +		<xsl:if test="normalize-space($escaped-start) = normalize-space($item-start)">
   2.105 +			<xsl:call-template name="lastCall">
   2.106 +				<xsl:with-param name="content" select="$escaped-start" />
   2.107 +			</xsl:call-template>
   2.108 +		</xsl:if>
   2.109 +	</xsl:if>
   2.110 +
   2.111 +	<xsl:variable name="middle">
   2.112 +		<xsl:if test="string(normalize-space($topic))">
   2.113 +		
   2.114 +			<!-- <xsl:value-of select="$topic" />(<xsl:value-of select="substring($topic, 1)" />) -->
   2.115 +			<xsl:choose>
   2.116 +				<xsl:when test="substring($topic, 1, 1) = '('">
   2.117 +				
   2.118 +					<xsl:variable name="tmp"><xsl:value-of select="substring-before( $topic, ')' )" /></xsl:variable>
   2.119 +					<xsl:variable name="thisName" select="substring-after( $topic, ') ' )" />
   2.120 +					<xsl:variable name="name2">
   2.121 +						<xsl:choose>
   2.122 +							<xsl:when test="substring($topic, 2, 1) = '%'"><img src="{substring( $tmp, 3 )}" class="image" border="0" alt="" /></xsl:when>
   2.123 +							<xsl:otherwise><xsl:value-of select="substring( $tmp, 2 )" /></xsl:otherwise>
   2.124 +						</xsl:choose>	
   2.125 +					</xsl:variable>
   2.126 +					<xsl:choose>
   2.127 +						<xsl:when test="starts-with($thisName, 'http')">
   2.128 +							<xsl:element name="a">
   2.129 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" /></xsl:attribute>
   2.130 +								<xsl:if test="substring($topic, 2, 1) != '%'">
   2.131 +									<xsl:attribute name="class">extLink</xsl:attribute>
   2.132 +								</xsl:if><xsl:copy-of select="$name2" />
   2.133 +							</xsl:element>
   2.134 +						</xsl:when>
   2.135 +						<xsl:when test="starts-with($thisName, 'mailto')">
   2.136 +							<xsl:element name="a">
   2.137 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" /></xsl:attribute>
   2.138 +								<xsl:if test="substring($topic, 2, 1) != '%'">
   2.139 +									<xsl:attribute name="class">extLink</xsl:attribute>
   2.140 +								</xsl:if><xsl:copy-of select="$name2" />
   2.141 +							</xsl:element>
   2.142 +						</xsl:when>
   2.143 +						<xsl:otherwise>
   2.144 +							<xsl:element name="a">
   2.145 +								<xsl:attribute name="href"><xsl:value-of select="$thisName" />.html</xsl:attribute>
   2.146 +								<xsl:if test="not(substring($topic, 2, 1) = '%')">
   2.147 +									<xsl:attribute name="class">topicLink</xsl:attribute>
   2.148 +								</xsl:if>
   2.149 +								<xsl:copy-of select="$name2" />
   2.150 +							</xsl:element>
   2.151 +						</xsl:otherwise>
   2.152 +					</xsl:choose>
   2.153 +	
   2.154 +				</xsl:when>
   2.155 +				<xsl:when test="substring($topic, 1, 1) = '!' and string($supportMenu)">
   2.156 +					<menu style="{substring-after($topic, '!')}"/>
   2.157 +				</xsl:when>
   2.158 +				<xsl:when test="substring($topic, 1, 1) = '#' and string($supportShowme)">
   2.159 +					<show-me what="{substring-after($topic, '#')}" id="{$currentID}" />
   2.160 +				</xsl:when>
   2.161 +				<xsl:when test="substring($topic, 1, 1) = '+' and string($supportSource)">
   2.162 +					<div class="viewSource"><a href="content/{$currentID}.orig" class="viewSource">view content source file</a></div>
   2.163 +				</xsl:when>
   2.164 +				<xsl:when test="substring($topic, 1, 1) = '%' and string($supportImage)">
   2.165 +					<image href="{substring-after($topic, '%')}" id="{$currentID}" />
   2.166 +				</xsl:when>
   2.167 +				<xsl:when test="starts-with($topic, 'http')">
   2.168 +					<xsl:element name="a">
   2.169 +						<xsl:attribute name="href"><xsl:value-of select="$topic" /></xsl:attribute>
   2.170 +						<xsl:attribute name="class">extLink</xsl:attribute><xsl:value-of select="$topic" />
   2.171 +					</xsl:element>
   2.172 +				</xsl:when>
   2.173 +				<xsl:otherwise>
   2.174 +					<xsl:element name="a">
   2.175 +						<xsl:attribute name="href"><xsl:value-of select="$topic" />.html</xsl:attribute>
   2.176 +						<xsl:attribute name="class">topicLink</xsl:attribute><xsl:value-of select="$name" />
   2.177 +					</xsl:element>
   2.178 +				</xsl:otherwise>
   2.179 +			</xsl:choose>
   2.180 +			
   2.181 +		</xsl:if>
   2.182 +	</xsl:variable>
   2.183 +
   2.184 +			<xsl:call-template name="lastCall">
   2.185 +				<xsl:with-param name="content" select="$middle" />
   2.186 +			</xsl:call-template>
   2.187 +<!-- 	<xsl:copy-of select="$middle" />
   2.188 + -->
   2.189 +	<xsl:variable name="more">
   2.190 +		<xsl:call-template name="findNext">
   2.191 +			<xsl:with-param name="content" select="$item-end" />
   2.192 +		</xsl:call-template>
   2.193 +	</xsl:variable>
   2.194 +	
   2.195 +	<xsl:choose>
   2.196 +		<xsl:when test="string(normalize-space($more))">
   2.197 +			<xsl:call-template name="replace-tags"><xsl:with-param name="content" select="$item-end" /><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
   2.198 +		</xsl:when>
   2.199 +		<xsl:otherwise>
   2.200 +			<xsl:if test="string(normalize-space($item-end))">
   2.201 +				<xsl:call-template name="lastCall">
   2.202 +					<xsl:with-param name="content" select="$item-end" />
   2.203 +				</xsl:call-template>
   2.204 +<!-- 				<xsl:copy-of select="$item-end" />
   2.205 + -->			</xsl:if>
   2.206 +		</xsl:otherwise>
   2.207 +	</xsl:choose>
   2.208 +
   2.209 +	<xsl:if test="not(string(normalize-space($item-start))) and not(string(normalize-space($item-end))) and not(string(normalize-space($topic)))">
   2.210 +			<xsl:call-template name="lastCall">
   2.211 +				<xsl:with-param name="content" select="$content" />
   2.212 +			</xsl:call-template>
   2.213 +<!-- 		<xsl:copy-of select="$content" /> -->
   2.214 +	</xsl:if>
   2.215 +
   2.216 +</xsl:template>
   2.217 +
   2.218 +<xsl:template name="markupLine">
   2.219 +	<xsl:param name="content" />
   2.220 +	<xsl:param name="currentID" />
   2.221 +	<xsl:variable name="first" select="substring($content, 1, 1)" />
   2.222 +	<xsl:variable name="c">
   2.223 +		<xsl:if test="$wikistyle">
   2.224 +		  <xsl:if test="string($first) = '?'">question</xsl:if>
   2.225 +		  <xsl:if test="string($first) = '='">answer</xsl:if>
   2.226 +		  <xsl:if test="string($first) = '!'">note</xsl:if>
   2.227 +		  <xsl:if test="string($first) = '*'">point</xsl:if>
   2.228 +		  <xsl:if test="string($first) = '.'">indent</xsl:if>
   2.229 +		  <xsl:if test="string($first) = '|'">code</xsl:if>
   2.230 +		  <xsl:if test="string($first) = ':'">blank</xsl:if>
   2.231 +		  <xsl:if test="string($first) = '-'">headerSmall</xsl:if>
   2.232 +		  <xsl:if test="string($first) = '+'">headerLarge</xsl:if>
   2.233 +		  <xsl:if test="string($first) = '#'">meta</xsl:if>
   2.234 +		</xsl:if>
   2.235 +		<xsl:if test="not($wikistyle)"></xsl:if>
   2.236 +	</xsl:variable>
   2.237 +
   2.238 +	<!-- <xsl:message>
   2.239 +		<xsl:text>c: </xsl:text><xsl:value-of select="$c"/>
   2.240 +		<xsl:text> wikistyle: </xsl:text><xsl:value-of select="$wikistyle"/>
   2.241 +	</xsl:message> -->
   2.242 +	
   2.243 +	<xsl:variable name="cont">
   2.244 +		<xsl:if test="string($c) and $wikistyle">
   2.245 +			<xsl:copy-of select="substring($content, 2)" /></xsl:if>
   2.246 +		<xsl:if test="not(string($c))">
   2.247 +			<xsl:copy-of select="$content" /></xsl:if>
   2.248 +	</xsl:variable>
   2.249 +	
   2.250 +	<xsl:variable name="class">
   2.251 +		<xsl:if test="string($c)">
   2.252 +			<xsl:copy-of select="$c" /></xsl:if>
   2.253 +		<xsl:if test="not(string($c))">normal</xsl:if>
   2.254 +	</xsl:variable>
   2.255 +	
   2.256 +	<xsl:choose>
   2.257 +		<xsl:when test="$c = 'meta'">
   2.258 +			<xsl:variable name="what" select="$cont" />
   2.259 +			<xsl:variable name="before" select="substring-before($what, '=')" />
   2.260 +			<xsl:variable name="after" select="substring-after($what, '=')" />
   2.261 +			<xsl:if test="string($before)">
   2.262 +				<xsl:text disable-output-escaping="yes"><![CDATA[<]]></xsl:text><xsl:copy-of select="normalize-space($before)" /><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
   2.263 +					<xsl:copy-of select="$after" />
   2.264 +				<xsl:text disable-output-escaping="yes"><![CDATA[</]]></xsl:text><xsl:copy-of select="normalize-space($before)" /><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
   2.265 +			</xsl:if>
   2.266 +		</xsl:when>
   2.267 +		<xsl:when test="$c = 'code'">
   2.268 +			<p class="{$class}"><xsl:copy-of select="$cont" /></p>
   2.269 +		</xsl:when>
   2.270 +		<xsl:when test="not($wikistyle)">
   2.271 +			<p class="{$class}"><xsl:copy-of select="$cont" /></p>
   2.272 +			<!-- <xsl:message terminate="yes" /> -->
   2.273 +		</xsl:when>
   2.274 +		<xsl:otherwise>
   2.275 +			<p class="{$class}"><xsl:call-template name="replace-tags"><xsl:with-param name="content" select="$cont" /><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template></p>
   2.276 +		</xsl:otherwise>
   2.277 +	</xsl:choose>
   2.278 +</xsl:template>
   2.279 +
   2.280 +<xsl:template name="doLine">
   2.281 +	<xsl:param name="content" />
   2.282 +	<xsl:param name="currentID" />
   2.283 +	<xsl:variable name="line" select="normalize-space(concat( substring-before( $content, $controlCharacter ), $controlCharacter))" />
   2.284 +	<xsl:variable name="lineClear" select="normalize-space(translate( $line,  $controlCharacter, ' ' ))" />
   2.285 +	<xsl:variable name="next" select="normalize-space(substring-after( $content, $line ))" />
   2.286 +<!-- 	[<xsl:value-of select="$content" />]<br/>
   2.287 +	[<xsl:value-of select="$line" />]<br/>
   2.288 +	[<xsl:value-of select="$lineClear" />]<br/>
   2.289 +	[<xsl:value-of select="$next" />]<br/> -->
   2.290 +	<xsl:if test="string(normalize-space($lineClear))">
   2.291 +		<xsl:call-template name="markupLine"><xsl:with-param name="content"><xsl:copy-of select="$lineClear" /></xsl:with-param><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
   2.292 +	</xsl:if>
   2.293 +	<xsl:if test="string(normalize-space($next))">
   2.294 +		<xsl:call-template name="doLine"><xsl:with-param name="content"><xsl:copy-of select="$next" /></xsl:with-param><xsl:with-param name="currentID" select="$currentID" /></xsl:call-template>
   2.295 +	</xsl:if>
   2.296 +</xsl:template>
   2.297 +
   2.298 +</xsl:stylesheet>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/styles/tm.xsl	Sun Jan 30 12:59:10 2005 +0000
     3.3 @@ -0,0 +1,353 @@
     3.4 +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
     3.5 +<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">
     3.6 +
     3.7 +<xsl:template name="getTopicName">
     3.8 +	<xsl:param name="id"/>
     3.9 +	<xsl:variable name="searching" select="$topics[@id=$id]" />
    3.10 +	<xsl:variable name="get"><xsl:value-of select="$searching/baseName/baseNameString" /><xsl:value-of select="$searching/@name" /></xsl:variable>
    3.11 +	<xsl:if test="string( $get )"><xsl:value-of select="$get" /></xsl:if>
    3.12 +	<xsl:if test="not(string( $get ))"><span class="notFound"><xsl:value-of select="$id" /> not found.</span></xsl:if>
    3.13 +</xsl:template>
    3.14 +	
    3.15 +<xsl:template name="getParent">
    3.16 +	<xsl:param name="currentID"/>
    3.17 +	<xsl:call-template name="getAllAssocID">
    3.18 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
    3.19 +		<xsl:with-param name="role" select="'#parent'" />
    3.20 +		<xsl:with-param name="currentID" select="$currentID" />
    3.21 +	</xsl:call-template>
    3.22 +</xsl:template>
    3.23 +
    3.24 +<xsl:template name="getChild">
    3.25 +	<xsl:param name="currentID"/>
    3.26 +	<xsl:call-template name="getAllAssocID">
    3.27 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
    3.28 +		<xsl:with-param name="role" select="'#child'" />
    3.29 +		<xsl:with-param name="currentID" select="$currentID" />
    3.30 +	</xsl:call-template>
    3.31 +</xsl:template>
    3.32 +
    3.33 +<xsl:template name="getAllAssocID">
    3.34 +	<xsl:param name="filter"/>
    3.35 +	<xsl:param name="role"/>
    3.36 +	<xsl:param name="currentID"/>
    3.37 +	
    3.38 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
    3.39 +	<xsl:variable name="fiddle" select="$theseOnes/member/topicRef[not(@xlink:href=concat('#',$currentID))][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
    3.40 +
    3.41 +	<xsl:value-of select="substring-after($fiddle[1]/@xlink:href, '#')" />
    3.42 +	
    3.43 +</xsl:template>
    3.44 +
    3.45 +<xsl:template name="getAllAssoc">
    3.46 +	<xsl:param name="filter"/>
    3.47 +	<xsl:param name="role"/>
    3.48 +	<xsl:param name="style" select="'default'" />
    3.49 +	<xsl:param name="title"/>
    3.50 +	<xsl:param name="box"/>
    3.51 +	<xsl:param name="without"/>
    3.52 +	<xsl:param name="currentID"/>
    3.53 +	<xsl:param name="againstID"/>
    3.54 +	
    3.55 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
    3.56 +
    3.57 + 	<xsl:variable name="found"><xsl:choose> 
    3.58 +			<xsl:when test="$style = 'sections'">
    3.59 +				<table border="0" cellspacing="0" cellpadding="0" class="sections"><tr>
    3.60 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
    3.61 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
    3.62 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
    3.63 +					<td valign="top" class="{$style}Menu">
    3.64 +						<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>
    3.65 +						<div class="{$style}MenuContent"><xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template></div>
    3.66 +					</td>
    3.67 +		 		</xsl:for-each>
    3.68 +				</tr></table>
    3.69 +			</xsl:when>
    3.70 +			<xsl:when test="$style = 'news'">
    3.71 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
    3.72 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
    3.73 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
    3.74 +					<div class="{$style}Menu">
    3.75 +						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
    3.76 +							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
    3.77 +							<xsl:call-template name="getClue"><xsl:with-param name="currentID" select="$thisOne" /><xsl:with-param name="style" select="'news'" /></xsl:call-template>
    3.78 +						</a>
    3.79 +					</div>
    3.80 +		 		</xsl:for-each>
    3.81 +			</xsl:when>
    3.82 +			<xsl:when test="$style = 'smallnews'">
    3.83 +				<xsl:for-each select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]"> 
    3.84 +					<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
    3.85 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
    3.86 +					<div class="{$style}Menu">
    3.87 +						<a href="{$pre-link}{$thisOne}{$post-link}" class="{$style}MenuLink">
    3.88 +							<xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> : 
    3.89 +							 <xsl:call-template name="getShort"><xsl:with-param name="currentID" select="$thisOne" /></xsl:call-template>
    3.90 +						</a>
    3.91 +					</div>
    3.92 +		 		</xsl:for-each>
    3.93 +			</xsl:when>
    3.94 +			<xsl:otherwise>
    3.95 +			
    3.96 +				<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
    3.97 +				<xsl:for-each select="$allThese"> 
    3.98 +				
    3.99 +				<xsl:variable name="thisOne" select="substring-after(@xlink:href, '#')" />
   3.100 +					<xsl:variable name="cat" select="concat('#',$currentID)" />
   3.101 +						<xsl:choose> 
   3.102 +							<xsl:when test="$style = 'right' or $style = 'left' or $style = 'full' or $style = 'tree'">
   3.103 +								<xsl:choose>
   3.104 +									<xsl:when test="$thisOne = $againstID">
   3.105 +										<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>
   3.106 +									</xsl:when>
   3.107 +									<xsl:otherwise>
   3.108 +										<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>
   3.109 +									</xsl:otherwise>
   3.110 +								</xsl:choose>
   3.111 +							</xsl:when>
   3.112 +							<xsl:when test="$style = 'banner'">
   3.113 +								<xsl:choose>
   3.114 +									<xsl:when test="$thisOne = $againstID">
   3.115 +										<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>
   3.116 +									</xsl:when>
   3.117 +									<xsl:otherwise>
   3.118 +										<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>
   3.119 +									</xsl:otherwise>
   3.120 +								</xsl:choose>
   3.121 +							</xsl:when>
   3.122 +							<xsl:otherwise>
   3.123 +								<xsl:if test="position() != 1"> / </xsl:if>
   3.124 +								<a href="{$pre-link}{$thisOne}{$post-link}"><xsl:call-template name="getTopicName"><xsl:with-param name="id" select="$thisOne" /></xsl:call-template> </a>
   3.125 +							</xsl:otherwise>
   3.126 +						</xsl:choose>
   3.127 +		 		</xsl:for-each>
   3.128 +			</xsl:otherwise>
   3.129 +		</xsl:choose>
   3.130 +	</xsl:variable>
   3.131 +	<xsl:if test="string($found)">
   3.132 +		<xsl:choose>
   3.133 +			<xsl:when test="string($box) and $style != 'news' and $style != 'right' and $style != 'left' and $style != 'full' and $style = 'tree' and $style = 'banner'">
   3.134 +				<table class="{$box}">
   3.135 +				<tr>
   3.136 +					<xsl:if test="string($title)"><td class="{$box}Title"><xsl:value-of select="$title" /></td></xsl:if>
   3.137 +					<td class="{$box}Content"><xsl:copy-of select="$found" /></td>
   3.138 +				</tr>
   3.139 +				</table>
   3.140 +			</xsl:when>
   3.141 +			<xsl:otherwise>
   3.142 +				<xsl:copy-of select="$found" />
   3.143 +			</xsl:otherwise>
   3.144 +		</xsl:choose>
   3.145 +	</xsl:if>
   3.146 +</xsl:template>
   3.147 +
   3.148 +<xsl:template name="getAllAssocTwo">
   3.149 +	<xsl:param name="filter"/>
   3.150 +	<xsl:param name="role"/>
   3.151 +	<xsl:param name="type"/>
   3.152 +	<xsl:param name="style" select="'default'" />
   3.153 +	<xsl:param name="title"/>
   3.154 +	<xsl:param name="box"/>
   3.155 +	<xsl:param name="without"/>
   3.156 +	<xsl:param name="currentID"/>
   3.157 +	<xsl:param name="againstID"/>
   3.158 +	<xsl:variable name="theseOnes" select="$associations[instanceOf/topicRef/@xlink:href=$filter][member/topicRef/@xlink:href=concat('#',$currentID)]" />
   3.159 +	<xsl:variable name="allThese" select="$theseOnes/member/topicRef[@xlink:href!=concat('#',$currentID)][parent::*/roleSpec/topicRef/@xlink:href=$role]" />
   3.160 +	<xsl:variable name="w" select="substring-after($type, '#')" />
   3.161 +	<xsl:variable name="all" select="$topics[starts-with(@id, concat($w, '-'))]" />
   3.162 +	<xsl:variable name="found">
   3.163 +		<xsl:for-each select="$all"> 
   3.164 +			<xsl:variable name="this" select="@id" />
   3.165 +			<xsl:variable name="c" select="count( $allThese[substring-after(@xlink:href, '#')=$this])" />
   3.166 +			<xsl:if test="$c &gt; 0">
   3.167 +				<xsl:variable name="single" select="$this[1]" />
   3.168 +				<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>
   3.169 +			</xsl:if>
   3.170 +		</xsl:for-each>
   3.171 +	</xsl:variable>
   3.172 +	<xsl:if test="string($found)"><xsl:copy-of select="$found" /></xsl:if>
   3.173 +</xsl:template>
   3.174 +
   3.175 +<xsl:template name="drawNextLevel">	
   3.176 +	<xsl:param name="currentID"/>
   3.177 +	<xsl:param name="againstID"/>
   3.178 +	<xsl:param name="currentType"/>
   3.179 +	<xsl:param name="currentRole"/>
   3.180 +	<xsl:param name="style"/>
   3.181 +	<xsl:call-template name="getAllAssoc">
   3.182 +		<xsl:with-param name="currentID" select="$currentID" />
   3.183 +		<xsl:with-param name="againstID" select="$againstID" />
   3.184 +		<xsl:with-param name="filter" select="'#group-subgroup'" />
   3.185 +		<xsl:with-param name="role" select="$currentRole" />
   3.186 +		<xsl:with-param name="box" select="'box'" />
   3.187 +		<xsl:with-param name="style" select="$style" />
   3.188 +	</xsl:call-template>
   3.189 +</xsl:template>
   3.190 +
   3.191 +<xsl:template name="drawRelated">
   3.192 +	<xsl:param name="currentID"/>
   3.193 +	<xsl:param name="currentType"/>
   3.194 +	<xsl:param name="currentRole"/>
   3.195 +	<xsl:param name="style" select="'box'" />
   3.196 +	<xsl:call-template name="getAll">
   3.197 +		<xsl:with-param name="ThisThat" select="'#this'" />
   3.198 +		<xsl:with-param name="role" select="$currentRole" />
   3.199 +		<xsl:with-param name="box" select="$style" />
   3.200 +		<xsl:with-param name="currentID" select="$currentID" />
   3.201 +	</xsl:call-template>
   3.202 +	<xsl:call-template name="getAll">
   3.203 +		<xsl:with-param name="ThisThat" select="'#that'" />
   3.204 +		<xsl:with-param name="role" select="$currentRole" />
   3.205 +		<xsl:with-param name="box" select="$style" />
   3.206 +		<xsl:with-param name="currentID" select="$currentID" />
   3.207 +	</xsl:call-template>
   3.208 +</xsl:template> 	
   3.209 +
   3.210 +<xsl:template name="getAll">
   3.211 +	<xsl:param name="ThisThat"/>
   3.212 +	<xsl:param name="filter"/>
   3.213 +	<xsl:param name="title"/>
   3.214 +	<xsl:param name="role"/>
   3.215 +	<xsl:param name="box"/>
   3.216 +	<xsl:param name="without"/>
   3.217 +	<xsl:param name="currentID"/>
   3.218 +	<xsl:variable name="allRelations" select="$topics[starts-with(@id, 'relation-')]" />
   3.219 +	<xsl:variable name="allAssociations" select="$associations[member/topicRef/@xlink:href=concat('#',$currentID)]" />
   3.220 +	<xsl:for-each select="$allRelations">
   3.221 +		<xsl:variable name="relID" select="concat('#', @id)" />
   3.222 +		<xsl:variable name="ThisThatRole"><xsl:choose><xsl:when test="$ThisThat = '#that'">#child</xsl:when><xsl:otherwise>#parent</xsl:otherwise></xsl:choose></xsl:variable>
   3.223 +		<xsl:variable name="thisName"><xsl:value-of select="baseName[scope/topicRef/@xlink:href=$ThisThat]/baseNameString" /></xsl:variable>
   3.224 +		<xsl:variable name="found">
   3.225 +			<xsl:for-each select="$allAssociations">
   3.226 +				<xsl:variable name="assocInstance" select="instanceOf/topicRef/@xlink:href" />
   3.227 +				<xsl:variable name="assocHref" select="member[roleSpec/topicRef/@xlink:href=$ThisThatRole]/topicRef/@xlink:href" />
   3.228 +				<xsl:variable name="thisID" select="substring-after($assocHref, '#')" />
   3.229 +				<xsl:if test="$relID = $assocInstance and $thisID != $currentID">			
   3.230 +					<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>
   3.231 +				</xsl:if>
   3.232 +			</xsl:for-each>
   3.233 +		</xsl:variable>
   3.234 +		<xsl:if test="string($found) and string($thisName)">
   3.235 +			<xsl:call-template name="drawRelationsBox">
   3.236 +				<xsl:with-param name="style" select="$box" />
   3.237 +				<xsl:with-param name="title" select="$thisName" />
   3.238 +				<xsl:with-param name="content" select="$found" />
   3.239 +			</xsl:call-template>
   3.240 +		</xsl:if>
   3.241 +	</xsl:for-each>	
   3.242 +</xsl:template>
   3.243 +
   3.244 +<xsl:template name="getAllBlogs">
   3.245 +	<xsl:param name="currentID"/>
   3.246 +	<xsl:param name="notraverse"/>
   3.247 +	
   3.248 +	<xsl:variable name="parentID">
   3.249 +		<xsl:call-template name="getParent">
   3.250 +			<xsl:with-param name="currentID" select="$currentID" />
   3.251 +		</xsl:call-template>
   3.252 +	</xsl:variable>
   3.253 +	<xsl:choose>
   3.254 +		<xsl:when test="string($notraverse)">
   3.255 +			<xsl:variable name="theseOnes" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
   3.256 +			<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" />
   3.257 +			<div class="doc">
   3.258 +				<xsl:for-each select="$theseOnes">
   3.259 +					<xsl:variable name="ct" select="." />
   3.260 +					<xsl:for-each select="$assoc">
   3.261 +						<xsl:variable name="ca" select="." />
   3.262 +						<xsl:variable name="t" select="substring-after($ca/@xlink:href, '#')" />
   3.263 +						<xsl:if test="$t = $ct/@id">
   3.264 +							<xsl:variable name="currentDate" select="$ct/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
   3.265 +							<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
   3.266 +							<xsl:call-template name="displayBlogItem">
   3.267 +								<xsl:with-param name="item" select="$ct" />
   3.268 +							</xsl:call-template>
   3.269 +						</xsl:if>
   3.270 +					</xsl:for-each>
   3.271 +				</xsl:for-each>
   3.272 +			</div>
   3.273 +		</xsl:when>
   3.274 +		<xsl:otherwise>
   3.275 +			<xsl:variable name="items" select="$topics[instanceOf/topicRef/@xlink:href='#blog']" />
   3.276 +			<xsl:call-template name="traverseBlog">
   3.277 +				<xsl:with-param name="items" select="$items[position() &lt; 6]" />
   3.278 +				<xsl:with-param name="currentNo" select="'1'" />
   3.279 +			</xsl:call-template>
   3.280 +		</xsl:otherwise>
   3.281 +	</xsl:choose>
   3.282 +
   3.283 +</xsl:template>
   3.284 +
   3.285 +<xsl:template name="traverseBlog">
   3.286 +	<xsl:param name="items" />
   3.287 +	<xsl:param name="currentNo" />
   3.288 +	<xsl:param name="previousDate" />
   3.289 +	
   3.290 +	<xsl:variable name="item" select="$items[position() = $currentNo]" />
   3.291 +
   3.292 +	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
   3.293 +
   3.294 +	<xsl:if test="string($currentDate)">
   3.295 +	
   3.296 +		<xsl:if test="string($previousDate) = string($currentDate)">
   3.297 +			<div class="blogEnd"> </div>
   3.298 +		</xsl:if>
   3.299 +		
   3.300 +		<xsl:if test="$previousDate != $currentDate">
   3.301 +			<div class="blogDate"><xsl:value-of select="$currentDate" /></div>
   3.302 +		</xsl:if>
   3.303 +		
   3.304 +		<xsl:call-template name="displayBlogItem">
   3.305 +			<xsl:with-param name="item" select="$item" />
   3.306 +		</xsl:call-template>
   3.307 +		
   3.308 +		<xsl:if test="string($items[position() = $currentNo+1])">
   3.309 +			<xsl:call-template name="traverseBlog">
   3.310 +				<xsl:with-param name="items" select="$items" />
   3.311 +				<xsl:with-param name="currentNo" select="$currentNo + 1" />
   3.312 +				<xsl:with-param name="previousDate" select="$currentDate" />
   3.313 +			</xsl:call-template>
   3.314 +		</xsl:if>
   3.315 +	
   3.316 +	</xsl:if>
   3.317 +	
   3.318 +</xsl:template>
   3.319 +
   3.320 +<xsl:template name="displayBlogItem">
   3.321 +	<xsl:param name="item" />
   3.322 +	
   3.323 +	<xsl:variable name="currentHeader" select="$item/baseName/baseNameString" />
   3.324 +	<xsl:variable name="currentDate" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-date']/resourceData" />
   3.325 +	<xsl:variable name="currentLink" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-link']/resourceData" />
   3.326 +	<xsl:variable name="currentShort" select="$item/occurrence[instanceOf/topicRef/@xlink:href='#blog-short']/resourceData" />
   3.327 +	
   3.328 +	<div class="blogItem">
   3.329 +		<xsl:if test="string($currentHeader)"><div class="blogHeader"><xsl:value-of select="$currentHeader" /></div></xsl:if>
   3.330 +		
   3.331 +		<xsl:variable name="fileName">../content/<xsl:value-of select="$item/@id" />.xml</xsl:variable>
   3.332 +		<xsl:variable name="this" select="document($fileName)/div/*" />
   3.333 +		<xsl:apply-templates select="$this"><xsl:with-param name="currentID" select="$item/@id" /></xsl:apply-templates>
   3.334 +		
   3.335 +		<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>
   3.336 +
   3.337 +		<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']" />
   3.338 +
   3.339 +		<span class="blogLinks"><a href="{$item/@id}.html" class="blogLink">Permalink</a>added <strong><xsl:value-of select="$currentDate" /></strong>.</span> 
   3.340 +		
   3.341 +		<xsl:if test="count($theseOnes) &gt; 0">
   3.342 +			<span class="blogLinks">
   3.343 +				Catalogued under:
   3.344 +				<xsl:for-each select="$theseOnes">
   3.345 +					<xsl:variable name="chug" select="substring-after(topicRef/@xlink:href, '#')" />
   3.346 +					<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>
   3.347 +				</xsl:for-each>
   3.348 +	 		</span>
   3.349 +		</xsl:if>
   3.350 +		
   3.351 +	</div>
   3.352 +	
   3.353 +</xsl:template>
   3.354 +
   3.355 +
   3.356 +</xsl:stylesheet>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/styles/vym2html.xsl	Sun Jan 30 12:59:10 2005 +0000
     4.3 @@ -0,0 +1,439 @@
     4.4 +<?xml version="1.0" encoding="UTF-8" ?>
     4.5 +
     4.6 +<!--
     4.7 +    Document   : vym2html.xsl
     4.8 +    Created on : 20040313
     4.9 +	Modified   : 20040512,20040622	Uwe Drechsel
    4.10 +	Version    : 0.7
    4.11 +    Author     : Clemens Kraus (http://www.clemens-kraus.de)
    4.12 +    Description: transforms vym-files into html format.
    4.13 +    
    4.14 +	Hint:
    4.15 +	tm.xsl and cm.xsl were taken from Alexander Johannesen's 
    4.16 +	beautiful xSiteable content management system: 
    4.17 +		http://xsiteable.org
    4.18 +	and are used with kind permission
    4.19 +-->
    4.20 +
    4.21 +	
    4.22 +
    4.23 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    4.24 +
    4.25 +	<!-- Include external stylesheets -->
    4.26 +	<xsl:include href="tm.xsl" />
    4.27 +	<xsl:include href="cm.xsl" />
    4.28 +  
    4.29 +	<!-- Settings and parameters -->
    4.30 +	<xsl:output method="html" indent="no" encoding="UTF-8"/> 
    4.31 +	<xsl:param name="filenamep" />
    4.32 +	<xsl:param name="wikistylep" />
    4.33 +	<xsl:param name="genimagep" />
    4.34 +	<xsl:param name="imageonlyp" />
    4.35 +	<xsl:param name="stylesheetp" />
    4.36 +	<xsl:param name="urlHeadingp" />
    4.37 +	<xsl:param name="urlImagep" />
    4.38 +	<xsl:variable name="filename" select="$filenamep"/>
    4.39 +	<xsl:variable name="wikistyle" select="$wikistylep"/>
    4.40 +	<xsl:variable name="genimage" select="$genimagep"/>
    4.41 +	<xsl:variable name="imageonly" select="$imageonlyp"/>	
    4.42 +	<xsl:variable name="stylesheet" select="$stylesheetp"/>
    4.43 +	<xsl:variable name="topics" select="//item" /> 
    4.44 +	<xsl:variable name="urlHeading" select="$urlHeadingp"/> 
    4.45 +	<xsl:variable name="urlImage" select="$urlImagep"/> 
    4.46 +
    4.47 +	<xsl:variable name="level" select="'0'"/>			
    4.48 +	<xsl:variable name="contentlist" select="false()"/> 
    4.49 +
    4.50 +  
    4.51 +	<xsl:variable name="fn" >
    4.52 +		<xsl:call-template name="getfn" >
    4.53 +			<xsl:with-param name="txt" select="$filename" />
    4.54 +		</xsl:call-template>
    4.55 +	</xsl:variable>
    4.56 +
    4.57 +	<xsl:variable name="path" >
    4.58 +	  <xsl:value-of select="normalize-space( substring($filename, 1, number(string-length($filename)-string-length($fn))) )" />
    4.59 +	</xsl:variable>
    4.60 +
    4.61 +	<xsl:variable name="stylesheetn" >
    4.62 +	<xsl:call-template name="getfn" >
    4.63 +		<xsl:with-param name="txt" select="$stylesheet" />
    4.64 +	</xsl:call-template>
    4.65 +	</xsl:variable><!-- path -->
    4.66 +
    4.67 +
    4.68 +
    4.69 +	<!-- Beginning of transformation here -->
    4.70 +	<xsl:template match="/">
    4.71 +	<xsl:variable name="mapversion" select="vymmap/@version"/>
    4.72 +	<xsl:variable name="header" >
    4.73 +		<xsl:call-template name="getheading" >
    4.74 +			<xsl:with-param name="txt" select="vymmap/mapcenter/heading" />
    4.75 +		</xsl:call-template>
    4.76 +	</xsl:variable><!-- header -->
    4.77 +		
    4.78 +	<!-- Write head of HTML document -->  
    4.79 +	<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]>&#xA;</xsl:text>
    4.80 +	<html><xsl:text>&#xA;</xsl:text>
    4.81 +		<head><xsl:text>&#xA;</xsl:text>
    4.82 +			<title><xsl:value-of select="$header"/></title>
    4.83 +			<xsl:text disable-output-escaping="yes">&#xA;<![CDATA[<link href="]]></xsl:text>
    4.84 +			<xsl:value-of select="$stylesheetn"/>
    4.85 +			<xsl:text disable-output-escaping="yes"><![CDATA[" rel="stylesheet" id="]]></xsl:text>
    4.86 +			<xsl:value-of select="$stylesheetn"/>
    4.87 +			<xsl:text disable-output-escaping="yes"><![CDATA[">]]>&#xA;</xsl:text>
    4.88 +			<meta name="generator" content="vym (http://www.insilmaril.de/vym/) and vym2html.xsl (http://www.clemens-kraus.de)"/><xsl:text>&#xA;</xsl:text>
    4.89 +		</head>
    4.90 +		<xsl:text>&#xA;</xsl:text>
    4.91 +
    4.92 +		<!-- Write body of HTML document -->  
    4.93 +		<body>
    4.94 +			<!-- vym title box at top of page -->
    4.95 +			<xsl:text>&#xA;</xsl:text>
    4.96 +			<div class="vymTitleBox">
    4.97 +				<xsl:value-of select="$header"/>
    4.98 +			</div>
    4.99 +
   4.100 +			<!-- Include image of map, if wanted -->
   4.101 +			<xsl:if test="$genimage != ''">
   4.102 +				<xsl:variable name="image" select="concat($fn, '.png')" />
   4.103 +
   4.104 +				<div class="vymImageMap">
   4.105 +					<img src="images/{$image}" 
   4.106 +						border="0" 
   4.107 +						usemap="#vymmap"
   4.108 +						alt="vymmap">
   4.109 +					</img>
   4.110 +				</div>
   4.111 +				<xsl:text>&#xA;</xsl:text>
   4.112 +
   4.113 +				<!-- Generate image map by a first walk through all branches -->
   4.114 +				<map name="vymmap">
   4.115 +					<xsl:apply-templates select="vymmap/mapcenter/branch">
   4.116 +						<xsl:with-param name="genarea" select="true()"/>
   4.117 +						<xsl:with-param name="imageonly" select="$imageonly"/>
   4.118 +					</xsl:apply-templates>
   4.119 +				</map>
   4.120 +
   4.121 +				<xsl:text>&#xA;</xsl:text>
   4.122 +			</xsl:if>
   4.123 +
   4.124 +			<!-- Include note of mapcenter here -->
   4.125 +			<xsl:apply-templates select="vymmap/mapcenter/note/@href"/>
   4.126 +
   4.127 +
   4.128 +			<!-- Include all the branches, if not only image is wanted-->
   4.129 +			<xsl:if test="$imageonly = ''">
   4.130 +				<xsl:apply-templates select="vymmap/mapcenter/branch">
   4.131 +					<xsl:with-param name="genarea" select="false()"/>
   4.132 +					<xsl:with-param name="imageonly" select="$imageonly"/>
   4.133 +					<xsl:with-param name="depth" select="0"/>
   4.134 +				</xsl:apply-templates>
   4.135 +			</xsl:if>
   4.136 +
   4.137 +			<!-- Box at bottom of page, containing comment and author -->
   4.138 +			<div class="vymBoxBottom">
   4.139 +				<xsl:value-of select="vymmap/@comment"/>
   4.140 +				<div class="vymBoxBottomR">
   4.141 +					<xsl:value-of select="vymmap/@author"/>
   4.142 +				</div>
   4.143 +			</div>
   4.144 +
   4.145 +			<!-- Footer containing filename, date, selfpromotion -->
   4.146 +			<table class="vymFooter">
   4.147 +				<tr>
   4.148 +					<td class="vymFooterL">
   4.149 +						<xsl:value-of select="$fn"/>.vym
   4.150 +					</td>
   4.151 +					<td class="vymFooterC">
   4.152 +						<xsl:value-of select="vymmap/@date"/>
   4.153 +					</td>
   4.154 +					<td class="vymFooterR">
   4.155 +						vym <xsl:value-of select="$mapversion"/> 
   4.156 +					</td>  
   4.157 +				</tr>
   4.158 +			</table>
   4.159 +
   4.160 +		</body>&#xA;
   4.161 +	</html>&#xA;
   4.162 +	</xsl:template><!-- Beginning of tranformation, "/" template -->
   4.163 +
   4.164 +	
   4.165 +	<!-- Main Function generating a branch  -->
   4.166 +	<xsl:template match="branch">
   4.167 +		<!-- Work a branch twice: a) make id for anchors, b) make output -->
   4.168 +		<xsl:param name="genarea"/>
   4.169 +		<xsl:param name="imageonly"/>
   4.170 +		<xsl:param name="depth"/>
   4.171 +		<xsl:if test="$genarea">
   4.172 +			<!-- Generate id's and anchors, no output yet -->
   4.173 +			<xsl:if test="(@x1 != '' and @y1 != '' and @x2 != '' and @y2 != '') and not(../@scrolled = 'yes')">
   4.174 +				<!-- Heading is used in ALT field of anchor -->
   4.175 +				<xsl:variable name="header">
   4.176 +					<xsl:call-template name="getheading" >
   4.177 +						<xsl:with-param name="txt" select="heading" />
   4.178 +					</xsl:call-template>
   4.179 +				</xsl:variable>
   4.180 +
   4.181 +				<xsl:if test="($imageonly and @url) or ($imageonly and @vymLink) or $imageonly=''">
   4.182 +					<area>
   4.183 +					<xsl:attribute name="shape">
   4.184 +						<xsl:text>rect</xsl:text>
   4.185 +					</xsl:attribute>
   4.186 +					<xsl:attribute name="coords">
   4.187 +						<xsl:value-of select="@x1"/>
   4.188 +						<xsl:text>,</xsl:text>
   4.189 +						<xsl:value-of select="@y1"/>
   4.190 +						<xsl:text>,</xsl:text>
   4.191 +						<xsl:value-of select="@x2"/>
   4.192 +						<xsl:text>,</xsl:text>
   4.193 +						<xsl:value-of select="@y2"/>
   4.194 +					</xsl:attribute>
   4.195 +					<xsl:attribute name="href">
   4.196 +						<xsl:if test="$imageonly = ''">
   4.197 +							<xsl:text>#</xsl:text>
   4.198 +							<xsl:value-of select="generate-id(.)"/>
   4.199 +						</xsl:if>
   4.200 +						<xsl:if test="$imageonly and @url">
   4.201 +							<xsl:value-of select="@url"/>
   4.202 +						</xsl:if>
   4.203 +						<xsl:if test="$imageonly and @vymLink">
   4.204 +							<xsl:value-of select="concat( substring-before(@vymLink, '.vym'), '.html')"/>
   4.205 +						</xsl:if>
   4.206 +					</xsl:attribute>
   4.207 +					<xsl:attribute name="alt">
   4.208 +						<xsl:value-of select="$header"/>
   4.209 +					</xsl:attribute>
   4.210 +					<xsl:attribute name="title">
   4.211 +						<xsl:value-of select="$header"/>
   4.212 +					</xsl:attribute>
   4.213 +					</area>
   4.214 +					<xsl:text>&#xA;</xsl:text>
   4.215 +				</xsl:if>
   4.216 +			</xsl:if> <!--generating id's and anchors -->
   4.217 +
   4.218 +			<xsl:apply-templates select="branch">
   4.219 +				<xsl:with-param name="genarea" select="true()"/>
   4.220 +				<xsl:with-param name="imageonly" select="$imageonly"/>
   4.221 +				<xsl:with-param name="depth" select="$depth +1"/>
   4.222 +			</xsl:apply-templates>
   4.223 +		</xsl:if><!--genarea-->
   4.224 +
   4.225 +		
   4.226 +		<xsl:if test="$imageonly = ''">
   4.227 +			<xsl:if test="not($genarea)">
   4.228 +				<xsl:call-template name="anchor">
   4.229 +					<xsl:with-param name="depth" select="$depth"/>
   4.230 +				</xsl:call-template>
   4.231 +				<xsl:text>&#xA;</xsl:text>
   4.232 +			</xsl:if>
   4.233 +		</xsl:if>
   4.234 +	</xsl:template><!--branch-->
   4.235 +
   4.236 +
   4.237 +
   4.238 +	<xsl:template name="anchor">
   4.239 +		<xsl:param name="depth"/>
   4.240 +		<xsl:if test="$depth=0"> 
   4.241 +			<hr />
   4.242 +			<xsl:call-template name="gen-anchor-tag">
   4.243 +				<xsl:with-param name="depth" select="$depth"/>
   4.244 +			</xsl:call-template>
   4.245 +				<xsl:if test="count(descendant::branch)">
   4.246 +					<ul>
   4.247 +					<xsl:apply-templates select="branch">
   4.248 +						<xsl:with-param name="genarea" select="false()"/>
   4.249 +						<xsl:with-param name="depth" select="$depth+1"/>
   4.250 +					</xsl:apply-templates>
   4.251 +					</ul>
   4.252 +				</xsl:if>	
   4.253 +		</xsl:if>
   4.254 +
   4.255 +	<xsl:if test="$depth > 0">
   4.256 +			<li>
   4.257 +				<xsl:call-template name="gen-anchor-tag">
   4.258 +					<xsl:with-param name="depth" select="$depth"/>
   4.259 +				</xsl:call-template>
   4.260 +				<xsl:if test="count(descendant::branch)">
   4.261 +					<ul>
   4.262 +					<xsl:apply-templates select="branch">
   4.263 +						<xsl:with-param name="genarea" select="false()"/>
   4.264 +						<xsl:with-param name="depth" select="$depth+1"/>
   4.265 +					</xsl:apply-templates>
   4.266 +					</ul>
   4.267 +				</xsl:if>	
   4.268 +			</li>
   4.269 +		</xsl:if>
   4.270 +	</xsl:template><!--anchor-->
   4.271 +
   4.272 +
   4.273 +	<xsl:template name="gen-anchor-tag">
   4.274 +		<xsl:param name="depth"/>
   4.275 +
   4.276 +		<xsl:variable name="header">
   4.277 +			<xsl:call-template name="getheading" >
   4.278 +			<xsl:with-param name="txt" select="heading" />
   4.279 +			</xsl:call-template>
   4.280 +		</xsl:variable><!--header-->
   4.281 +
   4.282 +		<div class="vymBranch{$depth}">
   4.283 +			<xsl:if test="not($genimage = '')">
   4.284 +				<a name="{generate-id(.)}"></a>
   4.285 +			</xsl:if>
   4.286 +
   4.287 +			<!-- start header -->
   4.288 +			<xsl:value-of select="$header"/>
   4.289 +
   4.290 +			<!-- Include flags -->
   4.291 +			<xsl:apply-templates select="./standardFlag" />
   4.292 +
   4.293 +			<!-- URL to external document  -->
   4.294 +			<xsl:if test="@url != ''">
   4.295 +				<p class="vymURL">
   4.296 +				<xsl:element name="a">
   4.297 +					<xsl:attribute name="href">
   4.298 +						<xsl:value-of select="@url"/>
   4.299 +					</xsl:attribute>
   4.300 +					<xsl:if test="$urlImage= 'yes'">
   4.301 +						<img src="flags/url.png" 
   4.302 +							border="0" 
   4.303 +							valign="middle"
   4.304 +							alt="URL">
   4.305 +						</img>
   4.306 +					</xsl:if>
   4.307 +					<xsl:if test="$urlImage!= 'yes'">
   4.308 +						<xsl:text>&gt; </xsl:text>
   4.309 +					</xsl:if>
   4.310 +					<xsl:if test="$urlHeading = 'yes'">
   4.311 +						<xsl:value-of select="$header"/>
   4.312 +					</xsl:if>
   4.313 +					<xsl:if test="$urlHeading != 'yes'">
   4.314 +						<xsl:value-of select="@url"/>
   4.315 +					</xsl:if>
   4.316 +				</xsl:element>
   4.317 +				</p>
   4.318 +			</xsl:if><!-- URL to ext. doc -->
   4.319 +			<xsl:text>&#xA;</xsl:text>
   4.320 +		</div>
   4.321 +
   4.322 +		<xsl:apply-templates select="note/@href"/>
   4.323 +
   4.324 +		<xsl:text>&#xA;</xsl:text>
   4.325 +	</xsl:template><!--gen-anchor-tag-->
   4.326 +
   4.327 +
   4.328 +	<xsl:template match="standardFlag">
   4.329 +		<xsl:variable name="flag" select="concat(., '.png')" />
   4.330 +		<img src="flags/{$flag}" valign="middle" border="0" alt="{$flag}">
   4.331 +		</img>
   4.332 +
   4.333 +	</xsl:template><!--standardFlag-->
   4.334 +
   4.335 +
   4.336 +	<xsl:template match="note/@href">
   4.337 +		<div class="vymNote">
   4.338 +		<xsl:variable name="actualnotename">
   4.339 +			<xsl:value-of select="substring-after(current(),':')"/>
   4.340 +		</xsl:variable>
   4.341 +
   4.342 +		<xsl:variable name="note-name">
   4.343 +			<xsl:if test="$path = ''">
   4.344 +				<xsl:value-of select="$actualnotename"/>
   4.345 +			</xsl:if>
   4.346 +			<xsl:if test="not($path = '')">
   4.347 +				<xsl:value-of select="concat($path, '/', $actualnotename)"/>
   4.348 +			</xsl:if>
   4.349 +		</xsl:variable><!--note-name-->
   4.350 +
   4.351 +
   4.352 +		<xsl:if test="../@fonthint = 'fixed'">
   4.353 +			<xsl:text disable-output-escaping="yes">&lt;pre></xsl:text>
   4.354 +		</xsl:if>
   4.355 +
   4.356 +		<xsl:variable name="currentID" select="@id" />
   4.357 +
   4.358 +		<xsl:apply-templates select="document($note-name)/note">
   4.359 +			<xsl:with-param name="currentID" select="$currentID" />
   4.360 +		</xsl:apply-templates>
   4.361 +
   4.362 +		<xsl:if test="../@fonthint = 'fixed'">
   4.363 +			<xsl:text disable-output-escaping="yes">&lt;/pre></xsl:text>
   4.364 +		</xsl:if>
   4.365 +
   4.366 +		</div>
   4.367 +	</xsl:template><!--note/@href-->
   4.368 +
   4.369 +
   4.370 +  
   4.371 +<!--	Wiki-style notation overview:
   4.372 +  		Lines:
   4.373 +		+ Big headlines start with the '+' character.
   4.374 +		- Small headlines start with the '-' character.
   4.375 +		Normal text doesn't have any starting notation.
   4.376 +		! Notes start with an exclamation.
   4.377 +		. Indented text starts with a dot.
   4.378 +		? Questions start with a question-mark, and
   4.379 +		= Answers starts with the equal-sign.
   4.380 +		* Points for a item-list
   4.381 +		# clues
   4.382 +		
   4.383 +		Links:
   4.384 +		use "{...}" or {(Clemens homepage) http://www.clemens-kraus.de/} for external links.
   4.385 +		
   4.386 +		Markup:
   4.387 +		|This is bold| text, while |/this text is italic|, |*this is pre-formatted|, and |!this is a note|
   4.388 +	-->
   4.389 +  
   4.390 +	<xsl:template match="note">
   4.391 +		<xsl:param name="currentID"/>
   4.392 +
   4.393 +
   4.394 +		<xsl:call-template name="doLine">
   4.395 +			<xsl:with-param name="content" select="concat(translate(.,$crlf,$controlCharacter), $controlCharacter)"/>
   4.396 +			<xsl:with-param name="currentID" select="$currentID"/>
   4.397 +		</xsl:call-template>
   4.398 +	</xsl:template><!--note-->
   4.399 +
   4.400 +	  
   4.401 +  
   4.402 +  
   4.403 +  
   4.404 +	<xsl:template name="getfn">
   4.405 +		<xsl:param name="txt" select="." />
   4.406 +
   4.407 +		<xsl:choose>
   4.408 +			<xsl:when test="contains($txt, '/')" >
   4.409 +				<xsl:variable name="right" select="substring-after($txt, '/')" />
   4.410 +				<xsl:if test="string-length($right)>1" >
   4.411 +					<xsl:call-template name="getfn" >
   4.412 +						<xsl:with-param name="txt" select="$right" />
   4.413 +					</xsl:call-template>
   4.414 +				</xsl:if>
   4.415 +			</xsl:when>
   4.416 +			<xsl:otherwise>
   4.417 +				<xsl:value-of select="$txt" />
   4.418 +			</xsl:otherwise>
   4.419 +		</xsl:choose>
   4.420 +	</xsl:template><!--getfn-->
   4.421 +
   4.422 +  
   4.423 +	<!-- Take care of br's  (WHY?)  --> 
   4.424 +	<xsl:template name="getheading">
   4.425 +		<xsl:param name="txt" select="." />
   4.426 +		<xsl:variable name="br">
   4.427 +			<xsl:text disable-output-escaping="yes">&lt;br&gt;</xsl:text>
   4.428 +		</xsl:variable>
   4.429 +		<xsl:choose>
   4.430 +			<xsl:when test="contains($txt, $br)" >
   4.431 +				<xsl:variable name="right" select="substring-after($txt, $br)" />
   4.432 +				<xsl:variable name="left" select="substring-before($txt, $br)" />
   4.433 +				<xsl:value-of select="concat( $left, ' ', $right )" />
   4.434 +			</xsl:when>
   4.435 +			<xsl:otherwise>
   4.436 +				<xsl:value-of select="$txt" />
   4.437 +			</xsl:otherwise>
   4.438 +		</xsl:choose>
   4.439 +	</xsl:template><!--getheading-->
   4.440 +  
   4.441 +</xsl:stylesheet>
   4.442 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/styles/vym2txt.xsl	Sun Jan 30 12:59:10 2005 +0000
     5.3 @@ -0,0 +1,138 @@
     5.4 +<?xml version="1.0" encoding="UTF-8" ?>
     5.5 +
     5.6 +<!--
     5.7 +    Document   : vym2txt.xsl
     5.8 +    Created on : 20040317
     5.9 +	Modified   : 20040417
    5.10 +	Version    : 0.1
    5.11 +    Author     : Clemens Kraus (http://www.clemens-kraus.de)
    5.12 +    Description: transforms vym-files into text-format.
    5.13 +    
    5.14 +-->
    5.15 +
    5.16 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    5.17 +
    5.18 +  <xsl:output method="text" indent="no" encoding="UTF-8"/> 
    5.19 +  <xsl:param name="filenamep" />
    5.20 +  <xsl:variable name="filename" select="$filenamep"/>
    5.21 +  
    5.22 +  <xsl:variable name="fn" >
    5.23 +	<xsl:call-template name="getfn" >
    5.24 +		<xsl:with-param name="txt" select="$filename" />
    5.25 +	</xsl:call-template>
    5.26 +  </xsl:variable>
    5.27 +
    5.28 +  <xsl:variable name="path" >
    5.29 +	  <xsl:value-of select="normalize-space( substring($filename, 1, number(string-length($filename)-string-length($fn))) )" />
    5.30 +  </xsl:variable>
    5.31 +
    5.32 +
    5.33 +  <xsl:template match="/">
    5.34 +  
    5.35 +    <xsl:text>#VYM-Export VYM-Version:</xsl:text><xsl:value-of select="vymmap/@version"/>
    5.36 +    <xsl:text>&#xA;&#xA;</xsl:text>
    5.37 +	  
    5.38 +	
    5.39 +    <xsl:value-of select="vymmap/mapcenter/heading"/>
    5.40 +	<xsl:text>&#xA;&#xA;</xsl:text>
    5.41 +		
    5.42 +	
    5.43 +	<xsl:apply-templates select="vymmap/mapcenter/branch" >
    5.44 +		<xsl:with-param name="indent" select="''" />
    5.45 +	</xsl:apply-templates>
    5.46 +
    5.47 +  </xsl:template>
    5.48 +
    5.49 +	
    5.50 +  
    5.51 +  
    5.52 +  <xsl:template match="branch">
    5.53 +    <xsl:param name="width" select="70" />
    5.54 +	
    5.55 +	
    5.56 +	<xsl:call-template name="gen-anchor-tag" >
    5.57 +		<xsl:with-param name="indent" select="$indent" />
    5.58 +	</xsl:call-template>
    5.59 +	  
    5.60 +	
    5.61 +	<xsl:apply-templates select="branch" >
    5.62 +		<xsl:with-param name="indent" select="concat($indent, ' ')" />
    5.63 +	</xsl:apply-templates>
    5.64 +
    5.65 +  </xsl:template>
    5.66 +
    5.67 +
    5.68 +  
    5.69 +  
    5.70 +  <xsl:template name="gen-anchor-tag">
    5.71 +    <xsl:param name="indent"/>
    5.72 +
    5.73 +	<xsl:value-of select="$indent"/><xsl:text>- </xsl:text><xsl:value-of select="heading"/>
    5.74 +
    5.75 +	
    5.76 +    <xsl:if test="@url != ''"> (<xsl:value-of select="@url"/>)</xsl:if>
    5.77 +	
    5.78 +	
    5.79 +	<xsl:apply-templates select="note/@href" >
    5.80 +		<xsl:with-param name="indent" select="$indent" />
    5.81 +	</xsl:apply-templates>
    5.82 +
    5.83 +    <xsl:text>&#xA;</xsl:text>
    5.84 +  </xsl:template>
    5.85 +
    5.86 +
    5.87 +  
    5.88 +  
    5.89 +  
    5.90 +  <xsl:template match="note/@href">
    5.91 +    <xsl:param name="indent"/>
    5.92 +    
    5.93 +    <xsl:variable name="actualnotename">
    5.94 +      <xsl:value-of select="substring-after(current(),':')"/>
    5.95 +    </xsl:variable>
    5.96 +
    5.97 +    <xsl:variable name="note-name">
    5.98 +	    <xsl:if test="$path = ''">
    5.99 +			<xsl:value-of select="$actualnotename"/>
   5.100 +		</xsl:if>
   5.101 +	    <xsl:if test="not($path = '')">
   5.102 +			<xsl:value-of select="concat($path, '/', $actualnotename)"/>
   5.103 +		</xsl:if>
   5.104 +	</xsl:variable>
   5.105 +	
   5.106 +	
   5.107 +	<xsl:variable name="currentID" select="@id" />
   5.108 +	
   5.109 +    <xsl:text>&#xA;</xsl:text>
   5.110 +  
   5.111 +	<xsl:for-each select="document($note-name)/note/line">
   5.112 +		<xsl:value-of select="$indent"/><xsl:text>  </xsl:text><xsl:value-of select="."/>
   5.113 +	</xsl:for-each>
   5.114 +		
   5.115 +  </xsl:template>
   5.116 +
   5.117 +  
   5.118 +  
   5.119 +  
   5.120 +  
   5.121 +  <xsl:template name="getfn">
   5.122 +	  <xsl:param name="txt" select="." />
   5.123 +	  
   5.124 +	  <xsl:choose>
   5.125 +		  <xsl:when test="contains($txt, '/')" >
   5.126 +		  	<xsl:variable name="right" select="substring-after($txt, '/')" />
   5.127 +			<xsl:if test="string-length($right)>1" >
   5.128 +			  <xsl:call-template name="getfn" >
   5.129 +				  <xsl:with-param name="txt" select="$right" />
   5.130 +			  </xsl:call-template>
   5.131 +			</xsl:if>
   5.132 +		  </xsl:when>
   5.133 +		  <xsl:otherwise>
   5.134 +			  <xsl:value-of select="$txt" />
   5.135 +		  </xsl:otherwise>
   5.136 +	  </xsl:choose>
   5.137 +	  
   5.138 +  </xsl:template>
   5.139 +  
   5.140 +</xsl:stylesheet>
   5.141 +