[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

Subject: RE: find capital letters in string and split it
From: "bryan" <bry@xxxxxxxxxx>
Date: Tue, 11 Feb 2003 10:44:55 +0100
linux find exec
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)
&gt; 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.