Re: [xsl] Variable value change based on condition

Subject: Re: [xsl] Variable value change based on condition
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 05 Oct 2010 11:09:03 +0100
On 05/10/2010 10:39, sudheshna iyer wrote:
I need a variable whose value can be changed based on the if conditions.

That's basically saying that you need to be able to pass c syntax to a XSLT compiler. That doesn't work.

The expressive power of declarative languages in which variables do not change there values once bound is the same as that of imperative languages with mutable variables. So you can't "need" to change the value of a variable.

If you said what transform you need to do someone wiould most likely show you how to do it without changing the value of a variable, or as is often the case, without using a variable at all.

> Conditions: > If all the 3 input variables are present,

Variables in XSLT have lexical scope and always have a value within that scope. i see though you say

> variable's presence (not empty).

Not sure here whether you mean empty node set or empty string,

> If there are only two input variables present (inputVar1, inputVar2), > map inputVar1 -> outputVar1 and map inputVar2 -> outputVar1.

this seems to say you want to set outputVar1 to being both $inputVar1 and $inputVar2 ?


________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

Current Thread