3 <!-- This is a public domain script released from http://exslt.org/ -->
5 <xsl:stylesheet version=
"1.0"
6 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
7 xmlns:
str=
"http://exslt.org/strings"
8 extension-element-prefixes=
"str">
10 <xsl:template name=
"str:padding">
11 <xsl:param name=
"length" select=
"0" />
12 <xsl:param name=
"chars" select=
"' '" />
14 <xsl:when test=
"not($length) or not($chars)" />
16 <xsl:variable name=
"string"
17 select=
"concat($chars, $chars, $chars, $chars, $chars,
18 $chars, $chars, $chars, $chars, $chars)" />
20 <xsl:when test=
"string-length($string) >= $length">
21 <xsl:value-of select=
"substring($string, 1, $length)" />
24 <xsl:call-template name=
"str:padding">
25 <xsl:with-param name=
"length" select=
"$length" />
26 <xsl:with-param name=
"chars" select=
"$string" />