aboutsummaryrefslogtreecommitdiff
path: root/t/test-site/src/common/du2html.xsl
diff options
context:
space:
mode:
Diffstat (limited to 't/test-site/src/common/du2html.xsl')
-rw-r--r--t/test-site/src/common/du2html.xsl25
1 files changed, 22 insertions, 3 deletions
diff --git a/t/test-site/src/common/du2html.xsl b/t/test-site/src/common/du2html.xsl
index 8b73a82..cc4372b 100644
--- a/t/test-site/src/common/du2html.xsl
+++ b/t/test-site/src/common/du2html.xsl
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:e="http://exslt.org/common"
xmlns:wc="http://webcoso.thenautilus.net/"
+ exclude-result-prefixes="wc e"
version="1.0"
>
@@ -11,6 +13,23 @@
<x:param name="path"/>
<x:param name="filename"/>
+ <x:variable name="langs-rtf">
+ <x:choose>
+ <x:when test="$language = 'it'">
+ <lang>it</lang>
+ <lang>en</lang>
+ </x:when>
+ <x:when test="$language = 'en'">
+ <lang>en</lang>
+ <lang>it</lang>
+ </x:when>
+ <x:otherwise> <!-- uh? -->
+ <lang><x:value-of select="$language"/></lang>
+ </x:otherwise>
+ </x:choose>
+ </x:variable>
+ <x:variable name="langs" select="e:node-set($langs-rtf)/node()"/>
+
<x:output method="html" encoding="utf-8"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
indent="yes"/>
@@ -39,7 +58,7 @@
<x:choose>
<x:when test="@refuri and string(.)=string(@refuri)">
- <x:apply-templates select="wc:title-for($language,ancestor::document/@source,@refuri)"/>
+ <x:apply-templates select="wc:title-for($langs,ancestor::document/@source,@refuri)"/>
</x:when>
<x:otherwise>
<x:apply-templates />
@@ -83,7 +102,7 @@
</x:template>
<x:template match="wc:tag">
- <dt><x:apply-templates select="wc:title-for($language,$filename,concat('/tags/',@name,'/'))"/></dt>
+ <dt><x:apply-templates select="wc:title-for($langs,$filename,concat('/tags/',@name,'/'))"/></dt>
<dd>
<ul>
<x:apply-templates/>
@@ -93,7 +112,7 @@
<x:template match="wc:doc">
<li>
- <a href="{@uri}"><x:apply-templates select="wc:title-for($language,$filename,@uri)"/></a>
+ <a href="{@uri}"><x:apply-templates select="wc:title-for($langs,$filename,@uri)"/></a>
(<x:apply-templates/>)
</li>
</x:template>