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

Problem w/ call-template

Subject: Problem w/ call-template
From: Kim <kimba_40@xxxxxxxxx>
Date: Wed, 29 May 2002 16:11:23 -0700 (PDT)
call template problem
Hi,

I cannot figure out what is wrong w/ the following call-template.  Help!
The input XML file should have repetition of element:

<String>substring1,substring2,substring3,substring4,substring5</String>



This is a segment of the XSL file.  I'm trying call the template
"lastSubString" which recursively substring-after until the last substring. 
The "string" contains at least 2 substrings and can be up tothe nth string. 
The substring are seperated by a "," delimiter.  I need to get the last
substring in every string in the XML input file.

I got an error msg: Could not find template named: "lastSubString".  It is from
the "***" line.  What am I missing  here?  I checked the spelling; it is fine.

Thanks,


<xsl:template match="String">
	[...]
	***<xsl:call-template name="lastSubString">
		<xsl:with-param name="originalString" select="."/>
	</xsl:call-template>


<xsl:template name="lastSubString">
	<xsl:param name="originalString"/>
   	<xsl:choose>
      		<xsl:when test="contains($originalString,',')">
       			<xsl:call-template name="lastSubString">
                 		<xsl:with-param name="$originalString"
select="substring-after($originalString,',')"/>
             		</xsl:call-template>
         	</xsl:when>
   	  </xsl:choose>
   	  Last substring: <xsl:value-of select="$originalString"/>

</xsl:template>

</xsl:template>

=====
Kim

*************************
May the force be with you.
*************************

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

 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.