RE: [xsl] Global Variable

Subject: RE: [xsl] Global Variable
From: aruniima.chakrabarti@xxxxxxxxxxxxxxxxxx
Date: Wed, 14 Aug 2002 16:14:19 +0530
I was trying something like this... but this won't really work as I want the
node-list in the param.... Any ideas???

<xsl:param name="Path" select="'p_ptr_str_ln_txn_inq_com'"/>

<xsl:variable name="xpath">
	<xsl:choose>
		<xsl:when test="string-length($Path) != 0">

			<xsl:value-of select="//Header/*[name()=$Path]"/>

		</xsl:when>				
		<xsl:otherwise>

				<xsl:value-of select="//Header"/>


		</xsl:otherwise>				
	</xsl:choose>			
</xsl:variable>

Regards,
aruniima

 -----Original Message-----
From: 	Vasu Chakkera [mailto:vasucv@xxxxxxxxxxx] 
Sent:	Wednesday, August 14, 2002 3:40 PM
To:	xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:	RE: [xsl] Global Variable

James,
>Hello Aruniima,
>
>You will have to update your XSL knowledge, <xsl:param/> and 
><xsl:variable/>
>when set, never change....
But isnt it possible to set the variable value based on some condition ??
like
<xsl:variable name = "myVar">
<xsl:choose>
<xsl:when test = "some-condition"> some value</xsl:when>
<xsl:otherwise>some-other-value</xsl:otherwise>
</xsl:choose>
</xsl:variable>

If the objective is to set a variable based on condition.. as arunima put 
it..
"Is it possible to have a Global variable kind of concept which can
be set to different values in the program based on conditions & used???"

If thaz what is required?
Vasu

>From: "James Fuller" <james.fuller@xxxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: RE: [xsl] Global Variable
>Date: Wed, 14 Aug 2002 10:15:33 +0100
>
>
>
>
> > aruniima.chakrabarti@xxxxxxxxxxxxxxxxxx
> > Sent: 14 August 2002 10:10
>
> > Hi,
> > 	Is it possible to have a Global variable kind of concept which can
> > be set to different values in the program based on conditions & used???
>
>
>Hello Aruniima,
>
>You will have to update your XSL knowledge, <xsl:param/> and 
><xsl:variable/>
>when set, never change....
>
>this may be an odd concept to you, possibly coming from a world where we 
>use
>variables quite extensively this way.....
>
>think of the days when we used GOTO statements...remember that with line
>numbers ..... people back then couldnt believe that you didn't have to do
>this... the analogy is similar to using variables.
>
>check out the xslt FAQ at www.dpawson.co.uk for more information.
>
>though it is possible that you are just asking on how to use 
><xsl:variable/>
>or <xsl:param/>
>
>once again, check the FAQ, and if u still have a problem then post your
>sample XSLT and XML and we will try to solve the problem.
>
>cheers, jim fuller
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
----------------------------------------------------------------------------

This message contains privileged and confidential information and is
intended only for the individual named. If you are not the intended
recepient you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if you
have received this e-mail by mistake and immediately delete this e-mail from
your system.


E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission.  If verification is required
please request a hard-copy version.


--------------------------------------------------------------------------

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread