xsl-list
[Top] [All Lists]

RE: Global variables

2003-07-30 09:00:17
Jose

Declare them at the start of you xslt outside any templates:

<xsl:variable name="MyVar" select=""/>

The select is usually the key bit. select="/*" or similar gives you a node,
select="'hello'" gives you a string type var.

Use them with a $ in front eg:

<xsl:value-of select="$MyVar"/>
<outPutElement value="{$MyVar}"/>
<xsl:for-each select="$MyVar//*">
 do this
</xsl:for-each/>

Cheers

Rod

-----Original Message-----
From: AROSO Jose Antonio [mailto:jose(_dot_)santos(_at_)enabler(_dot_)com]
Sent: 30 July 2003 16:38
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Global variables


Hi.

How can i declare and use global variables?


Best Regards

Jose



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


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________


________________________________________________________________
Any opinions expressed in this email are those of the individual and not 
necessarily the Company. Unless expressly stated to the contrary, this email is 
not intended to give rise to a new, or affect an existing, contractual or other 
legal relationship.This email and any files transmitted with it, including 
replies and forwarded copies which may contain alterations) subsequently 
transmitted from the Company, are confidential and solely for the use of the 
intended recipient. The unauthorised use, disclosure or copying of this email, 
or any other information contained or attached,is prohibited and could, in 
certain circumstances, be a criminal offence.

If you have received this email in error please notify the sender as soon as 
possible.

This footnote also confirms that this email message has been swept for the 
presence of computer viruses.

www.focusdiy.co.uk
_________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

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



<Prev in Thread] Current Thread [Next in Thread>