1<xsl:transform version="1.0"
2xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3xmlns:od="urn:schemas-microsoft-com:officedata">
4
5 <xsl:template name="string-replace-all">
6    <xsl:param name="text" />
7    <xsl:param name="replace" />
8    <xsl:param name="by" />
9    <xsl:choose>
10      <xsl:when test="contains($text, $replace)">
11        <xsl:value-of select="substring-before($text,$replace)" />
12        <xsl:value-of select="$by" />
13        <xsl:value-of select="substring-after($text,$replace)" />
14<!--        <xsl:call-template name="string-replace-all">
15          <xsl:with-param name="text"
16          select="substring-after($text,$replace)" />
17          <xsl:with-param name="replace" select="$replace" />
18          <xsl:with-param name="by" select="$by" />
19        </xsl:call-template>-->
20      </xsl:when>
21      <xsl:otherwise>
22        <xsl:value-of select="$text" />
23      </xsl:otherwise>
24    </xsl:choose>
25  </xsl:template>
26
27  <!-- yay xslt 1.0 -->
28  <xsl:template name="unnorsk">
29    <xsl:param name="text" />
30    <xsl:variable name="aa">
31    <xsl:call-template name="string-replace-all">
32      <xsl:with-param name="text" select="$text" />
33      <xsl:with-param name="replace" select="'å'" />
34      <xsl:with-param name="by" select="'aa'" />
35    </xsl:call-template>
36    </xsl:variable>
37    <xsl:variable name="Aa">
38    <xsl:call-template name="string-replace-all">
39      <xsl:with-param name="text" select="$aa" />
40      <xsl:with-param name="replace" select="'Å'" />
41      <xsl:with-param name="by" select="'Aa'" />
42    </xsl:call-template>
43    </xsl:variable>
44    <xsl:variable name="ae">
45    <xsl:call-template name="string-replace-all">
46      <xsl:with-param name="text" select="$Aa" />
47      <xsl:with-param name="replace" select="'æ'" />
48      <xsl:with-param name="by" select="'ae'" />
49    </xsl:call-template>
50    </xsl:variable>
51    <xsl:variable name="Ae">
52    <xsl:call-template name="string-replace-all">
53      <xsl:with-param name="text" select="$ae" />
54      <xsl:with-param name="replace" select="'Æ'" />
55      <xsl:with-param name="by" select="'Ae'" />
56    </xsl:call-template>
57    </xsl:variable>
58    <xsl:variable name="oe">
59    <xsl:call-template name="string-replace-all">
60      <xsl:with-param name="text" select="$Ae" />
61      <xsl:with-param name="replace" select="'ø'" />
62      <xsl:with-param name="by" select="'oe'" />
63    </xsl:call-template>
64    </xsl:variable>
65    <xsl:variable name="Oe">
66    <xsl:call-template name="string-replace-all">
67      <xsl:with-param name="text" select="$oe" />
68      <xsl:with-param name="replace" select="'Ø'" />
69      <xsl:with-param name="by" select="'Oe'" />
70    </xsl:call-template>
71    </xsl:variable>
72    <xsl:value-of select="$Oe" />
73  </xsl:template>
74</xsl:transform>
75