[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: find capital letters in string and split it
As an aside this is what I got to last night before Dimitre came with the fxsl solution, problem of course is that it won't handle single letter words: <xsl:template match="string"> <xsl:variable name="splitIDbig" select="normalize- space(translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZ',' '))"/> <xsl:variable name="splitIDsmall" select="normalize- space(translate(.,'abcdefghijklmnopqrstuvwxyz',' '))"/> <xsl:variable name="mingle"> <xsl:call-template name="mingler"> <xsl:with-param name="splitIDbig" select="normalize- space($splitIDbig)"/> <xsl:with-param name="splitIDsmall" select="normalize- space($splitIDsmall)"/> </xsl:call-template> </xsl:variable> <result> <xsl:value-of select="$mingle"/> </result> </xsl:template> <xsl:template name="mingler"> <xsl:param name="splitIDbig"/> <xsl:param name="splitIDsmall"/> <xsl:param name="result"/> <xsl:choose> <xsl:when test="string-length($splitIDsmall) > 0"> <xsl:variable name="tempstring"> <xsl:choose> <xsl:when test="substring-before($splitIDsmall,'')"> <xsl:value-of select="concat($result,substring-before($splitIDsmall,' '),substring-before($splitIDbig,' '),' ')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat($result,$splitIDsmall,$splitIDbig)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:call-template name="mingler"> <xsl:with-param name="splitIDbig" select="substring- after($splitIDbig,' ')"/> <xsl:with-param name="splitIDsmall" select="substring-after($splitIDsmall,' ')"/> <xsl:with-param name="result" select="$tempstring"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="$result"/> </xsl:otherwise> </xsl:choose> </xsl:template> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|