[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Infinite Recursion Looking for Whitespace. RESOLUT

Subject: RE: Infinite Recursion Looking for Whitespace. RESOLUTION
From: "HEATH ALLISON" <HEATH.ALLISON@xxxxxxxxxxxxxxx>
Date: Mon, 27 Jan 2003 15:02:07 -0600
resolut corporation
thanks for the assistance. here's what the working code looks like...

this allows me to call a template from my XSL that splits the last node of a sectioned document into two separate rows of a table, the top row is wider than the bottom, allowing for an image in the last TD of the bottom row. I'm sure there's probably a more economical way to do this, but I thought I'd post the code I came up with, for posterity sake.

<xsl:template name="lastBlah">
	<xsl:param name="leftStringLength"/>
	<xsl:param name="leftStringValue"/>
	<xsl:param name="topOrBot" />
		
		<xsl:if test="substring($leftStringValue,number($leftStringLength),1) != ' ' and $leftStringLength >0 ">
		

		
		<!-- recursive call -->
			<xsl:call-template name="lastBlah">
				<xsl:with-param name="leftStringLength" select="$leftStringLength - 1"/>
				<xsl:with-param name="leftStringValue" select="substring($leftStringValue,'1',number($leftStringLength)-1)" />
				<xsl:with-param name="topOrBot" select="$topOrBot"/>
			</xsl:call-template> 
		</xsl:if>
	
	<xsl:if test="substring($leftStringValue,number($leftStringLength),'1') = ' ' and $leftStringLength >0 ">
		<xsl:choose>
			<xsl:when test="$topOrBot=0">
				<xsl:value-of select="substring($leftStringValue,0,$leftStringLength)" />
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="substring(.,$leftStringLength)" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:if>
		
</xsl:template>

heath deforrest allison
"Arrowed!"


 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.