Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2006, 01:43 AM
Authorized User
 
Join Date: Sep 2006
Location: pune, Maharastra, India.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default setting value of the variables depending on condit

How to set the value of variable depending upon the condition?
Hi,
suppose i have declare the varaible with default value.
        <xsl:variable name="flag" select="0"/>
        <xsl:for-each select="/root">

         <xsl:variable name="flag" select="1"/>
        </xsl:for-each>

        <xsl:if test="$flag=1">
                <xsl:value-of select="root/name"/>
        </xsl:if>

Here variable flag loosing its scope.

How do i reset the value of variable depending upon the condition?

If it is not possible using the xsl:variable then what should i use?


sheetal
__________________
sheetal




Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get values depending on the attribute vidhya XSLT 1 July 8th, 2005 03:55 AM
to get Distinct Node depending on attribute value chaitanyaXML XML 5 March 29th, 2005 10:26 AM
Setting Session variables problems hoffmann JSP Basics 0 February 9th, 2005 11:58 AM
Displaying text depending on the value of a field lguzman Access VBA 1 May 30th, 2004 06:14 PM
Code depending on Register Globals char Beginning PHP 2 July 31st, 2003 11:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.