Subject: Re: transform each character of a string From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 31 Jan 2000 10:27:27 GMT |
Examples : 1 is â 2 is ê 3 is î and so on. where are those entities defined. If acitc is what I think it is then that is a unicode letter so that one could be done with translate(.,`1`,'å') the other ones if they are ring-accent on letters are not single unicode characters so you can't use translate, but you could use this: <!-- replace all occurences of the character(s) `from' by the string `to' in the string `string'.--> <xsl:template name="string-replace" > <xsl:param name="string"/> <xsl:param name="from"/> <xsl:param name="to"/> <xsl:choose> <xsl:when test="contains($string,$from)"> <xsl:value-of select="substring-before($string,$from)"/> <xsl:value-of select="$to"/> <xsl:call-template name="string-replace"> <xsl:with-param name="string" select="substring-after($string,$from)"/> <xsl:with-param name="from" select="$from"/> <xsl:with-param name="to" select="$to"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$string"/> </xsl:otherwise> </xsl:choose> </xsl:template> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
transform each character of a strin, Frederic Schwebel | Thread | Re: transform each character of a s, Phil Lanch |
transform each character of a strin, Frederic Schwebel | Date | RE: Encoding problem, Kay Michael |
Month |