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

Conditional Assigining

Subject: Conditional Assigining
From: "Sri ni" <srini75@xxxxxxxxxxx>
Date: Wed, 16 May 2001 15:48:24 -0000
assigining
Team,

<xsl:variable name="ID">-1</xsl:variable>
<xsl:for-each select="Section[parentID='0']">
	<xsl:if test="$ID=-1">
		<xsl:variable name="ID" select="sectionID" />
	</xsl:if>
id <xsl:value-of select="$ID"/>

Output:
-----------
id = -1.  In the first instance.

**********************
Please have a look on the above XML. The scope of the ID is getting lost once i get exit from the if loop which is not i want. The value of the global variable ID has to be set inside IF and then that should be visible to outer functions as well.



All i want is similar to this one. int x = 0; while ( true) { if ( x == 0 ){ x = 1; } x = 2; }

When the loop starts executing first time it will take the value from the sectionID and from the next time onwards i shall give the value for the variable id. Is that possible to do in XSL??


Can anyone help me out please???


Cheers
Srini

From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE:  Problem of syntax of filter ?
Date: Wed, 16 May 2001 15:48:29 +0100

> I declare $downloadType like this :
>
>           <xsl:variable name="downloadType">
>            <xsl:value-of
> select="$tchFile/Delivery/DeliveryDescription/@downloadType"/>
>                      </xsl:variable>

I think you'd better show us the whole stylesheet, because otherwise we'll
carry on imagining things you might have got wrong in the parts you haven't
shown us.

Mike Kay
Software AG


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



_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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.