home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" ><xsl:output method="xml" indent="yes"/>
-
- <xsl:template name="TrimR">
-
- <!--This template will recursively trim the trailing spaces from a string-->
- <xsl:param name="strInput" select="''"/>
- <xsl:variable name="strLen" select="string-length($strInput)" />
- <xsl:variable name="strOutput" select="substring($strInput, 1, $strLen - 1 )" />
- <xsl:variable name="strLastChar" select="substring($strInput, $strLen, 1 )" />
-
- <xsl:choose>
- <xsl:when test="$strLastChar = ' '">
-
-
- <!-- At this point, the template will recursively call itself until it is trimmed -->
- <xsl:call-template name="TrimR" >
- <xsl:with-param name="strInput" select="$strOutput"/>
- </xsl:call-template>
-
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$strInput" />
- </xsl:otherwise>
- </xsl:choose>
-
-
- </xsl:template>
-
- </xsl:stylesheet>
-