|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] templates, not nested
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
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
|

Cart








