p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > XML > XSLT
I forgot my password Register Now
Register | FAQ | Members List | Calendar | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 21st, 2007, 01:55 AM
Authorized User
 
Join Date: Feb 2007
Location: CHENNAI, TAMILNADU, India.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to SOMANATHAN10
Default ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE

Hi,

I want to assign the value of var countno to a xsl:variable.
Anybody have ideas on this please suggest.

 <script language="javascript">
      {
    var countno= counter();
       }

      </script>
     <script language="javascript">
         var a;
        function counter()
       {
        a=a+1;
         return a;
        }
        </script>


C.SOMA
__________________
C.SOMA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 21st, 2007, 04:26 AM
mhkay's Avatar
Wrox Author
Points: 12,735, Level: 48
Points: 12,735, Level: 48 Points: 12,735, Level: 48 Points: 12,735, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 Posts
Default

If the script is invoking the transformation, then you will find there is a method in the API such as addParameter() that allows the script to bind a value to a global xsl:param defined in the stylesheet.

On the other hand, if the transformation is generating the script as part of its result tree, then there is of course no way the script can set a variable in the transformation because the script will never be executed until the transformation has completed.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assigning value from variable cyberddindia Classic ASP Basics 3 November 7th, 2006 11:57 AM
how to submit a form and post java script variable arabuafef ASP.NET 1.0 and 1.1 Basics 2 July 14th, 2006 10:28 PM
pass java variable to xsl variable kathy1016cats XSLT 1 June 14th, 2006 07:23 PM
Assigning a @@ROWCOUNT to a variable ioates SQL Server DTS 2 January 9th, 2004 04:16 AM
Help with assigning a variable from a binding dfranczak ADO.NET 0 July 17th, 2003 02:50 PM



All times are GMT -4. The time now is 06:38 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc