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

templates, not nested

Subject: templates, not nested
From: "Julie Mc Cabe" <julesofenergy@xxxxxxxxxxx>
Date: Thu, 17 May 2001 10:59:32 -0000
with param text
Hello,

Background to problem:

My inital query was about character transformations and this was resolved via David Pawsons web site (thanks to David Carisle & Michael Kay). However I want to perform 3 character transformation meaning I need to call this transformation template 3 times, my stylesheet is formed as a single template. I'm barking up the nested template tree a bit. I have followed the previous mails but I am nevertheless confused.


A brief description of my problem:


Therfore I am extracting text from an xml file and I want to replace 3 character in this text, any suggestions about the positioning and if its a <xsl:call-template>, <xsl:apply-template> with modes etc. I shall be very grateful as I'm confused!


template code to perform character transformation within a string:


<xsl:template name="replace-string">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="with"/>
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:value-of select="substring-before($text, $replace)" />
<xsl:value-of select="$with" />
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="substring-after($text,$replace)" />
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="with" select="$with"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>



Sample xslt of want I'm trying to achieve:


<xsl:template match="/">
<xsl:varabile name="title" select"...." />
want to call template replace-string here with param text=$title


Many Thanks, Julie Mc Cabe. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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.