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

Re: How to assign a value and reuse a global variable

Subject: Re: How to assign a value and reuse a global variable
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Mon, 11 Feb 2002 19:58:57 +0000
assign value to xsl variable
>What I am trying to is this.
>At the very top level of my xsl doc I a declare an empty variable with no values
>like this
>
><xsl:variable name ="monday"/>
>
Strictly speaking this gives you a variable whose value is an empty
string - not quite the same thing as 'no value'.

>now in my temlates at run time I want to assign this variable a value of 
>
><xsl:variable name = "$monday" select = "'Monday'"/>
>
There is no assignment statement in XSLT.  What you are doing is
creating a *new* variable whose name is $monday (rather than simply
monday).  $monday is not a legal variable name, so your processor
should be signalling an error.

>Now first of all is it possible to do?If it is then is my syntactic approach
>is valid,and if it is then how come I don't see the value I set for monday :-)
>
It depends what you are trying to do.  It may be as simple as putting
<xsl:variable name = "monday" select = "'Monday'"/>

(in which case the top level declaration is probably unnecessary).

If not, you will need to tell us what your stylesheet is trying to
achieve.

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

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


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.