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

updating a param value for recursion

Subject: updating a param value for recursion
From: RahilQ <qamar_rahil@xxxxxxxxxxx>
Date: Thu, 21 Apr 2005 15:45:05 +0100
param value
Hi

Ive tried to look through the archives for a previous example similar to my query but I couldnt find any. Hence would appreciate any help.

I have a string of the form '<Value>at1000 First at2000 Second at3000 Third</Value>'

I would like an output of the form
<Value ref="at1000">First</Value>
<Value ref="at2000">Second</Value>
<Value ref="at3000">Third</Value>

I have written a template for this

<xsl:template name="atCodes">
<xsl:param name="atStr"/> <!--receives string of the form 'at1000 First at2000 Second at3000 Third'-->
<Value>
<xsl:attribute name="ref" select="substring-before($atStr,$splitString)"/> <!--$splitString = ' '-->
<xsl:variable name="interim" select="normalize-space(substring-after($atStr,$splitString))"/>
<xsl:value-of select="substring-before($interim,$splitString)"/>
</Value>
<xsl:call-template name="atCodes">
<xsl:with-param name="intem" select="substring-after($interim,$splitString)"/> <!--Generates compilation error for $interim-->
</xsl:call-template>
</xsl:template>


The compiler rightly complains that the '$interim' variable isnt declared.

What Id really like is for the param '$atStr' to be updated in the <Value> block. I was thinking of using the replace() function but dont know how to implement it in this case.

Suggestions please.

Thanks
Rahil

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.