1 <?xml version="1.0" encoding="UTF-8"?>
3 <!-- Note the declaration of the namespace for XInclude. -->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
5 xmlns:xi="http://www.w3.org/2001/XInclude">
8 <xsl:variable name="newline">
9 <xsl:text> </xsl:text>
12 <xsl:variable name="carriageReturn">
13 <xsl:text> </xsl:text>
16 <!-- =====================================================
17 Replace one string by another
18 - src: string to do substituion in
19 - from: literal string to replace
20 - to:substitution string.
21 ======================================================-->
22 <xsl:template name="string-replace">
23 <xsl:param name="src"/>
24 <xsl:param name="from"/>
25 <xsl:param name="to"/>
27 <xsl:when test="contains($src, $from)">
28 <xsl:value-of select="substring-before($src, $from)"/>
29 <xsl:value-of select="$to"/>
30 <xsl:call-template name="string-replace">
31 <xsl:with-param name="src" select="substring-after($src, $from)"/>
32 <xsl:with-param name="from" select="$from"/>
33 <xsl:with-param name="to" select="$to"/>
37 <xsl:value-of select="$src"/>