[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Modify Variable value


Subject: Re: [xsl] Modify Variable value
From: "Senthilkumaravelan K" <skumaravelan@xxxxxxxxxxxxxx>
Date: Wed, 25 Apr 2007 17:00:01 -0700

Hi Sreeni,
I have situtation where I need to find multiple or single values
	<xsl:for-each select="//LINE_ITEM[WARN_HG = YG'][generate-id() =
	generate-id(key('by-product-number', PRODUCT_NUMBER)[1])]">
			<xsl:if test="position()=last()">
				<xsl:choose>
					<xsl:when test="position()=1"> this product </xsl:when>
					<xsl:otherwise> these products </xsl:otherwise>
				</xsl:choose>
			</xsl:if>
based on that I need to change the noun to sigular or plural.
Please let me know if you have any work around for the same.
It is basically string concatenation ,because of this we are looping
muliple times.

Regards,
Senthil
On 4/25/07, Sreeni Yetchina -X (syetchin - Pure Solutions at Cisco)
<syetchin@xxxxxxxxx> wrote:
Senthil..
You asked "Is there any way.....?" The answer is NO, if you consider
standard XSLT
But when you are able to limit your XSLT file into a particular domain,
you can do achieve the similar Variable effect with the third part
embedded code in XSLT files (Example: JavaScript/Java Extensions/C#
Extensions etc).
Really tons of XSLT code is around without the actual variable in it.
If you have any particular situation that is expecting a variable use,
please let us know, that can be resolved with a work around
Sreeni

-----Original Message-----
From: Rashmi Rubdi [mailto:rashmi.sub@xxxxxxxxx]
Sent: Wednesday, April 25, 2007 3:59 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Modify Variable value

Hi Senthi,

XSLT is unlike other programming languages that allow field values to be
altered.

The concepts are a little different in XSLT, from my experience coming
from a background of other languages, so it helped me to look at XSLT
differently and to expect it to be different.

I was reading about the fact that one cannot update the value of a
variable XSLT 2.0 reference book by Michael Kay under "No Side Effects"
in chapter 1.

Also there's a nice explanation about it here:
http://www.dpawson.co.uk/xsl/sect2/nono.html#d1919e55

-Regards
Rashmi

On 4/25/07, Senthilkumaravelan K <skumaravelan@xxxxxxxxxxxxxx> wrote:
> Hi ,
> I would like to know ,is there any way,I could modify the variable
> value in my XSLT?
> Please let me know ,how Do I do that?
>
> Regards,
> Senthil


Current Thread
Keywords