Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 November 28th, 2007, 08:21 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL ERROR -Regarding the global variable


Iam declaring the global variable with value-of-select
When Iam using this variable anywhere in the code
Only at first occurrence correct value is appearing.
while at the rest of places random and wrong value is appearing


Can please suggest me what could be the reason and solution.

Thanks in advance



 
Old November 28th, 2007, 08:28 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Show some code.

--

Joe (Microsoft MVP - XML)
 
Old November 28th, 2007, 08:37 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sorry, I can't find the bugs in your code without seeing your code.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old November 28th, 2007, 09:29 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default


............................
       <xsl:variable name="PRODUCTTYPE">
        <xsl:if test="$RISKTYPE = 'PCP'">P</xsl:if>
        <xsl:if test="$RISKTYPE = 'PCT'">T</xsl:if>
    </xsl:variable>

...............................
<Dummy>
<xsl:value-of select="$PRODUCTTYPE"/>
</Dummy>

Now can you please suggest


 
Old November 28th, 2007, 10:07 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's nothing wrong with the code you've shown. This means the bug is in the code you haven't shown.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Global variable restrictions in the <xsl:key> iceandrews XSLT 2 August 25th, 2008 01:16 PM
How to declare the global variable in global.asax? calyn_gately ASP.NET 3.5 Basics 0 August 6th, 2008 08:06 PM
comapring global variable value to local variable amhicraig XSLT 6 December 5th, 2007 12:16 PM
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
The difference between xsl:variable and xsl:param NEO1976 XML 2 July 24th, 2006 06:05 AM





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