Subject:Help, is it possible to have a javascript variable Author:hari jayraman Date:15 Sep 2006 08:44 AM
Hi gurus,
Is it possible to copy a value for XSL variable from a javascript variable?
Basically I have a counter set in my javascript file (global variable say 'mycount') and in my xslt I need to use the value of mycount to loop through the xsl:for-each
So in line 4 when I see the xsl (IE) getting the alert with correct value, but how I can make that available to the xsl variable <b>test<b>, so I can restrict the loop to the specified count.
Subject:Help, is it possible to have a javascript variable Author:hari jayraman Date:15 Sep 2006 08:49 AM
>Hi gurus,
>
>Is it possible to copy a value
>for XSL variable from a
>javascript variable?
>
>Basically I have a counter set
>in my javascript file (global
>variable say 'mycount') and in
>my xslt I need to use the
>value of mycount to loop
>through the xsl:for-each
>
>my js file (myscript.js)
><script>
> //global variables
> mycount=5;
> .....
> ......
></script>
>
>my xsl file (myxsl.xsl)
><?xml version="1.0"
>encoding="UTF-8"?>
><xsl:stylesheet
>version="1.0"
>xmlns:xsl="http://www.w3.org/1
>999/XSL/Transform"
> >
>
><xsl:output method="html"
>encoding="UTF-8" indent="yes"
>doctype-public="-//W3C//DTD
>HTML 4.01 Transitional//EN"
>/>
>
><xsl:template match="/">
>.......
>....... (call-template)
></xsl:template>
>
><!-- User defined Templates
>-->
>1.<xsl:template
>name="ItemTableContent">
>2. <script
>src="js/myscript.js"></s
>cript>
>3.
><script>parent.mycount)&
>lt;/script>
>4. <xsl:variable
>name="test" select="5"/>
>
>5. <xsl:for-each
>select="book/data/item[positio
>n() <=
>number($test)]">
>.....
>.....
>
>So in line 4 when I see the
>xsl (IE) getting the alert
>with correct value, but how I
>can make that available to the
>xsl variable
><b>test<b>, so I
>can restrict the loop to the
>specified count.
>
>I appreicate your time and
>guidance.
>
>Thanks and Regards
>Hari
A correction in line
3.<script>parent.mycount)</script> and
and rewriting the question
When I see the xsl (in IE) I am getting the of line 3) with correct expected value, but how I can make that available to the xsl variable <b>test<b>, so that I can restrict the xsl:for-each loop to the specified count.